aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
AgeCommit message (Collapse)AuthorFilesLines
2001-11-20Get rid of "tvb_compat()"; it's no longer needed (the one remaining callGuy Harris1-10/+1
to it returns data that's no longer used). svn path=/trunk/; revision=4237
2001-11-13Hopefully the last time I have to change my e-mail address.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=4199
2001-11-03TVBUFF_SUBSET tvbuffs share a "ds_name" with the parent tvbuff, so theirGuy Harris1-5/+11
"ds_name"s shouldn't be freed when the tvbuff is freed. (Thanks and a tip of the Hatlo hat to the FreeBSD memory allocator for complaining about multiple frees of the same string.) svn path=/trunk/; revision=4136
2001-11-03More indentation fixes.Guy Harris1-2/+2
svn path=/trunk/; revision=4135
2001-11-03Fix the indentation.Guy Harris1-4/+4
svn path=/trunk/; revision=4129
2001-11-02Fix leak of ds_name. Thanks to Sirop Erable <matrix_ottawa@yahoo.ca>Gilbert Ramirez1-1/+6
svn path=/trunk/; revision=4128
2001-10-29Stop using "tvb_get_ntohll()" and "%llX" in the BOOTP dissector, as theGuy Harris1-24/+1
former depends on having "guint64" and the latter depends on "%ll[douxX]" being what's used to print 64-bit integers, and there are platforms on which Etheeal runs that don't have "guint64" or that don't use "%ll[douxX]" to print 64-bit integers. Get rid of the routines to extract 64-bit integers into "gint64"s and "guint64"s, as per Ronnie Sahlberg's suggestion, to discourage people from writing code that won't work on all platforms; they should be using FT_UINT64, or the routines in "int-64bit.c", instead. svn path=/trunk/; revision=4102
2001-10-26Fix some signed/unsigned comparison warnings. In the case of tvbuff.h,Gilbert Ramirez1-14/+21
there were 2 functions which accepted 'maxlength' == -1, but the function prototypes had maxlength as a guint --- fixed. svn path=/trunk/; revision=4087
2001-07-02Tvbuffify the DNS, NBNS, NBDS, and NBSS dissectors.Guy Harris1-3/+36
Add a "tvb_memeql()" routine, for doing "memcmp()"-style equality comparisons. svn path=/trunk/; revision=3631
2001-05-27Fix a comment, and update Gerald's e-mail address.Guy Harris1-3/+2
svn path=/trunk/; revision=3471
2001-03-23Changes required to support multiple named data sources.Jeff Foster1-2/+13
Tvbuffers changed to added the data source name, GUI and printing code changed to support these changes and display the multiple hex views. svn path=/trunk/; revision=3165
2001-03-13Make tvb_get_ptr() return 'const guint8*', and clean up all theGilbert Ramirez1-2/+2
usages of tvb_get_ptr(). packet-ieee80211.c still has one bad usage, in which it *does* modify the tvbuff's data. svn path=/trunk/; revision=3128
2000-12-27Tvbuffify the RIP and OSPF dissectors.Guy Harris1-2/+20
Change them to use facilities in Ethereal that were probably not present when they were originally written, e.g. routines to fetch 24-bit integers and to dump a bunch of raw bytes in hex. Redo them to extract data from the packet as they dissect it, rather than extracting an entire data structure at once; that way, it may be able to dissect a structure not all of which is in the packet. Dissect a bit more of the type-of-service metrics etc. in OSPF packets. Make "tvb_length_remaining()" return a "gint", not a "guint"; it returns -1 if the offset is past the end of the tvbuff. Add a "tvb_reported_length_remaining()" routine, similar to "tvb_length_remaining()". Use it instead of just subtracting an offset from "tvb_reported_length()". svn path=/trunk/; revision=2787
2000-12-25Add a new "tvb_strsize()" routine, which finds the size of aGuy Harris1-1/+34
NUL-terminated string, starting at a given offset. The size includes the terminating NUL. If it doesn't find the terminating NUL, it throws the appropriate exception, as either there's no terminating NUL in the packet or there is but it's past the end of the captured data in the packet. Use that routine in the TFTP dissector. As it throws an exception if the string isn't NUL-terminated, we can just use "%s" to print option strings; we don't need to use "%.*s" with a string length. svn path=/trunk/; revision=2783
2000-11-30In "tvb_find_guint8()" and "tvb_pbrk_guint8()", correctly set the limitGuy Harris1-4/+14
of the search if the caller-supplied limit goes past the end of the tvbuff - the limit should just be what remains in the tvbuff after the specified starting offset. In "tvb_find_line_end_unquoted()", after searching for the next interesting character, check the value we got back from that search, in "char_offset", not whatever happens to be in "cur_offset", to see if we found a character. svn path=/trunk/; revision=2719
2000-11-30In tvb_set_reported_length(), don't assert onGilbert Ramirez1-2/+4
reported_length <= tvb->reported_length, but throw a ReportedBoundsError if that condition is not met. svn path=/trunk/; revision=2718
2000-11-18Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSIGuy Harris1-1/+16
ESIS dissectors. Register the IP dissector and have dissectors that call it directly (rather than through a port table) call it through a handle. Add a routine "tvb_set_reported_length()" which a dissector can use if it was handed a tvbuff that contains more data than is actually in its part of the packet - for example, handing a padded Ethernet frame to IP; the routine sets the reported length of the tvbuff (and also adjusts the actual length, as appropriate). Then use it in IP. Given that, "ethertype()" can determine how much of the Ethernet frame was actually part of an IP datagram (and can do the same for other protocols under Ethernet that use "tvb_set_reported_length()"; have it return the actual length, and have "dissect_eth()" and "dissect_vlan()" use that to mark trailer data in Ethernet II frames as well as in 802.3 frames. svn path=/trunk/; revision=2658
2000-11-14Add tvb_set_child_real_data_tvbuff(), which allows you to tell theGilbert Ramirez1-7/+19
tvbuff routines that a particular TVBUFF_REAL_DATA tvbuff is a "child" of another tvbuff. This link is utilized during a tvb_free_chain(), so that the child is freed when no longer necessary. svn path=/trunk/; revision=2642
2000-11-13Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just aGuy Harris1-1/+11
string formatter, like "format_text()", and, as "tvbuff.c" now calls it (*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h" in just to declare "bytes_to_str()". It's now declared in "strutil.h", so include it in modules that use "bytes_to_str()" and weren't already including it. Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a pointer to a chunk of N bytes at a given offset in a tvbuff and then hands that chunk to "bytes_to_str()". Convert the code that was doing that to use "tvb_bytes_to_str()" instead (which caught what I suspect is a bug in the Q.2931 dissector, where it was handing an offset of 0 to "tvb_get_ptr()" - a cut-and-pasteo, I think). Tvbuffify the ARP dissector. svn path=/trunk/; revision=2634
2000-11-12Make "tvb_find_line_end()" and "tvb_find_line_end_unquoted()" treat CRGuy Harris1-72/+50
by itself as a line ending, as well as treating CR LF and LF as line endings. Tweak the Telnet dissector to treat LF and CR NUL as line endings, but not to treat CR by itself as a line ending (that's not exactly what the NVT specification in the Telnet RFC specifies, but the resulting output may be a bit more readable that way). svn path=/trunk/; revision=2613
2000-11-11Make the string-to-compare-with arguments to "tvb_strneql()" andGuy Harris1-3/+3
"tvb_strncaseeql()" "const guint8 *", so that you can pass them pointers to "const". svn path=/trunk/; revision=2611
2000-11-10Allow "tvb_find_guint8()", "tvb_pbrk_guint8()", and "tvb_strnlen()" toGuy Harris1-15/+30
take -1 as a "maxlength" value, meaning "to the end of the tvbuff". svn path=/trunk/; revision=2598
2000-11-10Tvbuffify the SAP and SDP dissectors.Guy Harris1-6/+215
Add "tvb_find_line_end_unquoted()" for the benefit of the SDP dissector; get rid of "find_line_end_unquoted()" as nobody uses it any more. Add "tvb_pbrk_guint8()" for the benefit of "tvb_find_line_end_unquoted()"; it searches for any of a number of characters, unlike "tvb_find_guint8()" which searches for only one. svn path=/trunk/; revision=2595
2000-11-09Tvbuffify the HTTP, NNTP, RSH, RTSP, and Telnet dissectors.Guy Harris1-11/+136
Add "tvb_find_line_end()", to find a CR and/or LF-terminated line in a tvbuff and return its length and the offset of the character after the line end, for the use of those dissectors. Add "tvb_strncaseeql()", which is like "tvb_strneql()" except that it does a case-insensitive comparison. svn path=/trunk/; revision=2590
2000-10-17Patch from Heikki Vatiainen to make "tvb_strnlen()" return the length ofGuy Harris1-6/+5
the string rather than the offset of the end of the string, plus a patch to "tvb_get_nstringz()" to treat the return value of "tvb_strnlen()" as a length rather than an end offset. svn path=/trunk/; revision=2502
2000-09-27First step in moving core Ethereal routines to libepan.Gilbert Ramirez1-0/+1144
svn path=/trunk/; revision=2458