Commit Graph

152 Commits

Author SHA1 Message Date
Kovarththanan Rajaratnam 27f7d88c84 Also fake empty field_info's by gracefully handling NULL field_info pointer elsewhere.
svn path=/trunk/; revision=29490
2009-08-21 11:03:30 +00:00
Kovarththanan Rajaratnam 261a8406bc TRY_TO_FAKE_THIS_ITEM now fakes FT_PROTOCOL per default. If there are any users (e.g. proto_hier_stats.c, others?) that relies on FT_PROTOCOL nodes being created they'll now need to call the newly introduced epan_dissect_fake_protocols() to disable this optimization.
Also make use of TRY_TO_FAKE_THIS_ITEM in proto_tree_add_text_node(), proto_tree_add_none_format() and proto_tree_add_protocol_format().

svn path=/trunk/; revision=29380
2009-08-11 18:08:03 +00:00
Kovarththanan Rajaratnam 4e177a23c7 Use PITEM_FINFO.
svn path=/trunk/; revision=29357
2009-08-09 18:15:36 +00:00
Kovarththanan Rajaratnam 083729e02c Add PTREE_FINFO and use PITEM_FINFO when possible.
svn path=/trunk/; revision=29355
2009-08-09 17:57:31 +00:00
Kovarththanan Rajaratnam 3512e485ca Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail.
svn path=/trunk/; revision=29354
2009-08-09 17:33:23 +00:00
Jörg Mayer 45ab8d50d2 Warning fix: comma at end of enum
svn path=/trunk/; revision=29289
2009-08-04 07:50:49 +00:00
Anders Broman 2a80b47ce4 Whitespace change.
svn path=/trunk/; revision=29211
2009-07-28 09:26:18 +00:00
Stig Bjørlykke 221225e0f3 From Kovarththanan Rajaratnam via bug 3719:
This patch optimizes proto_tree_prime_hfid() + friends and
plugs a memleak in the process.

From me:
Removed unused hfindex in proto_tree_new_item()
Fixed ref_count entry in struct header_field_info.

svn path=/trunk/; revision=29137
2009-07-18 20:10:14 +00:00
Jaap Keuter d27c92e496 Add posibility to mark protocol as private. This prevents inadvertent Wiki access.
svn path=/trunk/; revision=27533
2009-02-24 17:24:03 +00:00
Gerald Combs 6d04f793f0 Back out r27047 and r27053.
svn path=/trunk/; revision=27062
2008-12-19 17:39:52 +00:00
Martin Mathieson 3633774826 Make proto_tree_add_bytes_format() (unused) behave as expected.
Was identical to proto_tree_add_bytes_format_value().

svn path=/trunk/; revision=27047
2008-12-18 17:08:26 +00:00
Stig Bjørlykke 5e5a674e76 Show both short and long protocol name in the Filter Expression dialog.
svn path=/trunk/; revision=26537
2008-10-24 07:48:09 +00:00
Jaap Keuter 0fde67dd54 From Andrew Narver:
Currently, if you call proto_tree_free on anything other than the root node of a tree 
the tree will get left in an inconsistent state.  This is because the parent is left pointing 
to the newly freed child.

The traversal code is updated, the parent node update is currently disabled since 
freeing is done for the complete tree only at this time, so there is no need to keep 
the parent node consistent.

svn path=/trunk/; revision=26466
2008-10-15 20:02:15 +00:00
Stig Bjørlykke 6012a91ebb Added an option to syntax check only a single field name.
svn path=/trunk/; revision=26405
2008-10-10 17:00:38 +00:00
Anders Broman da85c3dfab From Alexey Neyman :
This patch implements a function for dissecting bitfields with better control
over the resulting representation than the existing proto_tree_add_bitmask()
routine. This function will be used by reworked IPMI/ATCA dissector (bug 2048).

The function is described in README.developer. In short, the differences are as
follows:

- The new function does not require a hf_XXX field for the whole bitmask. When
the bitmask includes several unrelated fields, such hf_XXX field does not make
sense.

- The new function allows better control over the way the sub-item descriptions
are added to the top-level item. For example, proto_tree_add_bitmask() function
does not add non-enumerated integers, does not use true_false_string to display
boolean.

- The new function allows to specify "fallback" text for the top-level item
which is used if no items were added to the top-level item.

