Commit Graph

52914 Commits

Author SHA1 Message Date
Peter Wu 3aee917058 wiretap: remove unused code, drop number_of_interfaces
While investigating an ASAN issue (fixed in
commit dcdd076ab0), I got greatly confused
by three different types having the same "interface_data" field name:

 * pcapng_t *pn stores an array of interface_data_t objects.
 * wtap *wth stores an array of wtapng_if_descr_t objects.
 * pcapng_dump_t should store an array of interface_data_t objects.

pcapng_dump_t and friends are unused since
commit c7f1a431d2, so drop it.

To fix the confusion, rename the interface_data_t type to
interface_info_t type and use the local variable "iface_info"
everywhere. Rename interface_data of pcapng_t to "interfaces" and
add a comment what this exactly means (interfaces listed in the capture
file).

Drop the number_of_interfaces field for interfaces as the array
length is already available from GArray. Now interface_data is always
initialized for wth (which also gets copied to idb).

s/int/guint/g and replace cast at some places.

There are no regressions for the in-tree test suite.

Change-Id: I2d5985c9f1e43f8230dbb4a73bd1e243c4858170
Reviewed-on: https://code.wireshark.org/review/1656
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17 12:41:50 +00:00
Evan Huus 9fe221a42f Fix newly optimized strdup_vprintf.
As Jakub pointed out, our +1/-1 logic for null terminators wasn't quite right.
Also be sure to re-copy the va_list parameter if we need to re-use it, as
otherwise things break oddly.

Change-Id: Ibeaa95af602f565791e9378a6cfce434f13025eb
Reviewed-on: https://code.wireshark.org/review/1670
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-17 12:30:03 +00:00
Jakub Zawadzki 72a6a8cb5c Fixes after wmem_strdup_vprintf() optimization
- g_vsnprintf()[1] buffer size can includes space for terminating NUL,
  this simplifies code, and fix problems with string truncation

- g_vsnprintf() returns number of bytes without terminating NUL, so we
  need to do + 1

- second g_vsnprintf() call use already consumed 'ap2' va_arg, which
  makes wmem_strdup_vprintf() doesn't work/ crash for FORMATTED string length > 80

[1] https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-vsnprintf

Change-Id: I0ebb7f452e3e89c9b55f8ac889166f02e8a7c982
Reviewed-on: https://code.wireshark.org/review/1667
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17 12:20:50 +00:00
Evan Huus 25ba4a2a44 Guard closing capture window with ifdef.
That variable is only defined if we HAVE_LIBPCAP. Should fix OSX10.5 buildbot.

Change-Id: I0bafc48955ef4af3c0b8d9d7a35b1e8b27577d31
Reviewed-on: https://code.wireshark.org/review/1669
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-17 12:07:45 +00:00
Evan Huus 8129c2d13d Add casts to fix OSX 10.6 buildbot
Change-Id: Ice852356201ba222290d2705d9f5526ce242b031
Reviewed-on: https://code.wireshark.org/review/1668
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-17 12:04:29 +00:00
Chun-Yeow Yeoh 89a72f328a Add SAE authentication algorithm in 802.11
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

Change-Id: If3500dda55aed45bbecd0261191ce1ec6cfbdbca
Reviewed-on: https://code.wireshark.org/review/1661
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Yeoh Chun-Yeow <yeohchunyeow@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17 07:21:44 +00:00
AndersBroman a42df4818f Use a pre allocated buffer in wmem_strdup_vprintf() reduces the function
cost by more than half.

Change-Id: I6ad2ae407325d2091ffb60919cb3ed74f78f39fa
Reviewed-on: https://code.wireshark.org/review/1662
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17 07:21:07 +00:00
Martin Mathieson ba3c0d7c4d Show EMM and ESM causes in the Info column
Change-Id: I2e3be18e997d6be0b250fbd8e664779d0d2a8228
Reviewed-on: https://code.wireshark.org/review/1666
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-16 22:17:45 +00:00
Gerald Combs 0a249087c3 Build with GTK+ 2.24.23.
Change-Id: Ic5c385c0fcef4d40a8cb9e7a271d14eb80905460
Reviewed-on: https://code.wireshark.org/review/1665
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
2014-05-16 16:25:38 +00:00
Alexis La Goutte 33750ab4b4 IP Protocol : Update description of IP Protocol
From Boaz

In IANA the two IPv4 protocols are defined:

35	IDPR	Inter-Domain Policy Routing Protocol
45	IDRP	Inter-Domain Routing Protocol
http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

However, in Wireshark, they are named:

