aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
AgeCommit message (Collapse)AuthorFilesLines
2001-07-03Use the "pinfo" argument, rather than the global "pi", to refer to theGuy Harris1-2/+2
packet information in tvbuffified dissectors. svn path=/trunk/; revision=3645
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-3/+3
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-04-23Get rid of END_OF_FRAME references in tvbuffified dissectors.Guy Harris1-2/+3
svn path=/trunk/; revision=3364
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
2001-01-25Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="Guy Harris1-6/+6
statements. Move the setting of the Protocol column in various dissectors before anything is fetched from the packet, and also clear the Info column at that point in those and some other dissectors, so that if an exception is thrown, the columns don't reflect the previous protocol. "Tvbuffify" the Mobile IP dissector (it took old-style arguments, and then converted them into tvbuff arguments, so there wasn't much to do, other than to fix references to "fd" to refer to "pinfo->fd"). In the SCTP dissector, refer to the port type and source and destination ports through "pinfo" rather than through the global "pi", as it's a tvbuffified dissector. In the SMTP and Time Protocol dissectors, use "pinfo->match_port" rather than "TCP_PORT_SMTP" when checking whether the packet is a request or reply, just in case somebody makes a non-standard port be dissected as SMTP or Time. (Also, remove a bogus comment from the Time dissector; it was probably cut-and-pasted from the TFTP dissector.) svn path=/trunk/; revision=2938
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-2/+2
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and "register_dissector()", so that an entry in those tables has associated with it the protocol index of the protocol the dissector handles (or -1, if there is no protocol index for it). This is for future use in a number of places. (Arguably, "proto_register_protocol()" should take a dissector pointer as an argument, but 1) it'd have to handle both regular and heuristic dissectors; 2) making it take either a "dissector_t" or a union of that and a "heur_dissector_t" introduces some painful header-file interdependencies so I'm punting on that for now. As with other Ethereal internal APIs, these APIs are subject to change in the future, at least until Ethereal 1.0 comes out....) svn path=/trunk/; revision=2849
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-2/+3
protocols, in addition to adding structures to the list of filterable fields. Give it an extra argument that specifies a "short name" for the protocol, for use in such places as pinfo->current_proto; the dialog box for constructing filters; the preferences tab for the protocol; and so on (although we're not yet using it in all those places). Make the preference name that appears in the preferences file and the command line for the DIAMETER protocol "diameter", not "Diameter"; the convention is that the name in question be all-lower-case. Make some routines and variables that aren't exported static. Update a comment in the ICP dissector to make it clear that the dissector won't see fragments other than the first fragment of a fragmented datagram. svn path=/trunk/; revision=2810
2000-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-3/+3
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
2000-11-13Use "tvb_offset_exists()" rather than "tvb_length_remaining()" to checkGuy Harris1-3/+3
whether there's any data left in the tvbuff starting at a specified offset. svn path=/trunk/; revision=2636
2000-11-12Add only one "proto_smtp" item to the protocol tree for SMTP; add textGuy Harris1-13/+11
subitems with "proto_tree_add_text()". svn path=/trunk/; revision=2616
2000-11-12Tvbuffify the SMTP dissector.Guy Harris1-81/+159
Don't assume that we start out getting commands from the client - the capture may have started in the middle of a transaction, and we may be getting a message body from the client instead. Only treat stuff as commands if it consists of four alphabetic characters followed either by an end-of-line or a space. Commands in SMTP are case-insensitive; when looking for "DATA", do a case-insensitive comparison. If the packet contains the message body, just put "Message Body" in the summary, don't put any of the message body itself in there. If it's a command, put "Command:" in the summary before the first line of the command. When putting the message body into the protocol tree, give each line its own entry, rather than putting the entire body in as one entry. Don't put an entry into the protocol tree for a command parameter if there is no command parameter. svn path=/trunk/; revision=2614
2000-11-11Simplify the state machine:Guy Harris1-42/+63
you're either reading commands, or you're reading message data; if you're reading commands, and you see a DATA command, you start reading data; if you're reading data, and you see an EOM, you start reading commands. Also, *always* fill in the per-frame data you allocate for a frame, and *always* attach it to the packet. The old state machine assumed it was done with the SMTP conversation once it saw an EOM, and the dissector wouldn't fill in the per-frame data it'd allocated and attach it to the packet if it thought it was done with the SMTP conversation. This meant that: 1) the per-frame data allocated for frames following the EOM (e.g., a QUIT command) would contain random junk for data such as the packet type; 2) that per-frame data would be re-allocated every time the frame was looked at, as it wouldn't be attached to the frame, so you might well get *different* random junk each time the frame was looked at. This caused Tethereal and Ethereal to sometimes fail to recognize commands following the EOM - but it wouldn't *always* fail to do so, sometimes it'd work and sometimes it wouldn't. Fix a comment; conversations are *not* removed during filter operations, and the visited flag is *not* cleared during a filter operation - that's only true on a *redissection* operation. In any case, given that frames can, after the initial sequential scan through the capture, be visited in any order, and visited repeatedly, it's irrelevant whether conversations are removed or not - we have to associate with each frame information telling us how to process it. svn path=/trunk/; revision=2608
2000-10-21Support for conversations with "wildcard" destination addresses, fromGuy Harris1-3/+4
Jeff Foster. svn path=/trunk/; revision=2523
2000-09-11Move format_text(), get_token_len(), and fine_line_end(), into strutil.cGilbert Ramirez1-1/+2
This keeps tvbuff.c generic; it doesn't have to pull in packet.h and all of it's included files. svn path=/trunk/; revision=2409
2000-08-26Fix a minor spelling mistake ...Richard Sharpe1-2/+2
svn path=/trunk/; revision=2379
2000-08-24Fixes to add state keeping and properly decode SMTP.Richard Sharpe1-20/+300
svn path=/trunk/; revision=2362
2000-08-20SMTP is Simple *Mail* Transfer Protocol not Message.Laurent Deniel1-2/+8
Add [OLD_]CHECK_DISPLAY_AS_DATA call. svn path=/trunk/; revision=2308
2000-08-20This is an SMTP dissector, not a BXXP dissector; fix the comment at theGuy Harris1-6/+6
beginning. Pass "pinfo->fd", not "fd", to "p_get_proto_data()", so that it'll continue to work even when tvbuffified. Use "strchr()", not "index()" - "strchr()" is in the ANSI C standard, and may be in some systems that don't have "index()", whereas those systems that had "index()" but not "strchr()" got with the ANSI C program a while ago. Use "old_dissector_add()" and "old_dissector_delete()" to register and unregister the SMTP dissector, as it's not yet been tvbuffified. svn path=/trunk/; revision=2303
2000-08-19Added packet-smtp.c and modified packet.c to include code that was neverRichard Sharpe1-0/+211
finished ... The SMTP dissection is a good start, but does not handle the message body at all ... On to that next. svn path=/trunk/; revision=2302