aboutsummaryrefslogtreecommitdiffstats
path: root/epan/sigcomp_state_hdlr.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-20Move all SigComp functionality to the SigComp dissector.Michael Mann1-884/+0
While it does make packet-sigcomp.c much bigger, there's no reason for it to be in epan directory. Change-Id: I2d78c32de1d56e76578e610d4df586b5610d1b49 Reviewed-on: https://code.wireshark.org/review/6682 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> 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>
2015-01-08bytes_to_ep_str -> bytes_to_strMichael Mann1-5/+9
Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750 Reviewed-on: https://code.wireshark.org/review/6389 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01Optimize epan_new/init_dissectionEvan Huus1-15/+14
As Anders correctly pointed out in I7d8f84b2e, constantly resetting state will turn init_dissection into a bit of a hot path. Especially as we will already bear the overhead of switching files, we don't want to fall any further behind than we have to. This change includes three unrelated optimizations that reduce the cost of init_dissection by about 40% as measured by callgrind: - only initialize ares/ADNS if that preference is enabled (this of course only applies if you specify -n to tshark or otherwise disable the preference) - use memcpy instead of a loop in sigcomp UDVM init - use memcpy instead of a loop in bootp dissector The only remaining obvious hot spot in this path is reassembly_table_init since it is called by so many dissectors. Suggestions (perhaps to get rid of the GPtrArray) welcome. Oh, and one other change to use g_strerror instead of strerror as insisted upon by the API pre-commit hook. Change-Id: I18a74f2b64b25498116079bd4e7fc2b335c7703a Reviewed-on: https://code.wireshark.org/review/2738 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06sigcomp: Add buffer check to STATE-ACCESSPeter Wu1-8/+27
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-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>
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-5/+5
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-11-10Move prototype of bytes_to_str, bytes_to_str_punct to correct header.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=53214
2013-03-20 From beroset:Bill Meier1-4/+4
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
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-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2011-06-07Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warningsBill Meier1-303/+306
svn path=/trunk/; revision=37600
2011-01-21Adress => Address corrections (also in comments).Sake Blok1-1/+1
(see bug 5600) svn path=/trunk/; revision=35600
2010-06-25Make sure our addresses are modulo 2^16 in a lot of places. Fixes aGerald Combs1-0/+2
crash found while fuzzing, and hopefully fixes bug 4867. In sigcomp_init_udvm() initialize the first 8 bytes of our buffers, which squelches a valgrind complaint. svn path=/trunk/; revision=33321
2010-06-03Use g_hash_table_new_full().Anders Broman1-14/+4
svn path=/trunk/; revision=33072
2008-10-25From S. Ravi:Jaap Keuter1-2/+249
The svn version of wireshark does not decode a sigcomp message, if presence static dictionary (RFC 5112) is used. I have attached a patch for adding this support. svn path=/trunk/; revision=26550
2007-03-28Remove almost all of the casts I committed recently and in place ofStephen Fisher1-2/+2
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it. svn path=/trunk/; revision=21253
2007-03-26Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errorsStephen Fisher1-2/+2
under gcc to tools/lemon, plugins/mate and epan/ svn path=/trunk/; revision=21204
2007-03-22fix some more warningsUlf Lamping1-1/+1
svn path=/trunk/; revision=21104
2006-12-05From Cristian Constantin:Anders Broman1-1/+1
As a workarond for the problem that accsessing a state with a state id > the stored minimum access length fail, only store and compare the state with the minimum access lengt specified in the standard of 6 bytes. svn path=/trunk/; revision=20041
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2005-09-29make n a guint32 to not wrap around at 65536Anders Broman1-1/+1
svn path=/trunk/; revision=16055
2005-09-28It's the UDVM_MEMORY_SIZE that should be checked.Anders Broman1-2/+2
svn path=/trunk/; revision=16040
2005-09-09fix MSVC warning: sigcomp_state_hdlr.c(601) : warning C4101: ↵Ulf Lamping1-1/+1
'partial_state_str' : unreferenced local variable svn path=/trunk/; revision=15735
2005-09-07Add bounds checking in several places to the SigComp UDVM. Use memset()Gerald Combs1-14/+16
instead of while loops to initialize variables. Use a define instead of magic numbers. Don't use guint8s for counters. Add a corresponding entry to the release notes. svn path=/trunk/; revision=15715
2005-08-08various code cleanup:Ulf Lamping1-4/+0
-use g_snprintf instead of sprintf and snprintf -use g_strdup_printf where appropriate -remove #include "snprintf.h" (as only g_snprintf should be used) -replace some more alloc/realloc/calloc/free with their glib pendants svn path=/trunk/; revision=15264
2005-08-02Some warning fixes for "no previous declaration"Jörg Mayer1-1/+1
Remove svn:executable Add svn:eol-style native Add svn:keywords Id svn path=/trunk/; revision=15179
2005-06-16From Paul Ollis:Anders Broman1-668/+626
epan/sigcomp_state_hdlr.c epan/sigcomp_state_hdlr.h --------------------------------------------------- Function udvm_state_access: 1. Removed the state_vars_valid parameter. It is no longer used. 2. The function now correctly updates each of state_length, state_address and state_instruction with saved state value. [Previously this was only done for state referenced in the SigComp message header.] 3. Removed code that (incorrectly) read byte_copy_left from UDVM memory within the loop that writes the state to UDVM memory. 4. Removed the code that set the useful values in UDVM memory. This should only be done for state referenced in the SigComp message header. (The decompress_sigcomp_message function, sets the useful values.) epan/sigcomp-udvm.c epan/sigcomp-udvm.h --------------------------------------- Function decompress_sigcomp_message: 1. Added three new parameters; header_len, byte_code_state_len, byte_code_id_len. The byte_code_state_len and byte_code_id_len are used to set the useful values in UDVM memory. The header_len is required to calculate the cycles available for decompression. 2. Various minor corrections to spellings, etc in generated messages. 3. Reduced the number of lines of output for print_level_1. Now the execution trace shows the instruction name and parameter values on one line. [This was done because, we found that even at the lowest level of detail ethereal became unusably slow; running on a 500 MHz SPARC. This seems to be related to the number of lines produced by the SigComp trace, which can easily be over 1000 with the modified code.] 4. Removed the used of some floating point functions. In all cases they were unnecessary and could potentially cause the code to produce the wrong results on some platforms (although this is unlikely). 5. The useful values are now set correctly, using the new byte_code_state_len and byte_code_id_len parameters. 6. The message header length is now included in the calculation of maximum_UDVM_cycles. Previously, the calculation could underestimate the value, resulting in the (small) chance that some legitimate messages might fail to decompress. Note: The calculation might now slightly over-estimate the cycles but this is a reasonable thing to do. 7. Implemented the PUSH, POP, CALL and RETURN instructions. Note: The two SORT instructions and the CRC and SHA-1 instructions are still not implemented. 8. The COPY and COPY-LITERAL instructions now apply the byte-copying-rules to the source address as well as the destination address. 9. The COPY-LITERAL and COPY-OFFSET now correctly handle the destination operand. Previously, it was possible for the destination to be left at byte_copy_right when it should be left at byte_copy_left. 10. All three COPY instructions will now behave correctly if the source or destination start at byte_copy_right; i.e. they read/write to byte_copy_right, byte_copy_right+1, etc. Previously the parameters would wrap to byte_copy_left. 11. The COPY-OFFSET instruction now correctly calculates the source address for all values of offset. Previously a very large offset (greater than the circular buffer size) could cause the starting position to be mis-calculated. 12. Modulo 65536 arithmetic has been added in some places where it was missing. [Only when noticed, we have not been able to check all the code.] 13. Some redundant code was removed for the INPUT-BITS instruction. Also, INPUT-BITS (0, x, x) now correctly discards spare bits when the P-bit, has changed. 14. Corrected the cycles used calculation for the INPUT-BITS instruction. 15. Corrected some minor cases where the used_udvm_cycles was not incremented. [Not really a problem, but it allowed us to verify correctness with some of the SigComp torture tests.] 16. Removed some redundant code in INPUT-HUFFMAN (and reorganised some comments to keep them making sense). Function decomp_dispatch_get_bits: 1. This has been rewritten. The original version could not correctly handle requests for more than 8 bits. The new version is cleaner and correctly handles all cases. svn path=/trunk/; revision=14666
2005-02-20fix a typo: lenght -> lengthUlf Lamping1-1/+1
This seems to be a "more common" typo, fixed it 13 times throughout the code ... svn path=/trunk/; revision=13452
2005-01-24Bugfix incorect while condition from Mutsuya IrieAnders Broman1-2/+2
svn path=/trunk/; revision=13166
2004-12-20Add NL to last lineJörg Mayer1-1/+2
svn path=/trunk/; revision=12788
2004-11-23Don't free string that don't need it. Added filter possibillity on Partial stateAnders Broman1-8/+4
svn path=/trunk/; revision=12582
2004-11-22Fix some memmory leaksAnders Broman1-559/+568
svn path=/trunk/; revision=12579
2004-11-21Clean-up hash table at reloading of file.Anders Broman1-0/+13
svn path=/trunk/; revision=12568
2004-11-21Free the statebuff and the stringAnders Broman1-1/+3
svn path=/trunk/; revision=12567
2004-11-16Implemented state-create, handling of g_hash_table at redesection needs more ↵Anders Broman1-19/+198
work. svn path=/trunk/; revision=12531
2004-10-08Add sigcomp Universal Decompressor Virtual Machine (UDVM) and state handler, ↵Anders Broman1-0/+468
for decompression of sigcomp messages. Currently states are or not saved so only messages with bytecode can be decompressed. svn path=/trunk/; revision=12236