aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smb-common.c
AgeCommit message (Collapse)AuthorFilesLines
2004-04-03In "get_unicode_or_ascii_string()", treat a negative length argument asGuy Harris1-6/+22
a very large unsigned integer (which it probably is), and trim it at INT_MAX, and fix the handling of too-long ASCII strings so that the "..." gets inserted. Make sure that all the bytes of the string exist before truncating the string length to the buffer length, so that the appropriate exception is thrown. svn path=/trunk/; revision=10548
2004-01-05removed some MSVC warnings (level 3)Ulf Lamping1-3/+3
svn path=/trunk/; revision=9561
2003-06-12Add new routines:Guy Harris1-15/+5
tvb_get_string() - takes a tvbuff, an offset, and a length as arguments, allocates a buffer big enough to hold a string with the specified number of bytes plus an added null terminator (i.e., length+1), copies the specified number of bytes from the tvbuff, at the specified offset, to that buffer and puts in a null terminator, and returns a pointer to that buffer (or throws an exception before allocating the buffer if that many bytes aren't available in the tvbuff); tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to a "gint" as arguments, gets the size of the null-terminated string starting at the specified offset in the tvbuff (throwing an exception if the null terminator isn't found), allocates a buffer big enough to hold that string, copies the string to that buffer, and returns a pointer to that buffer and stores the length of the string (including the terminating null) in the variable pointed to by the "gint" pointer. Replace many pieces of code allocating a buffer and copying a string with calls to "tvb_get_string()" (for one thing, "tvb_get_string()" doesn't require you to remember that the argument to "tvb_get_nstringz0()" is the size of the buffer into which you're copying the string, which might be the length of the string to be copied *plus 1*). Don't use fixed-length buffers for null-terminated strings (even if the code that generates those packets has a #define to limit the length of the string). Use "tvb_get_stringz()", instead. In some cases where a value is fetched but is only used to pass an argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()" instead. svn path=/trunk/; revision=7859
2003-05-09Move the ntlmv2 response dissection out of packet-ntlmssp.c and in toTim Potter1-1/+199
packet-smb-common.c so it can be used elsewhere. Dissect a ntlmv2 response in a session setup SMB if detected. svn path=/trunk/; revision=7655
2003-04-03Add an extra argument to get_unicode_string() to optionallyTim Potter1-3/+6
pass back string data. Start adding some COL_INFO tidbits for NETLOGON PDC query and PDC query response. svn path=/trunk/; revision=7399
2003-04-03Add an extra argument to get_ms_string() so we can optionally passTim Potter1-9/+8
back the value of the string to the caller. svn path=/trunk/; revision=7398
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-12/+12
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-10From Devin Heitmueller: dissect NTLMSSP authentication messages, and handleGuy Harris1-1/+146
the flags field in NTLMSSP messages as a 32-bit field. Make "get_unicode_or_ascii_string()" take a "Unicode or not" flag rather than a "packet_info *" as an argument, make it not static, and move it to "packet-smb-common.c", so that it can be used by the SMB dissector and the NTLMSSP dissector. Also get rid of some _U_'s that are applied to arguments that are, in fact, used. svn path=/trunk/; revision=5976
2002-06-16Fix "display_unicode_string()" to get the length of the Unicode string,Guy Harris1-17/+46
allocate a buffer big enough to hold the ASCIIfied version of that string, and then ASCIIfy the Unicode string into that buffer, rather than ASCIIfying into a fixed-length buffer. svn path=/trunk/; revision=5676
2002-05-27Account for hidden share types in share_types.Richard Sharpe1-1/+5
svn path=/trunk/; revision=5572
2002-05-24Move the value_string table for the share type values toGuy Harris1-1/+12
"packet-smb-common.c", and use it in "packet-dcerpc-srvsvc". svn path=/trunk/; revision=5545
2002-04-30Get rid of some unused arguments, and mark some others as unused.Guy Harris1-4/+4
Remove the declaration of "dissect_nt_sid()" from "packet-dcerpc-samr.c"; get it by including "packet-smb-common.h", instead. svn path=/trunk/; revision=5313
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-7/+4
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls that add FT_NONE or FT_PROTO items to the protocol tree, with -1. Replace some calls to "tvb_length()" or "tvb_length_remaining()" with calls to "tvb_reported_length()" and "tvb_reported_length_remaining()", as those give the actual length of the data in the packet, not just the data that happened to be captured. svn path=/trunk/; revision=4605
2001-07-08Get rid of incorrect "const" qualifier.Guy Harris1-2/+2
svn path=/trunk/; revision=3664
2001-07-08Use tvbuff-based routines to find the length of single-bit-character-setGuy Harris1-5/+20
strings. svn path=/trunk/; revision=3662
2001-07-08Tvbuffified SMB NETLOGON dissector, from Ronnie Sahlberg.Guy Harris1-101/+29
Fixed up some longstanding bugs (predating the tvbuffification) discovered during regression testing of the tvbuffification. svn path=/trunk/; revision=3661
2000-05-11Add tvbuff class.Gilbert Ramirez1-6/+6
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
2000-02-14In "display_flags()", panic if the size handed to it is neither 1, 2,Guy Harris1-5/+19
nor 4, as we currently don't handle that. svn path=/trunk/; revision=1634
2000-02-14Fix the comment at the beginning of the file.Guy Harris1-3/+2
svn path=/trunk/; revision=1630
2000-02-14Jeff Foster's SMB Mailslot and Netlogin dissectors; he splitGuy Harris1-0/+142
"packet-smb.c" up into several files. svn path=/trunk/; revision=1629