Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I9025b479b31e3cc6f8108a163bf00d81008fd737
Reviewed-on: https://code.wireshark.org/review/15632
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Coverity rightfully complains about inproper use of negative value.
maxlength special value '-1' should be handled appropriately.
Change-Id: Ie1818121e39fa668094d012980016444ca868e6e
Reviewed-on: https://code.wireshark.org/review/13978
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
|
|
Found building with GCC 5.3.0 and CFLAGS="-g -Og".
Change-Id: I5bc29b6e91cc98332a513c9d03b02d2f6906608d
Reviewed-on: https://code.wireshark.org/review/13362
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
|
|
Change-Id: I7f942787dfdc4f76dd0ad5111d1eb528b20f0ba9
Reviewed-on: https://code.wireshark.org/review/13011
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: João Valverde <j@v6e.pt>
|
|
That's what my_dgt_tbcd_unpack() did; do the same thing here.
Change-Id: Ia68c6ba652c748bd2661fd6eda736e880f414dc5
Reviewed-on: https://code.wireshark.org/review/12359
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
length set to datalen in the returned tvb.
Change-Id: Ie6649a285a9fa4a0564e29ce18ec9459b8da2541
Reviewed-on: https://code.wireshark.org/review/9861
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Routines that don't take a tvbuff as an argument shouldn't have tvb_ in
the name.
Change-Id: I3550256551e30b3f329cbbfca71ef27c727d29c0
Reviewed-on: https://code.wireshark.org/review/7302
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
There is no guarantee that a g_malloc'ed memory block will be aligned on a 128 bits boundary
Instead use a static variable definition (at the cost of exposing the HAVE_SSE4_2 compilation flag in ws_mempbrk.h)
Change-Id: I661bf479a9d458d64c96bafc940c519d29a4780b
Reviewed-on: https://code.wireshark.org/review/7070
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
|
|
This combines the SSE4.2 instructions usage, with pre-compiled
pattern searching usage, for a faster pbrk search method.
Testing against large files of HTTP and SIP, there is about
a 5% performance improvement by using pre-"compiled" patterns
for guint8_pbrk() instead of passing it the search string and
having it build the match array every time.
Similar to regular expressions, "compiling" the pattern match array
in advance only once and using the "compiled" patterns for
the searches is faster than compiling it every time.
Change-Id: Ifcbc14a6c93f32d15663a10d974bacdca5119a8e
Ping-Bug: 10798
Reviewed-on: https://code.wireshark.org/review/6990
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
|
|
Also change bytestring_to_str to match bytes_to_ep_str_punct functionality (limiting byte string size)
Change-Id: Idb958c7f0c203d103629469302b81fa922714f7e
Reviewed-on: https://code.wireshark.org/review/6369
Reviewed-by: Michael Mann <mmann78@netscape.net>
|
|
Changed all remaining code in wslua that was using emem, to use wmem or
simpler methods.
Bug: 9927
Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55
Reviewed-on: https://code.wireshark.org/review/6109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
|
|
e.g. tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN)
Change-Id: Iea02fd59b13678aca741d028fb1f66f334447498
Reviewed-on: https://code.wireshark.org/review/6191
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: Evan Huus <eapache@gmail.com>
|
|
Also add an assertion to tvb_generic_clone_offset_len so that it throws an
error *before* allocating memory, as otherwise that memory is leaked.
Bug: 10474
Change-Id: I5036cefac16841914a59670c64979cf599bf7969
Reviewed-on: https://code.wireshark.org/review/4234
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
|
|
If the length is 0, there's nothing to copy, so it doesn't matter if
there's no data to copy from. This fixes problems caused by allocating
a zero-length buffer and using that as the data for a tvbuff; the
allocation returns null, so the data pointer is null.
Change-Id: I8037ae4b96d30e90a716852bb7e22d3980444f83
Reviewed-on: https://code.wireshark.org/review/3761
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
This lets us blow up with oversized 64-bit length values, before casting
them to the 31-bit lengths we can actually handle in Wireshark, rather
than blindly casting them with weird results.
Use that in the MySQL dissector, and, if we get past the test, cast the
lengths to int to squelch warnings.
Change-Id: I3a5e9bd0027fa4ddcb9622f77952dba8f6b23c27
Reviewed-on: https://code.wireshark.org/review/3362
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
- compute_offset_and_remaining(...) is a little bit faster than
check_offset_length(.., .length_val = -1);
- tvb_find_guint8(), tvb_pbrk_guint8() - both function are limiting data to
MIN((unsigned) maxlength, tvb_len) - do the same with less count of ifs.
Change-Id: I7761d77b6282d800eea94852d5c6543aef4bc7ca
Reviewed-on: https://code.wireshark.org/review/2829
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.
If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.
Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.
Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.
Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
This reverts commit b136182ad41b0552421992f36f3b70fa497fd658
This function are already marked inline, and profiler don't show much difference in performance,
revert as previous version is cleaner.
Change-Id: I1ac2c30a91b46278730ceee127efa086c7fbc6d6
Reviewed-on: https://code.wireshark.org/review/2828
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Change-Id: I3ccb5c1b40504cd9314da5a09b225e3e2bf991b8
Reviewed-on: https://code.wireshark.org/review/2073
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
In text protocols, like SIP, lot of time is spend guint8_pbrk(),
assume that text is not binary (no NULs), and use SSE4.2 pcmpistri
instruction.
Also move & rename guint8_pbrk() from tvbuff.c as _ws_mempbrk.
HAVE_SSE42 must be defined to use _ws_mempbrk_sse42() only activaded for
Windows currently.
Change-Id: Ic853d84805bdb6492c4f45d2bcc79a973fd9804e
Reviewed-on: https://code.wireshark.org/review/1730
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This reverts commit fe195c0c978b4b92dc5a77daa6449a7f1314243d.
Conflicts:
epan/tvbuff.c
Change-Id: I1af618d0bd1e6211281b6d67c0ad197cfa513a0c
Reviewed-on: https://code.wireshark.org/review/1639
Reviewed-by: Evan Huus <eapache@gmail.com>
|
|
Change-Id: I7a7b5869947499c2e0edb4de4bb462d8e8c19fc7
Reviewed-on: https://code.wireshark.org/review/1346
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Use it in epan/tvbuff.c.
Do some other cleanups while we're at it.
Change-Id: I7aed37a568373b896aacfd23f986d445b58b77b7
Reviewed-on: https://code.wireshark.org/review/1342
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
Change-Id: I9adec36251e27e71c530e64a472ab7562bd07fed
Reviewed-on: https://code.wireshark.org/review/1340
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
This moves a bunch of character set knowledge into epan/charsets.c.
Change-Id: Ieb79dcaac9753c77703af756b666ad2ca9385d9e
Reviewed-on: https://code.wireshark.org/review/1339
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
charsets.c is already place with huge number of conversion tables.
Also make gsm_default_alphabet gunichar2, all values fits in 2 bytes.
Change-Id: Ia5ab6c176b4fec21ec76b06513c1d00794ba10ef
Reviewed-on: https://code.wireshark.org/review/1328
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Also do little cleanup in mktime_utc (one big #ifndef)
Change-Id: I8f721ba76cad856cfef0a2d78e7f98686f8e4e3f
Reviewed-on: https://code.wireshark.org/review/1327
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
When HAVE_TIMEGM is undefined mktime_utc() might output one day shift (+86400s)
for (years <= 1967 or years >= 2100) && month >= 3
{ .tm_mday = 1 .tm_mon = 2 .tm_year = 67 }
mktime_utc() = -89436590 // Thu Mar 2 00:00:00 UTC 1967
gmtime() = -89596800 // Wed Mar 1 00:00:00 UTC 1967
{ .tm_mday = 1 .tm_mon = 2 .tm_year = 200 }
mktime_utc() = 4107628800 // Tue Mar 2 00:00:00 UTC 2100
gmtime() = 4107542400 // Mon Mar 1 00:00:00 UTC 2100
Change-Id: I1a544762fa5178c8798496d7dc30a2e767919149
Reviewed-on: https://code.wireshark.org/review/1287
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
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>
|
|
Change-Id: Iff4a659cb0d0062cc149f451e49474c8db4143cd
Reviewed-on: https://code.wireshark.org/review/1292
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
Use proper p{le,n}toh16 macro depending on endianess.
Change-Id: I8323e4296ec88e2cb24f54a1d8dc89328edb1957
Reviewed-on: https://code.wireshark.org/review/1285
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Change-Id: I57fb3c0d1ba97674c01c4c4799bf36696659c82b
Reviewed-on: https://code.wireshark.org/review/1237
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
|
|
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for
getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form.
The proto_tree_add_bytes_item routine is also usable for normal
binary encoded byte arrays, and has the advantage of retrieving
the array values even if there's no proto tree.
It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.
Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20
Reviewed-on: https://code.wireshark.org/review/1158
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for
getting nstime fields from the tvb when they are encoded in ASCII string form.
The proto_tree_add_time_item routine is also usable for normal
big/little-endian encoded time_t, and has the advantage of retrieving
the value even if there's no proto tree.
It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.
Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c
Reviewed-on: https://code.wireshark.org/review/1084
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Change-Id: I01ec87ff4181afb5b2de487fd5f5200f8d62f17d
Reviewed-on: https://code.wireshark.org/review/1088
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
|
|
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>
|
|
Change-Id: Ib96f2cf4ea71cd0cc2c703d58b9d254bf4c1248a
Reviewed-on: https://code.wireshark.org/review/1077
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
Change-Id: Ie32a140e49140a92c69cb6fa84cdc55402516830
Reviewed-on: https://code.wireshark.org/review/935
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
tvb_captured_length() -> tvb->length
tvb_captured_length_remaining(tvb, offset) -> (Inline) _tvb_captured_length_remaining()
tvb_get_ptr() -> ensure_contiguous()
Change-Id: I3540854c9b51ca9c3319b030c7d91b4aff976a26
Reviewed-on: https://code.wireshark.org/review/922
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
insted get the ptr and read
directly avoiding the overhead of calling fast_ensure_contiguous()
repeatibly.
Change-Id: Ib5eee87ef9d49cb4e46b3b9c3d3db0134d3c4a32
Reviewed-on: https://code.wireshark.org/review/889
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
valgrind.
Change-Id: I7881f8c1407d422a3f1ad5bc17e975b45703db74
Reviewed-on: https://code.wireshark.org/review/909
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
Change-Id: I385345cfafc7e7b4d3e66713fb0fe570b39f438d
Reviewed-on: https://code.wireshark.org/review/865
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
We rarely know exactly how long a string will be, but we frequently have a good
lower bound (that's better than the default strbuf size of 16). Starting at that
size probably reduces the amount of allocation/copying needed.
Also make use of the new _finalize() method to save memory and avoid constness
problems.
Change-Id: I3f043bd12c1ccfce5990168fb6531ecd287bec5b
Reviewed-on: https://code.wireshark.org/review/856
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Evan Huus <eapache@gmail.com>
|
|
by the editor modelines.
Change-Id: I6d4ad3675ec9099913c8a32ad1f2758316158f68
Reviewed-on: https://code.wireshark.org/review/587
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
|
|
(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>
|
|
Do with tvb_get_stringz() what was done with tvb_get_string().
Redo the comments for the string get routines to try to give more detail
in a fashion that's a bit less hard to read.
Warn, in comments, of the problems with using
tvb_get_string()/tvb_get_stringz() (i.e., if your strings are non-ASCII,
all bytes with the 8th bit set are going be replaced by the Unicode
REPLACEMENT CHARACTER, and displayed as such).
Warn, in a comment, of the problems with tvb_get_const_stringz() (i.e.,
it gives you raw bytes, rather than guaranteed-to-be-valid UTF-8).
Update documentation and release notes appropriately.
Change-Id: Ibd3efb92a203861f507ce71bc8d04d19d9d38a93
Reviewed-on: https://code.wireshark.org/review/327
Reviewed-by: Guy Harris <guy@alum.mit.edu>
|
|
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>
|
|
- rename tvb_length and similar to tvb_captured_length and similar; leave
#defines in place for backwards-compat, but mark them clearly as deprecated in
code comments and in checkAPI
- remove tvb_get_string as C code and just leave a #define in place for
backwards-compat; mark it clearly as deprecated in code comment and checkAPI
- update READMEs and sample dissector for all of the above
- while in the neighbourhood, make checkAPI skip (and warn) for missing files
instead of bailing on the whole check, so subsequent files still get checked
Change-Id: I32fc437896ca86ca73e9b49d5f50400adf8ec5ad
Reviewed-on: https://code.wireshark.org/review/311
Reviewed-by: Evan Huus <eapache@gmail.com>
|
|
better.
We don't need eventlog_get_unicode_string_length() in the eventlog
dissector, either - tvb_unicode_strsize() does the job just as well.
svn path=/trunk/; revision=54874
|