summaryrefslogtreecommitdiff
path: root/ui/gtk/packet_win.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-15More "FT_BOOLEAN is 64-bit" fixes.Guy Harris1-1/+1
Change-Id: Iaacd492858ca2fb98c4947d587fbbd26fc102a7d Reviewed-on: https://code.wireshark.org/review/14486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-18Don't add the wiretap directory to the list of include directories.Guy Harris1-2/+2
If you include something from the wiretap directory, always precede it with wiretap/. Fix some includes of files in the top-level directory to use a path relative to the current directory, not relative to the wiretap directory. This makes it a bit clearer what's being included. Change-Id: Ib99655a13c6006cf6c3112e9d4db6f47df9aff54 Reviewed-on: https://code.wireshark.org/review/13990 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-04Rename ipv4_addr and ipv6_addr to indicate their full contents.Guy Harris1-1/+1
They're not just addresses, they also include a mask length for IPv4 and a prefix length for IPv6. Rename them appropriately. Rename the old ipv4_addr_and_mask() and ipv6_addr_and_mask() to reflect that 1) they fetch data from a tvbuff and 2) *don't* fetch the mask length or prefix length, those lengths are passed as arguments to indicate how many bytes worth of address to fetch. Change-Id: I4cad5a186ad7bfcb60022a91dbe8bc8479e6471f Reviewed-on: https://code.wireshark.org/review/13035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-22Use address functions instead of ADDRESS macros in ui.Gerald Combs1-1/+1
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the ui directory. Change-Id: I10e95e66c8da5b880133452ebc484c53046e87ba Reviewed-on: https://code.wireshark.org/review/11199 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-29Take all epan_column_info members that always get allocated to "number of ↵Michael Mann1-1/+1
columns" to share their own data structure. Change-Id: Ib982662db6cf68730a7d121eac60d9bc5ae67429 Reviewed-on: https://code.wireshark.org/review/9195 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-05Remove epan member from PacketWinData and just use cfile.epan when ↵Michael Mann1-7/+5
redissecting a packet window. A pointer to cfile.epan was saved by the window when it's created, but any redissection will remove the epan_session used by cfile.epan underneath the window, so let's just use cfile.epan directly. Bug: 11043 Change-Id: Ie6b85708025f8ab7d5e5dc48ad99fee0931af472 Reviewed-on: https://code.wireshark.org/review/7915 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: Guy Harris <guy@alum.mit.edu>
2015-01-13Consistently use the "g_string_free returns a C string pointer" idiom.Guy Harris1-6/+1
g_string_free(str, FALSE) frees the GString container but not the underlying g_malloc()ed string; instead, it returns a pointer to the g_malloc()ed string. Fix those places that didn't already get the string pointer from g_string_free() to do so rather than manually extracting the string themselves. And fix one place that didn't even need to use a string - it was just scanning a C string without even modifying it. Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5 Reviewed-on: https://code.wireshark.org/review/6532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-06Replace ep_address_to_str with address_to_str.Michael Mann1-1/+4
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b Reviewed-on: https://code.wireshark.org/review/6323 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-12-28Create FT_FCWWN field type.Michael Mann1-2/+3
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type. Change-Id: I4ca77870499fd8239584a70874998b5d194a7167 Reviewed-on: https://code.wireshark.org/review/6036 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.Michael Mann1-2/+3
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-20Fix support for writing out edited records.Guy Harris1-24/+4
Add a cf_set_frame_edited() routine to set the record header and data for a record; have it do all the non-GUI work, and have it set the file's "unsaved changes" flag. Have the GUI code just call that routine and then update the title bar to reflect the unsaved changes. While we're at it, unmark a no-longer-unused argument to save_record(). Change-Id: Ieb513fdf423b388519527621ecec4cf634b98caf Reviewed-on: https://code.wireshark.org/review/4885 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-12Make boolean bitmask type 64-bit wideDaniel Mack1-1/+1
There are protocols out there that have 64-bit wide bit mask fields, so make the internal representation and bitfield decoders 64-bit aware. For this, the ws_ctz() fallback and bits_count_ones() have to be tweaked slightly. Change-Id: I19237b954a69c9e6c55864f281993c1e8731a233 Reviewed-on: https://code.wireshark.org/review/4158 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-02Rename buffer_ routines to ws_buffer_ to avoid name collisions.Guy Harris1-1/+1
In particular, epan/wslua/lrexlib.c has its own buffer_ routines, causing some linker warnings on some platforms, as reported in bug 10332. (Not to be backported to 1.12, as that would change the API and ABI of libwsutil and libwiretap. We should also make the buffer_ routines in epan/wslua/lrexlib.c static, which should also address this problem, but the name change avoids other potential namespace collisions.) Change-Id: I1d42c7d1778c7e4c019deb2608d476c52001ce28 Reviewed-on: https://code.wireshark.org/review/3351 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-25Add support for dissecting non-packet records.Guy Harris1-4/+5
Add a dissector table indexed by the file type, and, for the file-type-specific records, have the frame dissector skip the usual pseudo-header processing, as the pseudo-header has a file-type-specific record subtype in it, and call the dissector for that file type's records. Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9 Reviewed-on: https://code.wireshark.org/review/1782 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris1-3/+3
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."Guy Harris1-1/+1
This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4. A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress. Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6 Reviewed-on: https://code.wireshark.org/review/1741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Allow wtap_read() and wtap_seek_read() to return non-packet records.Guy Harris1-1/+1
This is the first step towards implementing the mechanisms requestd in bug 8590; currently, we don't return any records other than packet records from libwiretap, and just ignore non-packet records in the rest of Wireshark, but this at least gets the ball rolling. Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574 Reviewed-on: https://code.wireshark.org/review/1736 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Revert "Refactor Wiretap"Guy Harris1-1/+1
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. This isn't building, and looks as if it requires significant work to fix. Change-Id: I622b1bb243e353e874883a302ab419532b7601f2 Reviewed-on: https://code.wireshark.org/review/1568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Refactor WiretapMichael Mann1-1/+1
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality. The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes. bug:9607 Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae Reviewed-on: https://code.wireshark.org/review/1485 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-12Get rid of more tvb_get_nstringz* calls.Guy Harris1-1/+1
Add an FT_STRINGZPAD type, for null-padded strings (typically fixed-length fields, where the string can be up to the length of the field, and is null-padded if it's shorter than that), and use it. Use IS_FT_STRING() in more cases, so that less code needs to know what types are string types. Add a tvb_get_stringzpad() routine, which gets null-padded strings. Currently, it does the same thing that tvb_get_string_enc() does, but that might change if we don't store string values as null-terminated strings. Change-Id: I46f56e130de8f419a19b56ded914e24cc7518a66 Reviewed-on: https://code.wireshark.org/review/1082 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-11Migrate GTK icon handling to GTK 3.10 APIBalint Reczey1-0/+9
GtkStockItem usage is deprecated with all the GTK_STOCK_.* stock ids. We keep a stock id based approach but without relying on GTK's GtkStockItem system. We create our own internal stock ids for {icon, label} tuples and keep the original GTK stock id #define-s and values to preserve backward compatibility. Change-Id: Ia0b35a5903f079e92c8026e3df21bbf0be2d06b0 Reviewed-on: https://code.wireshark.org/review/302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-02-25Remove trailing whitespaceBill Meier1-1/+1
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0 Reviewed-on: https://code.wireshark.org/review/385 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2013-12-23From Ville Skyttä: Spelling FixesBill Meier1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591 svn path=/trunk/; revision=54387
2013-12-23Add FT_SYSTEM_ID type and convert the dissectors that use print_system_id ↵Michael Mann1-1/+1
with FT_BYTES to now use FT_SYSTEM_ID type. svn path=/trunk/; revision=54383
2013-12-20Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54314
2013-12-02Move most of the plugin code from epan to wsutil and remove allGuy Harris1-1/+0
knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
2013-11-07Try 2 to fix Mac OS X 10.5 buildbotAlexis La Goutte1-0/+1
Include old-gtk-compat.h svn path=/trunk/; revision=53140
2013-08-06Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.Jakub Zawadzki1-4/+4
svn path=/trunk/; revision=51174
2013-07-21Fix error when compiled with --enable-packet-editorJakub Zawadzki1-0/+2
svn path=/trunk/; revision=50773
2013-07-21Some work on multi file dissectionJakub Zawadzki1-4/+7
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-12Move the print modules into epan.Jeff Morriss1-1/+1
svn path=/trunk/; revision=50526
2013-07-11packet dissection now takes pointer to tvb instead of guint8 dataJakub Zawadzki1-4/+6
implement frame_tvbuff, right now almost a copy of 'real' tvb. svn path=/trunk/; revision=50497
2013-06-25Fix build with packet editor enabled. (Fix a typo while we're at it.)Guy Harris1-31/+30
svn path=/trunk/; revision=50153
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-30/+31
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
2013-03-26Fix c++-compat errors if WANT_PACKET_EDITOR is defined.Evan Huus1-7/+7
svn path=/trunk/; revision=48560
2013-03-24Redissect extra packet windows in all cases (that I know of) where weEvan Huus1-24/+58
redissect normal packet list. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8482 svn path=/trunk/; revision=48528
2013-03-21From Michail Koreshkov via ↵Evan Huus1-6/+48
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8371 Add item to context menu of frame references to open the referenced frame in a new window. Very useful when the referenced frame is hidden by a filter. From me: - modelines - simplify some of the logic svn path=/trunk/; revision=48451
2013-03-21From beroset:Bill Meier1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10404 Note: The following parts of the patch had been previously done: asn1/snmp/packet-snmp-template.c epan/dissectors/packet-snmp.c epan/dissectors/packet-x11.c Also; hostlist_table.c: code under '#ifdef HAVE_GEOIP' didn't compile and needed a few additional patches. svn path=/trunk/; revision=48447
2013-01-22GTK+:Gerald Combs1-1/+1
Get rid of user-hostile behavior. In the layout preferences pane 2 & 3 radio buttons overrode the user's selection if a duplicate item was selected. Now we assume that the user knows what he or she is doing and steal duplicate selections from the other panes. Qt: Match the new GTK+ behavior in the layout preferences. Add padding around the layout images. Add toolbar style preferences to the Appearance pane (instead of the layout pane). All: Remove the selection mode and scrollbar placement prefs and mark them obsolete as recently discussed on -dev. Adjust the layout images yet again after more Awful Monitor Testing. svn path=/trunk/; revision=47214
2012-10-20Make data_source opqaue, add getter for tvb.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=45672
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-12/+12
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-07-20gtk_container_add() -> gtk_box_pack_start() [bug #7377]Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=43874
2012-07-20Fix bug #7377 for:Jakub Zawadzki1-1/+1
- UAT - Packet in new window - Supported protocols dialog. svn path=/trunk/; revision=43861
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-16Move some routines that specifically handle the main window's packetGuy Harris1-1/+1
panes to main_packet_panes.c. Rename main_tree_view_new() to proto_tree_view_new() - it's not just for creating the main window's protocol tree view, it's also for creating protocol tree views in packet windows. svn path=/trunk/; revision=43292
2012-06-16ui/gtk/main_proto_draw.c isn't just used for the main window, it's alsoGuy Harris1-1/+1
used for popped-up packet windows, and it includes more than just code to draw the protocol tree - it includes the hex dump pane code as well. Rename it packet_panes.c; the stuff specific to the main window should be moved into a different file. svn path=/trunk/; revision=43290
2012-06-10Clear GtkTreeStore before freeing edtJakub Zawadzki1-0/+4
When building current data for packet details treeview we store two things. - Generated string with item label - Pointer to node field_info structure After epan_dissect_{free, cleanup} pointer to field_info node is no longer valid so we should clear GtkTreeStore before freeing. svn path=/trunk/; revision=43188