Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/smtp/smtp_client.h

Go to the documentation of this file.
00001 /*
00002  *Copyright (c) 2000-2002 Viola Systems Ltd.
00003  *All rights reserved.
00004  *
00005  *Redistribution and use in source and binary forms, with or without 
00006  *modification, are permitted provided that the following conditions 
00007  *are met:
00008  *
00009  *1. Redistributions of source code must retain the above copyright 
00010  *notice, this list of conditions and the following disclaimer.
00011  *
00012  *2. Redistributions in binary form must reproduce the above copyright 
00013  *notice, this list of conditions and the following disclaimer in the 
00014  *documentation and/or other materials provided with the distribution.
00015  *
00016  *3. The end-user documentation included with the redistribution, if 
00017  *any, must include the following acknowledgment:
00018  *      "This product includes software developed by Viola 
00019  *      Systems (http://www.violasystems.com/)."
00020  *
00021  *Alternately, this acknowledgment may appear in the software itself, 
00022  *if and wherever such third-party acknowledgments normally appear.
00023  *
00024  *4. The names "OpenTCP" and "Viola Systems" must not be used to 
00025  *endorse or promote products derived from this software without prior 
00026  *written permission. For written permission, please contact 
00027  *opentcp@opentcp.org.
00028  *
00029  *5. Products derived from this software may not be called "OpenTCP", 
00030  *nor may "OpenTCP" appear in their name, without prior written 
00031  *permission of the Viola Systems Ltd.
00032  *
00033  *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 
00034  *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00035  *MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
00036  *IN NO EVENT SHALL VIOLA SYSTEMS LTD. OR ITS CONTRIBUTORS BE LIABLE 
00037  *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
00038  *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
00039  *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
00040  *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00041  *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
00042  *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
00043  *EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00044  *====================================================================
00045  *
00046  *OpenTCP is the unified open source TCP/IP stack available on a series 
00047  *of 8/16-bit microcontrollers, please see <http://www.opentcp.org>.
00048  *
00049  *For more information on how to network-enable your devices, or how to 
00050  *obtain commercial technical support for OpenTCP, please see 
00051  *<http://www.violasystems.com/>.
00052  */
00053 
00064 #ifndef INCLUDE_SMTP_CLIENT_H
00065 #define INCLUDE_SMTP_CLIENT_H
00066 
00067 #include<inet/datatypes.h> 
00068 
00069 /* SMTPC timeout                */
00070 
00071 #define SMTPC_TOUT              20                              
00075 /* States of SMTP state machine */
00076 
00077 
00078 #define SMTP_UNINITIALIZED                      1       
00079 #define SMTP_CLOSED                                     2       
00080 #define SMTP_OPEN_REQUESTED                     3       
00081 #define SMTP_CONNECTIONOPEN_SENT        4       
00082 #define SMTP_CONNECTION_OPENED          5       
00083 #define SMTP_SERVER_READY                       6       
00084 #define SMTP_HELO_SENT                          7       
00085 #define SMTP_HELO_ACKED                         8       
00086 #define SMTP_MAILFROM_SENT                      9       
00087 #define SMTP_MAILFROM_ACKED                     10      
00088 #define SMTP_RCPTTO_SENT                        11      
00089 #define SMTP_RCPTTO_ACKED                       12      
00090 #define SMTP_DATAREQ_SENT                       13      
00091 #define SMTP_DATAREQ_ACKED                      14      
00092 #define SMTP_BODY_SENT                          15      
00093 #define SMTP_SENDING_DATA                       16      
00094 #define SMTP_DATAEND_REACHED            17      
00095 #define SMTP_DATAEND_SENT                       18      
00096 #define SMTP_DATAEND_ACKED                      19      
00097 #define SMTP_QUIT_SENT                          20      
00098 #define SMTP_QUIT_ACKED                         21      
00101 /* SMTP Server replies  */
00102 
00103 #define SMTP_CMD_SERVER_READY   '2' + '2' + '0'         
00104 #define SMTP_CMD_OK                             '2' + '5' + '0'         
00105 #define SMTP_CMD_DATAOK                 '3' + '5' + '4'         
00106 #define SMTP_CMD_QUITOK                 '2' + '2' + '1'         
00110 /* Function prototypes  (internal)      */
00111 
00112 INT8 smtpc_connect(UINT32, UINT16);
00113 void smtpc_init(void);
00114 INT32 smtpc_eventlistener(INT8, UINT8, UINT32, UINT32);
00115 void smtpc_run(void);
00116 UINT8 smtpc_getstate(void);
00117 void smtpc_sendhelo(void);
00118 void smtpc_sendmailfrom(void);
00119 void smtpc_sendrcptto(void);
00120 void smtpc_senddatareq(void);
00121 void smtpc_sendbody(void);
00122 void smtpc_senddataend(void);
00123 void smtpc_sendquit(void);
00124 INT16 smtpc_senddata(void);
00125 void smtpc_changestate(UINT8);
00126 
00127 
00128 /* Function prototypes (callbacks)      */
00129 INT8 smtpc_getdomain(UINT8*);
00130 INT8 smtpc_getsender(UINT8*);
00131 INT8 smtpc_getreceiver(UINT8*);
00132 INT8 smtpc_getsubject(UINT8*);
00133 INT16 smtpc_getdata(UINT8*, UINT16);
00134 void smtpc_dataacked(void);
00135 void smtpc_error(void);
00136 void smtpc_allok(void);
00137 
00138 
00139 #endif

Generated on Sun Aug 3 20:32:59 2003 for OpenTCP by doxygen1.2.18