Commit Graph

25612 Commits

Author SHA1 Message Date
Michael Mann 9edba650d1 Use g_ alloced memory (instead of emem) when printing fields. emem shouldn't be used for GUI functions.
emem was exposed because of its memory limits trying to output PDML for a very large byte field in a capture file.

bug:10081
Change-Id: I6346dfdfb5f6381e16761a99291c4be7851185d9
Reviewed-on: https://code.wireshark.org/review/1566
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-09 04:31:10 +00:00
Michael Mann 1abeb277f5 Refactor Wiretap
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-05-09 03:04:39 +00:00
Alexis La Goutte d0cf9412bd Fix a whitespace after IKE_AUTH
Change-Id: Id58da1f546ee5dff72cbc1bc012095ad0b9a9be5
Reviewed-on: https://code.wireshark.org/review/1562
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-08 15:44:11 +00:00
Pascal Quantin a8456cc104 MAC LTE: add a comment explaining why g_hash_table_lookup_extended is used
Change-Id: I9d7310359d5972c603396a802abc2a82b46fe57e
Reviewed-on: https://code.wireshark.org/review/1563
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-08 15:42:53 +00:00
Anish Bhatt e46d1447be Small fix to how number of traffic classes is displayed for ETS.
Used proto_tree_add_uint_format_valu instead of append_text

Change-Id: I6d3d6049655c0573b66249ce93ea850c15b1cb7b
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1522
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-08 15:02:23 +00:00
Martin Mathieson 8070155005 Remove trailing whitespace
Change-Id: Idf8f9aba4e020a278e7b779de13ecdbcfcc39776
Reviewed-on: https://code.wireshark.org/review/1560
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-08 13:50:39 +00:00
Martin Mathieson 75bbbc2720 Prettify a little, by showing ike2 flag values in flag root, and showing MID and flags in Info column
Change-Id: I70884c933b3d82dfb7168352c5bed925f7e89e11
Reviewed-on: https://code.wireshark.org/review/1554
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-08 13:39:50 +00:00
Pascal Quantin a7ac73916f MAC LTE: fix copy/paste error
Change-Id: I59fd7745d454357d3eeaf48ed8700581a8aa0018
Reviewed-on: https://code.wireshark.org/review/1556
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-08 13:04:07 +00:00
Peter Ross f05894690d packet-dis: correct 'Terminal Primary Mode' and 'Sync State' enumeration values
SISO-STD-002 Standard for Link 16 Simulations, June 2006:
http://www.sisostds.org/DigitalLibrary.aspx?Command=Core_Download&EntryId=30265

Change-Id: Ic06c5f63b2da605cc3e3b14d001c81f87b98cdb4
Reviewed-on: https://code.wireshark.org/review/1553
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-08 11:08:13 +00:00
Pascal Quantin 54be3eaaec TCAP: set a fence on info column after calling sub dissector
Bug: 10091
Change-Id: I7af57345e31209fb4dd02cdab7960c44c69dc0a5
Reviewed-on: https://code.wireshark.org/review/1555
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-08 10:50:59 +00:00
Pascal Quantin 4eaf1c82c5 MAC LTE: get extended BSR sizes configuration from RRC
Change-Id: I09afa7c17be5e0ed902a2c2f5ea9989df3380615
Reviewed-on: https://code.wireshark.org/review/1550
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-08 06:29:21 +00:00
Evan Huus 83528805ad Recognize kafka's ConsumerMetadata message type
actual dissection still TODO

Change-Id: I58e54ca117a9ccd5d6af34d18f9277afd009aa95
Reviewed-on: https://code.wireshark.org/review/1547
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-08 02:15:40 +00:00
Michael Mann 078daeb27f Populate heuristic extension list during initialization and not during each call to heuristic_uses_extension.
Change-Id: I7e484de65c49060793a91cc11cb211effa2006db
Reviewed-on: https://code.wireshark.org/review/1494
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-08 00:31:29 +00:00
Jaap Keuter 18ee622517 Add handling of TEXT and HTML types.
Change-Id: Ife125be2c5043cc6cc1b879714671d9973c8214b
Reviewed-on: https://code.wireshark.org/review/1549
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-07 23:53:37 +00:00
Evan Huus f3b631668b Use a strong hash function for ethernet addresses.
The capture for bug 10078 caused the buildbot to time out; callgrind revealed an
enourmous amount of time being spent looking up ethernet addresses. The previous
code cast each address (6 bytes) to a guint64 (8 bytes) then used the built-in
g_int64_hash. Unfortunately, g_int64_hash is an *awful* hash function - it
produces a 4-byte hash by simply discarding the upper 4 bytes of its input.