svn path=/trunk/; revision=25920
2008-08-04 20:41:43 +00:00
Anders Broman 876e751069 From Alexey Neyman :
Implement BASE_CUSTOM display type

svn path=/trunk/; revision=25870
2008-07-30 12:30:02 +00:00
Jeff Morriss acd338f422 Remove the (long deprecated) proto_tree_add_*_hidden() functions
svn path=/trunk/; revision=25820
2008-07-24 15:35:29 +00:00
Guy Harris 094911ef4f Rename arguments not to collide with function names, to avoid warnings
from -Wshadow, as noted by John Smith.

svn path=/trunk/; revision=25540
2008-06-23 20:15:30 +00:00
Richard van der Hoff bcfb45de67 fields passed into proto_tree_add_bits_* should have bits==0
svn path=/trunk/; revision=25074
2008-04-16 09:49:39 +00:00
Luis Ontanon 906d2f3cbb http://www.wireshark.org/lists/wireshark-dev/200803/msg00308.html
proto.[hc]
    define new APIs to allow delayed registration of protocol fields,
	so that dissectors with "flexible" fields  like xml, radius, diameter,
	snmp do not have to load their files at startup but can do so as late as possible.

gtk/dfilter_expr_dlg.c :
	have the expression dialog registering all prefixes so that all fileds appear in the dialog

tshark.c
	register all prefixes when called with -G

epan/radius_dict.l
epan/dissectors/packet-radius.c
epan/dissectors/packet-radius.h
	refactor registration to delay dictionary loading as long as possible



svn path=/trunk/; revision=24762
2008-04-03 22:13:52 +00:00
Stig Bjørlykke a2d1e9005d This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files.

This can be found in the "Configuration Profiles..." menu item from the Edit
menu, or by pressing Shift-Ctrl-A.  It's also possible to start wireshark
and tshark with a named profile by using the "-C ProfileName" option.
A new status pane in the main window will show the current profile.

The configuration files currently stored in the Profiles are:
- Preferences
- Capture Filters
- Display Filters
- Coloring Rules
- Disabled Protocols
- User Accessible Tables

The recent data are by design not added to the profile.

Planned future enhancements:
- make a more convenient function to switch between profiles
- add a "clone profile" button to copy an existing profile
- make the profiles list active and accept return as OK
- save users "Decode as" in the profile
- make new, clone and deletion of profiles more secure
- make some of the recent values available in the profile

This patch also fixes:
- setting default status pane sizes
- a bug setting status pane for packets when not having main lower pane.

svn path=/trunk/; revision=24089
2008-01-14 16:40:23 +00:00
Jaap Keuter abe4e72137 Describe text only field as "Text Item", shown in status bar.
Improve documentation headers.

svn path=/trunk/; revision=23938
2007-12-22 10:47:26 +00:00
Jaap Keuter 4c8455b1fd Clean up header field info comments.
svn path=/trunk/; revision=23872
2007-12-15 13:21:05 +00:00
Guy Harris 04938c7926 Reserve 20 bits for expert "event groups", to leave room for more.
Shuffle the expert severities down, and note that we have only 8 bits
available for FI_ flags unless you shrink the set of event groups and
shuffle them and the expert severities up.

svn path=/trunk/; revision=23731
2007-12-04 01:26:02 +00:00
Guy Harris ce635c2310 Severities are unsigned.
svn path=/trunk/; revision=23727
2007-12-03 23:02:09 +00:00
Guy Harris ebd47f95d1 Make the flags field a guint32, to make it clear that it's 32 bits.
Move the expert information bits to the top of that field, to avoid
collisions (we had a collision with the 0x00000004 bit).

svn path=/trunk/; revision=23726
2007-12-03 22:48:49 +00:00
Stig Bjørlykke 72af3183ab Added functionality to highlight the FCS bytes in Ethernet and IEEE 802.11
packets in the Packet Details View.

This "appendix" bytes are not copied with the Copy functions or in the
Export Selected Packet Bytes.