{ IP_PROTO_IDPR,    "Interdomain routing" },    /* 35 IDPR Inter-Domain Policy Routing Protocol [Martha_Steenstrup] */
{ IP_PROTO_IDRP,    "IDRP" },                   /* 45 IDRP Inter-Domain Routing Protocol [Sue_Hares] */

Which is somewhat confusing.

I think IDPR should be named "Inter-Domain Policy Routing".
And IDRP should be named "Inter-Domain Routing Protocol".

Change-Id: I69b34ea8d9b3169fd779357710edb44cfb5cb2b3
Reviewed-on: https://code.wireshark.org/review/1664
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 14:18:02 +00:00
Alexis La Goutte c3513b4f35 Add modelines info
Change-Id: Ia37dd9c79e70b839063e131c532ae2b724293600
Reviewed-on: https://code.wireshark.org/review/1663
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 14:16:59 +00:00
Alexis La Goutte c24ede3450 DNS: fix soft-deprecated APIs
tvb_length -> tvb_reported_length
tvb_get_string -> tvb_get_string_enc

Change-Id: Ia511f0e9d3f8ae3d7a1a965431016336ec47188d
Reviewed-on: https://code.wireshark.org/review/1660
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 06:58:53 +00:00
Alexis La Goutte 6989febd47 DNS: Use acronyms from RFC7218 for DANE / TLSA
http://tools.ietf.org/html/rfc7218

Change-Id: Icd276c6cb4680aa53b081c239cb8eb2d8fc109c6
Reviewed-on: https://code.wireshark.org/review/1659
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 06:57:09 +00:00
Michael Mann 59eb8cf404 Make (almost) all fields filterable and use "normal" dissection functions to do it.
Removed the additional "parseFields" layer as it was unnecessary and IMO ends up creating more work for a developer if they want to add additional filterable fields.  That layer also hid the (large) number of unfilterable fields that were in the dissector that would normally be caught by counting the number of proto_tree_add_text function calls.

Change-Id: I6f9607938c2386de40bdd3dae652614f07dda31e
Reviewed-on: https://code.wireshark.org/review/1653
Reviewed-by: Peter Ross <peter.ross@rmit.edu.au>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-16 05:34:05 +00:00
Evan Huus aa922b0624 Try to fix stack-buffer-overflow caught by ASAN
Use wmem_array_append rather than wmem_array_append_one to make sure the pointer
types match up. _append_one automatically takes the address of its argument,
which causes problems if that argument is already a pointer.

Thanks to Alexis for catching this.

Change-Id: Ie702bb2c776f9fcf31bd64073c756edd75d888e8
Reviewed-on: https://code.wireshark.org/review/1657
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-16 02:38:49 +00:00
Alexis La Goutte 7ba7612da9 STUN dissector: fix (soft) warning about tvb_length
Change-Id: I2b6c4e44d406585204b805ae3efa53c31e7d2574
Reviewed-on: https://code.wireshark.org/review/1655
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15 20:19:37 +00:00
Alexis La Goutte 37fd797a01 STUN dissector: fix hf name (stun_... => hf_stun_....)
Change-Id: I0a4a12cc18a03824827a3bb57b7e58a8f1bd6ba8
Reviewed-on: https://code.wireshark.org/review/1654
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15 20:18:38 +00:00
Masayuki Takemura 773c02da8f diameter_3gpp: Dissect Feature-List flags in Gx message
With this patch, wireshark dissects the Feature-List flags field in Gx message
and displays the name and value of each of Feature bit.

Change-Id: I18af8a133ae7db4da5a126a81521c474d1553719
Reference: 3GPP TS 29.212 V11.7.0, Section 5.4.1.
Reviewed-on: https://code.wireshark.org/review/1652
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15 14:32:45 +00:00
ruengeler 53eeff6c91 Do not leave the Options Interfaces Dialog open, when the Main Window is closed.
Change-Id: Ifd4fb88ceff24561131fad1d72531889e323f5ac
Reviewed-on: https://code.wireshark.org/review/1651
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15 11:58:57 +00:00
Guy Harris 45da41d6fe Fix declaration to match definition.
Change-Id: I9fcfddb34b2a22c3e2cf8f8fc9671eed2e8aef43
Reviewed-on: https://code.wireshark.org/review/1649
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 04:17:01 +00:00
Guy Harris 84fcadcb05 Get rid of some uses of tvb_get_ptr().
Change-Id: I85232f984f273c9a6ceccd12df5b77a4d131596c
Reviewed-on: https://code.wireshark.org/review/1648
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 03:23:38 +00:00
Guy Harris 09bf1702a6 Get rid of some uses of tvb_get_ptr().
Introduce a new tvb_ipxnet_to_string() routine to help that.