For the capture file in question this strategy (which effectively ignores the
upper two bytes of each ethernet address) produced an astounding number of
collisions, leading to the terrible running-time.

Use wmem_strong_hash directly on the 6-byte address instead, which saves us a
bunch of useless casting and bit-twiddling and produces a much better hash
distribution. This shaves 20% off the time to tshark-with-tree the capture file
in question *despite* a substantially more expensive hash function
(wmem_strong_hash is not exactly fast compared to g_int64_hash).

Bug:10078
Change-Id: I8e81cbc478e6394ec3a8efe39eec08f680a55609
Reviewed-on: https://code.wireshark.org/review/1543
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07 09:00:29 +00:00
AndersBroman b07195af9d Fix a typo.
Change-Id: I17171157350f985506ef8498c88814e319396bd6
Reviewed-on: https://code.wireshark.org/review/1545
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07 05:50:35 +00:00
AndersBroman 24ca06f512 Make it pass the new check in checkapi
"Error out if someone passes the address of a pointer to a *_string to
VALS() or RVALS()."

Change-Id: I1b5b9bbf512f8fdfaab5febea28db2c51d49c48c
Reviewed-on: https://code.wireshark.org/review/1544
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07 05:37:18 +00:00
Anish Bhatt 9b7830114f Further LLDP dissection cleanup
Change-Id: I75f4ed401f63e993a2aefa1c289fd48fa00b46e2
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1528
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07 04:32:15 +00:00
Alexis La Goutte 45b6780178 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I8727e74d0818f759f3c58c6f156b0b4e36eb7218
Reviewed-on: https://code.wireshark.org/review/1465
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-07 00:54:07 +00:00
Alexis La Goutte 8c167e17c4 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I3c54712108978d1bafe2b5da96e6a7d3d41948b5
Reviewed-on: https://code.wireshark.org/review/1535
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-07 00:52:01 +00:00
Jeff Morriss 6011d2e531 "Reserved" is not a valid 'fieldconvert' value for an hf.
Fixes (for real this time, I swear!) the fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10079

Bug: 10079
Change-Id: I2a73ef32d704fc9ecc71fd983fc09cf4f9194b2e
Reviewed-on: https://code.wireshark.org/review/1542
Reviewed-by: Sean Onufer Stalley <sean.stalley@intel.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-05-06 22:21:41 +00:00
Pascal Quantin 398c81a299 PDCP LTE: add identification of ZUC based security algorithms
Change-Id: I63a66bc5822ac04f1a2bccd3a15adac30b65e397
Reviewed-on: https://code.wireshark.org/review/1541
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 21:43:35 +00:00
Jeff Morriss 2e16091845 Don't pass the address of a pointer to a *_string to VALS() or RVALS().
This is a followup to Ifc8d6895cc33ad1f00386a3e59926322bd501125; the MQ sample
captures I have don't seg-fault on this but the code was stillw wrong.

Change-Id: Ic689c06836b823a15217281d67b33580fd8e9823
Reviewed-on: https://code.wireshark.org/review/1539
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 21:34:40 +00:00
Evan Huus ec5ba0795a Tweak ber_choice flow control.
There appear to be a couple of bugs in the flow control of this function (which
is very confusing), at least one of which is leading to a buffer overrun. See
the bug comments for more details and guesses of what the correct thing to do
is.

Bug:9579
Change-Id: Ibd3077792c7689a715ea53e8bf8c7a561c67389f
Reviewed-on: https://code.wireshark.org/review/1530
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 20:32:07 +00:00
Sean O. Stalley d3a1cdea2c fix dissect_usb_endpoint_descriptor
dissect_usb_endpoint_descriptor uses usb_trans_info, but the signature
contains a _U_ macro.

Change-Id: I87fe6d91d5f8cf15926bf2dfd6381a256cd0785d
Reviewed-on: https://code.wireshark.org/review/1537
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 19:57:54 +00:00
Jeff Morriss ef24d48552 VALS() doesn't take the address of a (pointer to a) value_string, it takes
a pointer to a value_string.

Fixes the fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10079

Bug: 10079
Change-Id: Ifc8d6895cc33ad1f00386a3e59926322bd501125
Reviewed-on: https://code.wireshark.org/review/1538
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 19:56:58 +00:00
Sean O. Stalley 9a51c1e530 Added check for MAUSB length being multiple of a DWORD.
MAUSB Packets should always be sent in DWORDs. This means that the
only valid values for the length field are multiples of 4.
This patch adds an expert info check to flag length fields that are
multiples of 4.

