aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smtp.c
AgeCommit message (Collapse)AuthorFilesLines
2004-01-17splitted some of the preferences texts into more than one line,Ulf Lamping1-2/+2
to reduce the size of the preferences dialog. This becoming necessary, as some of the texts were huge svn path=/trunk/; revision=9693
2003-09-16There's no preference setting for the SMTP TCP port (and SMTP has aGuy Harris1-25/+4
well-known port), so we remove the extra code to handle changing it - if it ever becomes useful to have the port number settable, we can put it back. svn path=/trunk/; revision=8485
2003-06-11Put the SMTP request or response line into the protocol tree, and put theGuy Harris1-14/+27
subfields of it under that item. svn path=/trunk/; revision=7842
2003-06-10When checking for a CR-LF at the end of a packet, don't assume we haveGuy Harris1-2/+5
all the data in the packet - we might have captured with a snaplen insufficient to get it all. svn path=/trunk/; revision=7825
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-13/+13
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-10/+2
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
2002-07-17Add an extra argument to "tvb_find_line_end()", which specifies what itGuy Harris1-8/+31
should do if it doesn't find an EOL; if FALSE, it behaves as before, returning values that treat the line as ending at the end of the tvbuff, and if TRUE, it returns -1, so its caller can do segment reassembly until it gets the EOL. Add an option to the SMTP dissector to do segment reassembly, and do segment reassembly of the first line. svn path=/trunk/; revision=5891
2002-07-15SMTP and FTP response codes need more than 1 byte, as they can go up toGuy Harris1-3/+3
999; give them 4. svn path=/trunk/; revision=5874
2002-07-14Only put "smtp.req" into the tree for packets that contain requestGuy Harris1-3/+5
lines, and only put "smtp.rsp" into the tree for packets that contain reply lines; don't put either into the tree for packets that contain only message body text or an EOM. svn path=/trunk/; revision=5866
2002-07-14In FTP, a normal reply line has a 3-digit number at the beginning - aGuy Harris1-11/+48
line that doesn't is a middle line of a multi-line reply. Treat only lines with a 3-digit number at the beginning as reply lines with a response code and response argument. Provide filterable fields for the SMTP command and parameters, and the SMTP reply code and parameters, along the lines of what's done for FTP. svn path=/trunk/; revision=5865
2002-04-14From Joerg Mayer:Guy Harris1-3/+3
Declares some variables static. Creates a new include file packet-rsvp.h, and make use of it (change some extern decls to #inlcude). Move the file packet-pgm.h into packet-pgm.c as it is not used by anything outside packet-pgm.c. svn path=/trunk/; revision=5162
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-3/+2
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
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-5/+5
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-8/+8
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-6/+10
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
2001-11-13The hash table merely associates data structures with conversations,Guy Harris1-65/+9
but you can do that directly, so eliminate the hash table and just attach the data structures to the conversation directly. svn path=/trunk/; revision=4197
2001-09-03Instead of having a single datum attached to a conversation, have a listGuy Harris1-3/+2
of protocol-id-plus-datum pairs, so that multiple protocols can attach information to the same conversation. Dissectors that attach information to a conversation should not assume that if they find a conversation it has one of its data attached to it; the conversation might've been created by another dissector. svn path=/trunk/; revision=3901
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