aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bittorrent.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.wmeier1-1/+1
Also: remove trailing whitespace for a number of files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39503 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵wmeier1-4/+4
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39426 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-11Fix a bug wherein proto_tree_add_uint() was intended instead of ↵wmeier1-1/+1
proto_tree_add_item(); This bug would have caused display of a FT_UINT32 field with the wrong endianness. (Replaces change made in SVN #39350). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39360 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-10Fix bugs which caused certain fields to display with the wrong endianness;wmeier1-1/+1
Specifically: some proto_tree_add_item() 'encoding' args were incorrect. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39350 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵wmeier1-11/+11
reference an hf item (in hf[] with types: FT_NONE FT_BYTES FT_IPV6 FT_IPXNET FT_OID Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39260 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-26Get rid of check_col, while at it set ENC.etxrab1-47/+44
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39146 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-21Fix ex "modeline" so it works;wmeier1-1/+1
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39081 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-27From Yaniv Kaul:wmeier1-3/+0
Some fixes for 'set but not used' errors that GCC 4.6 emits. From me: #include <string.h> not req'd. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36907 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-19From Georg Mueller via bug #5851: Add not handled IDs to BitTorrentsfisher1-1/+27
dissector git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36726 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-31Fix minor bug lookups of certain "peer ids" would fail.wmeier1-3/+3
The issue (in essence) For: char foo[][4] = {"abc", "defg", "hij"}; strlen(foo[1]) will be 7 and not 4 as expected; Detected via msvc level 4 warning: "array is too small to include a terminating null character" git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35732 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-20Rename the routines that handle dissector tables with unsigned integerguy1-9/+9
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35224 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-07Use find_or_create_conversation() rather than only conversation_new().wmeier1-3/+1
Fixes bug #2907: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33136 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-11Use consistent indentation; Whitesapce & formatting cleanup.wmeier1-362/+376
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32755 f5534014-38df-0310-8fa8-9805f1628bb7
2010-04-03Remove unneeded #include <stdio.h>wmeier1-2/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32367 f5534014-38df-0310-8fa8-9805f1628bb7
2010-01-13From Didier Gautheron:etxrab1-3/+1
check_col.diff Remove redundant calls to check_col() if it guards only one columns function with one parameter after the column type. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31519 f5534014-38df-0310-8fa8-9805f1628bb7
2009-11-16Added more Peer ID Conventions.stig1-22/+87
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30980 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-09Don't guard col_set_str (COL_INFO/COL_PROTOCOL) with col_checkkrj1-15/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29345 f5534014-38df-0310-8fa8-9805f1628bb7
2009-06-18From Kovarththanan Rajaratnam via bug 3548:stig1-28/+28
(1) Trailing/leading spaces are removed from 'name's/'blurb's (2) Duplicate 'blurb's are replaced with NULL (3) Empty ("") 'blurb's are replaced with NULL (4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME, FT_PROTOCOL, FT_STRING and FT_STRINGZ field types (5) Only allow non-zero value for 'display' if 'bitmask' is non-zero git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28770 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-29More size_t casts.etxrab1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27879 f5534014-38df-0310-8fa8-9805f1628bb7
2008-12-18Fix various typos and spelling errors (mostly in text strings)wmeier1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27050 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-26#include <emem.h> not req'dwmeier1-1/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26091 f5534014-38df-0310-8fa8-9805f1628bb7
2008-07-11Remove some dead (statement not reached) code (while trying to avoid any ↵morriss1-4/+0
false control reaches end of non-void function warnings) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25706 f5534014-38df-0310-8fa8-9805f1628bb7
2007-11-09Apply yet another set of the optimization patches:etxrab1-1/+2
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length(). On the other hand if (tvb_bytes_exist(tvb, 0, 20) is more readable than if (tvb_length(tvb) >= 20 so only do it in heuristic function git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23412 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-15- s/ntohs/g_ntohsmorriss1-25/+24
- s/ntohl/g_ntohl - s/free/g_free - Change some tvb_get_string()+g_free()'s into tvb_get_ephemeral_string() - Change some tvb_fake_unicode()+g_free()'s into tvb_get_ephemeral_faked_unicode() - Change some tvb_get_string() calls that were clearly memory leaks (like atoi(tvb_get_string(...))) into tvb_get_ephemeral_string() git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22515 f5534014-38df-0310-8fa8-9805f1628bb7
2007-04-23Add some GCC warnings to the standard set, and add some others to theguy1-2/+2
--enable-extra-gcc-checks set. If we turn on -pedantic, try turning on -Wno-long-long as well, so that it's not *so* pedantic that it rejects the 64-bit integral data types that we explicitly require. Constify a bunch of stuff, and make some other changes, to get rid of warnings. Clean up some indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21526 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-28Remove almost all of the casts I committed recently and in place ofsfisher1-6/+6
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21253 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-28Fix a bunch of warnings, add svn:keywords Id and svn:eol-style nativesfisher1-2/+2
to packet-iuup.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21244 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-27Fix a warning in packet-bittorrent.c I didn't fix right the first time and ↵sfisher1-1/+1
try to get the Win32 buildbot going again in packet-ndmp.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21238 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-27Fix about 100 simple to fix warnings from gcc 4.0 in epan/dissectors sfisher1-7/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21233 f5534014-38df-0310-8fa8-9805f1628bb7
2006-10-31change the signature for the get_pdu_len() function pointer passed to ↵sahlberg1-1/+1
tcp_dissect_pdus() to also include a packet_info pointer. there are many reasons why some protocols actually need to be able to access the pinfo structure while determining the pdu size git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19751 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21change a whole bunch of ethereal into wiresharksahlberg1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18196 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-20waste a couple of bytes per tcp conversation and make the tree for ↵sahlberg1-0/+1
acked_packets (i.e. packets that have interesting tcp properties such as being retransmissions etc) hang off the per conversation tcpd struct instead of being global. while this should improve performance by unmeasurably little it does have the sideeffect that once we finish the rewrite tcp analysis might actually work and work well even for tcp over tcp tunnelling. this also means that if you include packet-tcp.h you also need to include emem.h . git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17681 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-19From John Sullivan:etxrab1-11/+472
Three patches here: eth-ed-2.diff ------------- 1) The handling of HashSet Answer messages was wrong 2) Add dissection of some more eMule extension packets to do with error recovery eth-bt-1.diff ------------- New versions of the Azureus BitTorrent client implement a new extension to the protocol, which is effectively a text based encapsulation of the binary BitTorrent protocol, embedded within the BitTorrent protocol. Who knows why they thought that was a good idea, but this patch can pick apart their new headers. eth-bt-2.diff ------------- By registering a normal dissector as well as the heuristic one, BitTorrent shows up on the Decode As... list so you can manually override its mistake. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16856 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-05bugfix: don't crash, if not enough bytes of the header availableulfl1-0/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16124 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-02enhancements COL_INFO output and make bittorrent protocol filterableulfl1-13/+45
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16067 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-18The length returned for continuation data should be the length remainingguy1-6/+7
in the tvbuff starting at the specified offset, not the entire length of the tvbuff. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15401 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-18Show BitTorrent stuff that doesn't look right as continuation data.guy1-24/+38
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15399 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-17If we receive junk data from the network it means we have agerald1-2/+2
malformed packet. It doesn't necessarily mean that we have a problem with our dissector. If we see something we didn't expect, throw a ReportedBoundsError instead of calling DISSECTOR_ASSERT() (which makes BuildBot open a ticket). Fixes bugs 362 - 366. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15390 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-16From Peter Johansson: add an option to decode the client information,guy1-190/+286
and check the validity of messages a bit more carefully. Reformat a bit so not as much code is missed by those of us who like narrow editor windows. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15369 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-09Find the BitTorrent dissector immediately after registering it, and saveguy1-15/+16
the handle, rather than finding it every time we need it. Just make a guint8 array with the BitTorrent magic string length followed by the string, and use "tvb_memeql()" to test against that - it handles checking to make sure there's enough data in the tvbuff (if not, it returns -1 as a "no match" indication) and then checks all of the first 20 bytes in one operation. Clean up white space. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14882 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-26Get rid of the private "my_match_strval()" routine in many dissectors;guy1-2/+2
add a "match_strval_idx()" routine that does the same thing, and have "match_strval()" call it. Make those routines, and "val_to_str()", return a "const" pointer. Update dissectors as necessary to squelch compiler warnings produced by that. Use "val_to_str()" rather than using "match_strval()" and then, if the result is null, substituting a specific string. Clean up some other "match_strval()"/"val_to_str()" usages. Add a null pointer check in the NDPS dissector's "attribute_value()" routine, as it's not clear that "global_attribute_name" won't be null at that point. Make some global variables in the AFS4INT dissector local. Make some routines not used outside the module they're in static. Make some tables "static const". Clean up white space. Fix Gerald's address in some files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14786 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-10just to get things straight: a dissector should *never* do any g_assert() calls!ulfl1-1/+1
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED() this will replace application crash by showing a dissector bug, which is the desired behaviour there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14608 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-02From Jon Ringle:etxrab1-1/+1
1) Added a setup_frame parameter to conversation_t 2) Used the conversation_t next to maintain a list of conversations with the same src/dest tuple but different setup_frame number. 3) Changed the signature of find_conversation() and conversation_new() to pass in the frame number. 4) Adjusted packet-sdp to select RTP conversation if both m=audio and m=image are present, and T.38 conversation if only m=image is present. I expect that RTP/T.38 dissecting to be better, but I don't have a way to generate T.38 packets. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13243 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-03Add a URL for the BitTorrent protocol spec.guy1-0/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12664 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-01From Jelmer Vernooij: BitTorrent support.guy1-0/+302
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12638 f5534014-38df-0310-8fa8-9805f1628bb7