Change-Id: Ifb793f82aed4c9fb09a12f6ea97087733b58d14a
Reviewed-on: https://code.wireshark.org/review/1536
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 19:51:56 +00:00
Alexis La Goutte d73fc0b294 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ib4bbf1fa048cde14baf10bd31342b3c75e10b544
Reviewed-on: https://code.wireshark.org/review/1534
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 19:27:23 +00:00
Evan Huus c0fbe0d832 Update kafka dissector closer to latest spec
Some new error values, some message types that have been "undocumented" as
internal-only, etc.

Change-Id: Iff15dd67b188c9e2745964d4916b22e0bea4243d
Reviewed-on: https://code.wireshark.org/review/1533
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 19:25:36 +00:00
Evan Huus 3851e09a0b Fix macro parens to avoid unexpected behaviour
Based on Icfe1e5477043dd695fd9b02b677ef29ac3fa8866 but rebased and simplified.

Change-Id: I9b7266e2fdcb58f38115250d785637cd585c69e0
Reviewed-on: https://code.wireshark.org/review/1532
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 16:05:15 +00:00
Alexis La Goutte 910ab7bfda Enhance Microsoft NLB dissection
Rewrite from Microsoft Network Monitor dissector

Based from NPL dissector 
https://nmparsers.codeplex.com/SourceControl/latest#Develop_Branch/NPL/Windows/nlb.npl

No yet support type Reliable Protocol (no found pcap with this pcap)

Change-Id: Ic5aa68798a629f9e0ad15337b192a1fe180ae62c
Reviewed-on: https://code.wireshark.org/review/1464
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 16:00:57 +00:00
David Ameiss 037fb82c9a Minor changes to LBM dissectors:
(1) Display sequence numbers in both decimal and hex
(2) Fix an inconsistency in field naming between LBT-RU and LBT-RM.

bug:9718
Change-Id: I967062d6aa00ea9a3db51db94e56d37e68e642d3
Reviewed-on: https://code.wireshark.org/review/1531
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 15:59:33 +00:00
Peter Wu 4e82d2e34f sigcomp: Add buffer check to STATE-ACCESS
Two conditions were not checked, state_length == 0 && state_begin != 0
and the boundaries of the state buffer. The former is not a big deal,
but the second issue causes a buffer overrun (detected by ASAN).

The buffer size is supposed to be stored in the state buffer, that was
not the case for the initial two SIP SDP and Presence state buffers.
Fix a typo for presence_buf zero-ing while at it.

Bug: 9601
Change-Id: I41dde83185da60b670cca010ecc7b2a2aaaedeb9
Reviewed-on: https://code.wireshark.org/review/1529
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 14:03:12 +00:00
Anish Bhatt a915de5295 Fix build failures caused by lldp cleanup
Change-Id: I4d4aeb71720f02e4a6f4a8e5f803fd63dc7aed81
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1524
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 07:58:36 +00:00
AndersBroman da00889226 Add a cast to make MSVC happy.
Change-Id: Iee901ae56c796007821c1754056c61954e8a342f
Reviewed-on: https://code.wireshark.org/review/1526
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 07:57:21 +00:00
AndersBroman 72662c22c2 Try to fix
packet-mysql.c(1446) : warning C4244: 'function' : conversion from 'guint64' to 'gint', possible loss of data

Change-Id: Ie0b2e916e0d15287f5a3ededc404b678b45600d8
Reviewed-on: https://code.wireshark.org/review/1525
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 07:49:34 +00:00
Jess Balint a4a851cb80 MySQL protocol dissector: Add support for sessiontracking in MySQL 5.7.4. Bug 9948.
Change-Id: Ia451bfff571c4da280ccf76b1d5ac9dfcfead78c
Signed-off-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-on: https://code.wireshark.org/review/916
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:55:10 +00:00
Jakub Zawadzki ecc6b8d620 Move common part of col_append_fstr, col_append_sep_fstr to seperate fnction.
From the comments I think it was intended - but there were no G_VA_COPY macro in glib (?).

Change-Id: Ic1e1d4a5ac9e5b8f27f25487416c0ededeed2093
Reviewed-on: https://code.wireshark.org/review/1518
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:49:18 +00:00
Anish Bhatt 209f82a501 Cleanup LLDP dissection, convert add_text to tree items.
Just started on this, more changes incoming