svn path=/trunk/; revision=22887
2007-09-17 12:12:02 +00:00
Luis Ontanon 9865b6346f As per Ulf's request add ${proto.field} macros that will use the value of the given field has in the last selected packet.
svn path=/trunk/; revision=22427
2007-07-30 23:32:47 +00:00
Anders Broman b688f9154a Split tvb_get_bits64 into tvb_get_bits8 tvb_get_bits16 tvb_get_bits32 and tvb_get_bits64
and use them in proto_tree_add_bits_ret_val().

svn path=/trunk/; revision=21828
2007-05-18 16:46:35 +00:00
Graeme Lunt cf56e76be9 Updated splash screen for Wireshark that shows the initialisation progress.
The splash screen shows a progress bar and a percentage complete - like the progress dialog.
As dissectors are initialised and handed off the name is shown. However, the names of plugin dissectors are not shown.
The update to the make-dissector-reg shell script has been tested, though I think generally the python version is used.


svn path=/trunk/; revision=21716
2007-05-07 17:55:42 +00:00
Anders Broman 43bb2aea51 Add:
proto_tree_add_bits_ret_val()
tvb_get_bits()
And modify
proto_tree_add_bits() not to return a value.
little endian is not yet implemented.

svn path=/trunk/; revision=21607
2007-04-28 12:13:25 +00:00
Anders Broman ccac0e7983 Change the signature of proto_tree_add_bits() and add proto_tree_add_bits_ret_val()
which will hopefully be more acceptable.
Change name of tvb_get_bits() in ansi_801

svn path=/trunk/; revision=21594
2007-04-26 06:39:29 +00:00
Anders Broman fea883ebec Add a new proto function proto_tree_add_bits() which adds bits to the tree
starting at the bit offset given for the number of bits indicated which wll also return
the value of the bits.
Experimental and for review, documentation to be updated.

svn path=/trunk/; revision=21556
2007-04-24 19:24:14 +00:00
Stephen Fisher 3288a39db2 From Sebastien Tandel:
copy paste hit again, here is a patch with the accurate declaration of
RVALS in proto.h
Thx gcc-4.1.2 for finding new ways of generating strict aliasing warnings :)

patch with accurate comment and declaration.


svn path=/trunk/; revision=21157
2007-03-23 18:48:57 +00:00
Stephen Fisher aa897723ff From Sebastien Tandel:
Here is an updated patch for proto_tree_add_item and the
range_string structure. The new macro RVALS() can be used as the macro
VALS() in the declaration of your hf_register_info with another
structure (range_string).  Be aware that you *have to* ORed the value of
the field display with BASE_RANGE_STRING constant and it can 'only' be
used with FT_(U)INT* types in a header_field_info.


svn path=/trunk/; revision=20805
2007-02-14 00:39:48 +00:00
Stephen Fisher b68220cc22 Fix indentation of field_info struct definition
svn path=/trunk/; revision=20556
2007-01-25 20:47:37 +00:00
Guy Harris 0fb0fa8794 Put
#ifdef __cplusplus
	extern "C" {
	#endif /* __cplusplus */

		...

	#ifdef __cplusplus
	}
	#endif /* __cplusplus */

wrappers into some header files, for the benefit of C++ plugins.  Also,
add multiple-include protections.

svn path=/trunk/; revision=20485
2007-01-18 18:43:30 +00:00
Guy Harris 44c0624bd9 Add a WIRESHARK_RUN_FROM_BUILD_DIRECTORY environment variable on UN*X;
if set, and if the program isn't running with additional privileges,
it'll treat the directory in which the program is found as the data
directory.

If, on Windows, the version-number subdirectory of {data
directory}\plugins doesn't exist (which is assumed to mean that the
program is being run from the build directory), or if, on UN*X,
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set, the plugin directory is the
"plugins" subdirectory of the data directory, and all subdirectories of
that directory are scanned for plugins, as the "plugins" subdirectory of
the build directory contains subdirectories for the plugins; this means
that if we're running from the build directory, we'll find the plugins
we built in the build tree.

When generating the wireshark-filter man page, run tshark with
WIRESHARK_RUN_FROM_BUILD_DIRECTORY set, so it uses the plugins from the
build to generate the list of filters.

