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

/opentcp/include/inet/pop3/pop3_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_POP3_CLIENT_H
00065 #define INCLUDE_POP3_CLIENT_H
00066 
00067 #include<inet/datatypes.h>
00068 
00069 #define POP3C_SENDERMAXLEN      30              
00072 #define POP3C_SUBJECTMAXLEN     30              
00076 #define POP3C_TOUT                      20      
00085 struct pop3c_struct
00086 {
00087         UINT8 state;                                            
00088         UINT32 remip;                                           
00089         UINT16 remport;                                         
00090         INT8 sochandle;                                         
00091         UINT8 tmrhandle;                                        
00092         UINT8 unacked;                                          
00093         UINT16 msgtotal;                                        
00094         UINT16 curmsgindex;                                     
00095         UINT32 curmsgtotlen;                            
00096         UINT16 curmsghlen;                                      
00097         UINT8 headerbuf[9];                                     
00098         UINT8 charsinheaderbuf;                         
00099         UINT8 from[POP3C_SENDERMAXLEN];         
00100         UINT8 subject[POP3C_SUBJECTMAXLEN];     
00102 };
00103 
00104 
00105 /* POP3 States                          */
00106 
00107 #define POP3C_UNINITIALIZED                     1       
00108 #define POP3C_CLOSED                            2       
00109 #define POP3C_OPEN_REQUESTED            3       
00110 #define POP3C_CONNECTIONOPEN_SENT       4       
00111 #define POP3C_CONNECTION_OPENED         5       
00112 #define POP3C_SERVER_READY                      6       
00113 #define POP3C_USERNAME_SENT                     7       
00114 #define POP3C_USERNAME_ACKED            8       
00115 #define POP3C_PASSWORD_SENT                     9       
00116 #define POP3C_PASSWORD_ACKED            10      
00117 #define POP3C_STAT_SENT                         11      
00118 #define POP3C_STAT_GET                          12      
00119 #define POP3C_LIST_SENT                         13      
00120 #define POP3C_LIST_GET                          14      
00121 #define POP3C_TOP0_SENT                         15      
00122 #define POP3C_RECEIVING_HEADER          16      
00123 #define POP3C_RECEIVING_HDR_FROM        17      
00124 #define POP3C_RECEIVING_HDR_SUBJ        18      
00125 #define POP3C_TOP0_GET                          19      
00126 #define POP3C_RETR_SENT                         20      
00127 #define POP3C_RECEIVING_MSG_HEADER      21      
00128 #define POP3C_RECEIVING_MSG                     22      
00129 #define POP3C_MESSAGE_RECEIVED          23  
00130 #define POP3C_DELE_SENT                         24      
00131 #define POP3C_DELE_ACKED                        25      
00132 #define POP3C_QUIT_SENT                         26      
00133 #define POP3C_QUIT_ACKED                        27      
00135 #define POP3C_OK        '+' 
00136 
00137 
00138 /* Function prototypes (internal)       */
00139 
00140 INT8 pop3c_connect(UINT32, UINT16);
00141 void pop3c_init(void);
00142 UINT8 pop3c_getstate(void);
00143 INT32 pop3c_eventlistener(INT8, UINT8, UINT32, UINT32);
00144 void pop3c_run(void);
00145 void pop3c_senduser(void);
00146 void pop3c_sendpassword(void);
00147 void pop3c_sendstat(void);
00148 void pop3c_sendlist(UINT16);
00149 void pop3c_sendtop(UINT16);
00150 void pop3c_sendretr(UINT16);
00151 void pop3c_senddele(UINT16);
00152 void pop3c_sendquit(void);
00153 void pop3c_changestate(UINT8);
00154 INT16 pop3c_parsestat(void);
00155 INT16 pop3c_parselist(void);
00156 
00157 
00158 
00159 /* Function prototypes (callbacks, external)    */
00160 
00161 void pop3c_error(void);
00162 void pop3c_data(UINT8);
00163 void pop3c_allok(void);
00164 void pop3c_messages(UINT16);
00165 INT16 pop3c_msgoffer(UINT16, UINT32, UINT8*, UINT8*);
00166 INT8 pop3c_getusername(UINT8*);
00167 INT8 pop3c_getpassword(UINT8*);
00168 
00169 #endif

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