Change-Id: Icb27f7cdd6e6e7de67e765715e450063d7de6072
Reviewed-on: https://code.wireshark.org/review/1647
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 03:16:15 +00:00
Guy Harris 1bfe396ca4 Get rid of some uses of tvb_get_ptr().
Change-Id: Ib49575e5d92419e0860bf92810a7ac69f30e9699
Reviewed-on: https://code.wireshark.org/review/1646
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 03:02:02 +00:00
Guy Harris b8f0e8cf03 Eliminate some calls to tvb_get_ptr().
Change-Id: I1c5e10467d68ed7372dfaa9109b350238418ffc1
Reviewed-on: https://code.wireshark.org/review/1645
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 02:31:14 +00:00
Evan Huus d7f1ac33f6 wmem documentation updates
Change-Id: Ief20460ed8ec1b4bd1286cc2a5490d9aeefdf98f
Reviewed-on: https://code.wireshark.org/review/1643
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-14 20:05:14 +00:00
AndersBroman 9c07e97272 Add an expert info for GT with no digits.
Change-Id: I3595af1cae77fb07be942289b4a53c9edbd768fb
Reviewed-on: https://code.wireshark.org/review/1561
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-14 20:04:48 +00:00
Balint Reczey 99e92aca85 Drop unused voip_bg.xpm
Change-Id: I1130d9dbfb0aaf9b1de460cd26e136514b9b80b2
Reviewed-on: https://code.wireshark.org/review/1642
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-14 19:18:29 +00:00
Pascal Quantin bc15fad105 AMQP: always display its name in protocol column, whatever the protocol version
Bug: 10101
Change-Id: I41105b250384bd44c37c0707ad41c9d76700bc75
Reviewed-on: https://code.wireshark.org/review/1641
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-14 18:53:03 +00:00
Evan Huus a1b939313f Revert "Don't throw for offset at end of TVB with len -1."
This reverts commit fe195c0c97.

Conflicts:
	epan/tvbuff.c

Change-Id: I1af618d0bd1e6211281b6d67c0ad197cfa513a0c
Reviewed-on: https://code.wireshark.org/review/1639
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-14 17:12:12 +00:00
Peter Wu d7c4bde279 tcp: display calculated checksum
While debugging a network issue, I found incorrect TCP checksums. These
are shown in the packet details, but are not available as column. This
patch adds the "tcp.checksum_calculated" field which is only available
if a checksum can be calculated (i.e., checksumming is enabled and the
full segment is available).

The fields are added separately for each checksum case to make it appear
before "Checksum Bad/Good" and to avoid calculating the expected field
value for the "good" cases.

Change-Id: I36af7894d526382ef636c5fa51e74871212b2909
Reviewed-on: https://code.wireshark.org/review/1627
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-14 16:59:04 +00:00
Bill Meier aa5d91284b Add a comment indicating that 'PLATFORM' is apparently set only for X64.
Change-Id: I5248c421e53a4347789c076433af004697a1b682
Reviewed-on: https://code.wireshark.org/review/1637
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 15:45:49 +00:00
AndersBroman fbf3391246 - curr_layer_num got wrong for STUN.
- Change depreciated API.

Change-Id: I6f83f45d2d007d42efc9d81cbaa58c50e67373f1
Reviewed-on: https://code.wireshark.org/review/1636
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 15:44:35 +00:00
Evan Huus beb119f911 Don't use -1 as length in frame dissector.
Additional belated followup to gfe195c0c9 per conversation on -dev about the use
of -1 and when we should throw exceptions. See also g867a1827e7.

Should (in theory) permit reverting gfe195c0c9.

Bug:9999
Bug:10030
Change-Id: I56e5f4e5dc12fe82268243d0b113cfc9ff5fdd17
Reviewed-on: https://code.wireshark.org/review/1603
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 15:42:27 +00:00
Mark Weel b2055d73a8 Update enums to SISO_REF_010-00v20-0 Annex A, section A.1 and A.2
Change-Id: Ic4099145d84541297d72b018b21f88b4a120b138
Reviewed-on: https://code.wireshark.org/review/1634
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 15:41:32 +00:00
AndersBroman 836530e985 - Replace tvb_length_remaining -> tvb_captured_length_remaining,
- Use length_remaining in tvb_find_line_end() rather than -1 it should
  give a faster code path.