svn path=/trunk/; revision=20261
2007-01-02 06:49:40 +00:00
Ronnie Sahlberg 41c258daf3 create a nice helper to dissect bitmasks and implement some test useage of it in the scsi dissector
svn path=/trunk/; revision=20002
2006-11-27 14:50:23 +00:00
Guy Harris d3fed959bc Have separate proto_construct_match_selected_string() and
proto_can_match_selected() routines, to more clearly separate the two
functions - but have them both call the same underlying routine, so
they both make the same decisions as to whether a match-selected string
can be constructed or not.

svn path=/trunk/; revision=19976
2006-11-24 18:25:23 +00:00
Guy Harris 37a6c02697 Rename proto_construct_dfilter_string() to
proto_construct_match_selected_string() to indicate what it does - and
have it return a Boolean indication of whether the string could be
built, returning the string through a pointer, and, if that pointer is
null, have it just return the Boolean and not construct the string.

Get rid of proto_can_match_selected() -
proto_construct_match_selected_string() can be used for that, which
means we have only one piece of code that knows whether a "match
selected" string can be constructed or not.

Have proto_construct_match_selected_string() support matching
zero-length FT_NONE (and FT_PCRE, but that shouldn't happen) fields even
if there's no epan_dissect_t, as such a match just checks whether the
field is present.

svn path=/trunk/; revision=19967
2006-11-23 21:16:46 +00:00
Graeme Lunt 23937f82c7 A new field information flag, FI_URL, to indicate a field contains a URL.
This is used to display the field underlined and to allow the user to double-click on it (like FT_FRAMENUM) to open the URL in the configured browser. 
Example usage in the x509ce and logotype certificate extensions. 


svn path=/trunk/; revision=19383
2006-09-30 14:37:09 +00:00
Gerald Combs 9e23f31e5f Add support for reading from stdin under Windows. Based on a patch sent
in last year by Gianluca Varenni.

Add partial support for reading from named pipes (currently disabled).

Move utf_8to16() and utf_16to8() to a separate module (unicode-utils.[ch])
so that we don't have to cut and paste code in dumpcap.c.

Fix up whitespace.

svn path=/trunk/; revision=19291
2006-09-22 21:14:54 +00:00
Tomas Kukosa 539102ca60 - new function ssl_dissector_delete()
- register H.225.0 over TLS (configurable port 1300)
- register SIP over TLS (fixed port 5061)
- new function proto_tree_get_root()

svn path=/trunk/; revision=19059
2006-08-28 07:05:02 +00:00
Ulf Lamping df377ffcc5 fix a comment
svn path=/trunk/; revision=18527
2006-06-21 07:26:39 +00:00
Gerald Combs f7e38bd5e6 Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variable
definition in the Catapult DCT2000 code.

svn path=/trunk/; revision=18524
2006-06-20 18:30:54 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Luis Ontanon 850dfe8fa2 add proto_all_finfos() that will return a GPtrArray containing every finfo found in a tree.
svn path=/trunk/; revision=17741
2006-03-27 19:28:02 +00:00
Anders Broman 61b223303a From Greg Morris:
Modification to (proto.h) is made to add an additional expert group type of PI_REQUEST_CODE to allow Request tag information to be passed to the expert tap. This is for such reasons where a dissector would like to echo specific information about certain types of requests. For example: NCP connection request is really a request not a REPLY_CODE. Same is true for the TCP SYN request.

Changes to packet-ncp.c
1. Server broadcast message flag. Now indicates if the message is a pending message or an oplock clear notification.
2. Cleanup of packet signature detection process. Previous method had some flaws so I redesigned it. Appears to be solid now.
3. Echo NCP Server Session information to expert tap.
 
Note on item #3: NCP Connection+Task = NCP Session, a Single connection can have many tasks. The server sees each connection/task as a unique session. For this reason the NCP session information is now echoed to the expert composite statistics so that you can easily identify the different NCP processes and sessions. It is important to NCP analysis to understand that each session is most likely a different program on the requesting host sharing the same NCP connection.
 
Changes to packet-ncp2222.inc
1. Comment out the echo of NCP connection info to expert tap. Replaced by NCP sessions.
2. Add displayEID in request decode (resolves Coverity defect for dead code in NCP dissector)
 
Changes to ncp2222.py
1. Fix for endian display of bindery object type in NCP 0x1720.
2. Fix for size of bindery object type to 2 bytes instead of 4 to match other bindery NCP's.

svn path=/trunk/; revision=17636
2006-03-15 18:56:35 +00:00