Bugfix generating a sequence of "native" types.  Bug 9532.

Previously a sequence of "native" types (int, float, etc) generated a proto_tree_add_uint (for the loop over the sequence) and a proto_tree_add_XXX (for the "native" type), but only 1 hf variable was created for the "loop" field, so DISSECTOR_ASSERT_NOT_REACHED would be generated if "native" type != uint.  Now a separate hf_ variable is generated for the "loop" and "native" type.

Also update existing IDL dissectors with new generator logic.

Change-Id: Ie4d1edfd67a8e6f02834573f29f07baf79058534
Reviewed-on: https://code.wireshark.org/review/1274
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Fix LISP dissectior regressions introduced in 1.11

This patch fixes dissection of some fields and restores some of the
output before the dissector was updated not to use proto_tree_add_text()
calls.

While at it improve the consistency in the code.

Change-Id: Ic30e60de1382f4325bd75e814444205f2fc5a359
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/1283
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Kerberos: put PDU dissection under Kerberos tree and remove duplicate PDU name

Change-Id: Id4824ad3a7bca1959579e5fd0a17a67c6bcda174
Reviewed-on: https://code.wireshark.org/review/1293
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
CaptureDialog: Fix IF type for user created pipe

 - If a user adds a pipe via "Capture Options"->"Manage Interfaces"
   ->"Pipes" the device.if_type.type is either not filled out (in
   the case if no other interfaces exist), or will be set to the
   last set if_type of the device queried by the iteration in line
   3537.

 - One could argue, that this is just a fixup, as still the issue
   remains, that the device structure will not be resetted, after
   the search for an already existing pipe element. Maybe a separate
   variable should be used for searching as it is used for adding
   the pipe

Change-Id: Ia727bf3ce270a62d065e8c524a13768af389c346
Reviewed-on: https://code.wireshark.org/review/1296
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Hash map implementation for wmem.

This has two expected uses:
- Many current users of wmem_tree don't actually need the predecessor lookup
  it provides (the lookup_le function family). A hash map provides straight
  insertion and lookup much more efficiently than a wmem_tree when predecessor
  lookup isn't needed.

- Many current users of glib's hash table and hash functions use untrusted data
  for keys, making them vulnerable to algorithmic complexity attacks. Care has
  been taken to make this implementation secure against such attacks, so it
  should be used whenever data is untrusted.

In my benchmarks it is measurably slower than GHashTable, but not excessively
so. Given the additional security it provides this seems like a reasonable
trade-off (and it is still faster than a wmem_tree).

Change-Id: I2d67a0d06029f14c153eaa42d5cfc774aefd9918
Reviewed-on: https://code.wireshark.org/review/1272
Reviewed-by: Evan Huus <eapache@gmail.com>
Add a cast to satisfy mac buildbot.

Change-Id: I625b025d3f8a57812512497c6104977ae5d10232
Reviewed-on: https://code.wireshark.org/review/1298
Reviewed-by: Evan Huus <eapache@gmail.com>
Revert "Create the HTTP tree after we're assured it's HTTP.  Otherwise a bogus tree is created when HTTP2 traffic is found."

It causes the DTLS decryption test suite to fail for some reason, and I don't have time/energy to investigate further, so we should probably revert it until that gets resolved.

This reverts commit fc5d8db74dc473610b9fc6c0c4b571d4aa65264a.

Change-Id: Iac9a7592047d2e080e380a70752efa076303e442
Reviewed-on: https://code.wireshark.org/review/1297
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Kerberos: use auto generated code for ADDR-TYPE instead of a hand made value_string array

Change-Id: I74089fe609368fdd582aef1f2cb00a3905e0641b
Reviewed-on: https://code.wireshark.org/review/1301
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Conversation/memory scope fixes for LBM dissectors. See bug 9718.

Change-Id: I58aa249d73ab44f5f56b1559b38b216cdb542ecb
Reviewed-on: https://code.wireshark.org/review/1280
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Continuation of bug 9532.

Ie4d1edfd67a8e6f02834573f29f07baf79058534 created a several duplicate hf_ registrations.  That led to the exposure of some other potential problems with generating sequences.