Change-Id: Ia6c289f1701add48429b25152db8a8e5cea9e053
Reviewed-on: https://code.wireshark.org/review/1632
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 10:50:22 +00:00
ruengeler 2828bf7777 The filter string can only be valid, if an interface is selected.
Change-Id: I578f6b46d5e2631c6315eb0a8b6141ba93ee21bb
Reviewed-on: https://code.wireshark.org/review/1631
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14 10:46:15 +00:00
Guy Harris dcdd076ab0 pcapng->interface_data is an array of interface_data_t.
Change-Id: Ida44a8820948d509e74ab8475979e8695abb4288
Reviewed-on: https://code.wireshark.org/review/1630
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-14 02:26:47 +00:00
Alexis La Goutte 2c00d66fb7 Use pre-scan command line parameters with double while(opt=getopt...)
Don't need launch "Qt" for some console only parameters (-h -v ...)

Based on GTK+ code

Change-Id: I1a810e394088959aefbbb39fb88836591a8b2367
Reviewed-on: https://code.wireshark.org/review/1311
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:41:30 +00:00
Alexis La Goutte 218b8c9ad9 HTTP2 enhance display when priority flag is set
* Add bitmask and fix length for exclusive flag
* Add missing bitmask for stream dependency
* Add fielder with calcultated weight value (weight+1, see spec for more information)

Change-Id: I7a6e97be068a80caa7355f593d9497c431c681ed
Reviewed-on: https://code.wireshark.org/review/1625
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:38:38 +00:00
AndersBroman 3157bf6ba5 isprint() -> g_ascii_isprint()
Change-Id: Ia586ef8ce500d5fc7578c52014206fa7a7eaea41
Reviewed-on: https://code.wireshark.org/review/1624
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:14:07 +00:00
AndersBroman f7819de76a In ascii_xx_inplace use g_ascii_isupper/g_ascii_islower directly, it
*should* be slightly more efficient.

Change-Id: I3081e2e25f241cdb07fa46011f50709fd560fb1c
Reviewed-on: https://code.wireshark.org/review/1626
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:07:08 +00:00
AndersBroman cd8188ddb8 Reduce the number of calls to tvb_reported_lenght_remaining().
Change-Id: I717572d403b38a33ccd5e390ace3742f3d296250
Reviewed-on: https://code.wireshark.org/review/1622
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 11:49:31 +00:00
Alexis La Goutte f9647404e3 Enhance HTTP2 dissector
* Add missing padding for CONTINUATION frame
* Add filter for generated padding length
* add unused flags

Change-Id: I98ff759595d3018f11b6d3ec9ea298e92e032d73
Reviewed-on: https://code.wireshark.org/review/1604
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-13 09:10:33 +00:00
Alexis La Goutte c32fb055ca Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ieac2f4a288f6ed084f2ea83ad409e217168065b2
Reviewed-on: https://code.wireshark.org/review/1621
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 08:45:51 +00:00
Anish Bhatt fb1e251723 LLDP cleanup : Management Address TLV
Change-Id: I324fdd0482a9740f24e74688bd17d768fc37f60c
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1620
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 06:27:14 +00:00
Pascal Quantin 67bc39417c IPsec: fix implicit conversion of pointer warning
Change-Id: Id1b62e2a7ea525cf2d421e41d9f344d24b56506d
Reviewed-on: https://code.wireshark.org/review/1619
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-13 05:12:25 +00:00
Evan Huus 44191fc05b Dumber "simple" wmem allocator.
Instead of maintaining a hash table, just alloc a really big array of pointers.
This is theoretically bad since it means frees and reallocs become O(n), but in
practice it makes the capture from bug 10098 run about 20% faster under
valgrind. This makes sense, since the workload is heavily dominated by
allocations, and most frees/reallocs are recently allocated (so they will be
found quickly at the beginning of the scan).

Bug:10098
Change-Id: I7097ad0653d3fb5f4f723cc84046cbc4450e3494
Reviewed-on: https://code.wireshark.org/review/1602
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 04:21:21 +00:00
Martin Mathieson f1c240685d Allow 16 SAs to be added, but allocate on heap to avoid growing stack
Change-Id: I68a4437c35c6e1e629cace06cfea07ae1ec45066
Reviewed-on: https://code.wireshark.org/review/1616
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 04:17:14 +00:00
Gerald Combs 2981ae46ad Add default paths for the Qt online installer for Windows.
Change-Id: I55d1ad6e4cc14aa5f02597d2afc8512018181543
Reviewed-on: https://code.wireshark.org/review/1618
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-05-12 22:17:53 +00:00
AndersBroman 89e61b9b37 Save the result of tvb_reported_length_remaining() and use it to reduce the number of calls to tvb_reported_length_remaining().
Change-Id: I6c110d7d995e4c771bbeea9013d867c46ca96778
Reviewed-on: https://code.wireshark.org/review/1613
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-12 21:49:00 +00:00