Change-Id: Idc88442f382cea1f29f05edb991b920488cfc113
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1502
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:48:07 +00:00
Jakub Zawadzki be3a153707 tcp: move & optimize printing tcp flags to seperate routine.
The formatting routine is quite simple so it can be replaced with
g_stpcpy() and still keeping it clean.

Change-Id: Ifbab1dc1140ee271d39bbbfb7586cfda6ded5c54
Reviewed-on: https://code.wireshark.org/review/1517
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:41:48 +00:00
Evan Huus f764765108 Increase the work used to time wmem allocators
It appears that on some platforms the timer underlying g_test_timer() is
relatively low-precision, so the small amount of work that we were previously
doing was not enough for the timer to provide a useful value.

Bumping the amount of work should provide more meaningful values, and the whole
timing step still takes only a few seconds.

Change-Id: Idce1386eaa33add845d9a2758b0beb72bbf370d6
Reviewed-on: https://code.wireshark.org/review/1523
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 02:30:05 +00:00
Pascal Quantin 542b4e6742 MAC/RLC/PDCP LTE: replace obsolete APIs
Change-Id: I5368cc7b1986c6a87cb70a3fd3cb5e589d73f870
Reviewed-on: https://code.wireshark.org/review/1520
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-05 21:26:46 +00:00
Sean O. Stalley eecc1353a2 Added parentheses to macros to prevent unexpected behavior
Masks for padding now have an additional parenthesis to ensure
proper operator precedence.

Per the request of Evan Huus; See comment in Change-Id:
I3ad4e1beb891f9c2835adff320095e7e738241eb, Patch Set 10.

Change-Id: Ic8878f870b58cd272675b4d6c3658a029bb67984
Reviewed-on: https://code.wireshark.org/review/1519
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-05 20:46:36 +00:00
Alexis La Goutte e35ccbac90 Add RFC6463 (Runtime Local Mobility Anchor (LMA) Assignment Support
for Proxy Mobile IPv6) MIP6 Mobile Option

Change-Id: I650cb33fcf083bd8826a702cb975295518012292
Reviewed-on: https://code.wireshark.org/review/1511
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-05 17:12:34 +00:00
Alexis La Goutte 2aa66aa2b2 SSH Dissector : Remove ssh_proto_tree_add_item (No longer needed)
Change-Id: I6d227ad7a4ddfab9d2cf18a3148700a6bd6dd321
Reviewed-on: https://code.wireshark.org/review/1512
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-05 16:57:17 +00:00
AndersBroman 09a9c86473 Add the possibillity to add a string to the termination id.
Change-Id: I3b48b28273a8c1a1558045d2a4ab5104160840de
Reviewed-on: https://code.wireshark.org/review/1510
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-05 15:51:18 +00:00
Evan Huus 326202f016 Solaris doesn't like anonymous unions
so give it a name

Change-Id: Iaf9a6f8cb58a565673f53696f7e5d1698e6eae0f
Reviewed-on: https://code.wireshark.org/review/1509
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 15:26:15 +00:00
Alexis La Goutte 33586a09d4 OpenFlow 1.4 OXM field OXM_OF_IPV6_ND_SLL incorrectly dissected (128 bits read instead of 48)
Dissection of OXM_OF_IPV6_ND_SLL triggers "malformed packet" comment in packet list since it makes dissecting of further OXM fields impossible.

It is possible that similar issue will be with OXM_OF_IPV6_ND_TLL since its dissecting is basically the same.

Issue found by Viktor
Closed-bug:10011

Change-Id: I21b85cc0572ffdb8bb8b73cfae0db1d72219fe4b
Reviewed-on: https://code.wireshark.org/review/1505
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-05 15:26:13 +00:00
Alexis La Goutte ce282a7345 OpenFlow 1.3 OXM field OXM_OF_IPV6_ND_SLL incorrectly dissected (128 bits read instead of 48)
Dissection of OXM_OF_IPV6_ND_SLL triggers "malformed packet" comment in packet list since it makes dissecting of further OXM fields impossible.

It is possible that similar issue will be with OXM_OF_IPV6_ND_TLL since its dissecting is basically the same.

Issue found by Viktor
Closed-bug:10011

Change-Id: I13893710ad4028669e454c6f8485f719b62bcaab
Reviewed-on: https://code.wireshark.org/review/1504
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-05 15:25:49 +00:00
Evan Huus 0523c2d0d7 Fix build with older compilers
The struct literal syntax {0} does not appear to be universally supported - use
memset instead.

Change-Id: If70d475cf3d7a582c43dcc879cefebc9aef0a99e
Reviewed-on: https://code.wireshark.org/review/1508
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 14:50:09 +00:00