Still not quite complete, but want to pacify the buildbots, so there is a small amount of manual editing to comment out a few duplicated hfs in packet-parlay.c.

Change-Id: I0ff8a9795e213ab966db8d6333b9477bad06250b
Reviewed-on: https://code.wireshark.org/review/1302
Reviewed-by: Michael Mann <mmann78@netscape.net>
Don't throw for offset at end of TVB with len -1.

g867a1827e7dc88896ee27a107eb35c4b3973d270 introduced a change to cleanup/fix
handling of bounds checks for -1 length fields, but it ended up guaranteeing a
throw for 0-length tvbs, which isn't good; we ought to be able to add 0-length
FT_PROTOCOL items at the very least.

Better names for the function than _cheat are welcome, but I want to shut up the
buildbot.

Change-Id: I24610f947d03dac32766e2a0ffa0ff7bcc74c3e8
Reviewed-on: https://code.wireshark.org/review/1303
Reviewed-by: Evan Huus <eapache@gmail.com>
packet-mqtt.c: Minor cleanup

- Create/use an extended value string;
- Use ...add_text() instead of ..._add_string() for a packet details "header" line
   (Removes a filter named "mqtt" (not the 'protocol' filter));
- Fix what is (IMO) a slightly misleading display of "Connect Flags";
- Remove two lines of duplicate code;
- Localize some variables;
- Remove some unneeded initializers;
- Set tab-stops, etc in editor mode-lines to 8;
- 'offset++' ==> 'offset += 1';
- Do some minor whitespace changes.

Change-Id: Ia891c6893643790dbb26510f060c4fb6dfe1fe3a
Reviewed-on: https://code.wireshark.org/review/1304
Reviewed-by: Bill Meier <wmeier@newsguy.com>
MBIM: fix dissection of GSM SMS messages

Change-Id: I07e753e50a42513daa704e56ee5c9b399a91fec9
Reviewed-on: https://code.wireshark.org/review/1305
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Move kerberos to dirty dissector list

It currently generates some unused functions.

Change-Id: I59e2ffefbf66975d35f2a89c2c49c3ab61f41a84
Reviewed-on: https://code.wireshark.org/review/1306
Reviewed-by: Evan Huus <eapache@gmail.com>
Fix format warning.

Change-Id: I6627af8d90299d599db779bde0061191fc514fb3
Reviewed-on: https://code.wireshark.org/review/1307
Reviewed-by: Evan Huus <eapache@gmail.com>
Move kerberos to dirty list in CMake

As pointed out by David Ameiss, I only did automake the first time round.

Change-Id: Ie72ab5014d8f21d194d15af430c6c0a8a612f5f7
Reviewed-on: https://code.wireshark.org/review/1309
Reviewed-by: Evan Huus <eapache@gmail.com>
Add check for no kerberos keytab file.

Avoid printf warnings when loading a capture with kerberos packets
when not having configured a keytab file.

Change-Id: I0950daa18c42f4687d29101fac74f6f6bd6071b1
Reviewed-on: https://code.wireshark.org/review/1300
Reviewed-by: Evan Huus <eapache@gmail.com>
Fix typo in comment (parameterts => parameter)

Change-Id: Ie1fefc27d249929f0f5108b0757768e7e23a9dbe
Reviewed-on: https://code.wireshark.org/review/1310
Reviewed-by: Evan Huus <eapache@gmail.com>
Kerberos: use dissect_kerberos_ADDR_TYPE (removes an unused function warning)

Change-Id: I87d9c88d9db06c8f7dedd6e39152c39c13f8d32d
Reviewed-on: https://code.wireshark.org/review/1314
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Revert "Move kerberos to dirty dissector list"

it no longer has any warnings

This reverts commit 3ff57c86adb373eedaf0295ce20d4f1c4445921a.

Change-Id: I655f4cf682eb6784340799c54d2f9a6cc5321812
Reviewed-on: https://code.wireshark.org/review/1315
Reviewed-by: Evan Huus <eapache@gmail.com>