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

/opentcp/smtp/smtpc_callbacks.c File Reference


Detailed Description

Author:
Version:
1.0
Date:
11.9.2002
Bug:
Warning:
Todo:

This file holds empty callback functions needed by the SMTP client to get user-specific e-mail data from the application. Add your own code to perform the requested tasks.

Definition in file smtpc_callbacks.c.

Go to the source code of this file.

Functions

void smtpc_error (void)
 SMTP client error handler.

void smtpc_allok (void)
 SMTP client success handler.

INT8 smtpc_getdomain (UINT8 *dbuf)
 Fills in local domain information.

INT8 smtpc_getsender (UINT8 *dbuf)
 Returns senders' e-mail address.

INT8 smtpc_getreceiver (UINT8 *dbuf)
 Returns receivers' e-mail address.

INT8 smtpc_getsubject (UINT8 *dbuf)
 Returns subject of the E-mail.

INT16 smtpc_getdata (UINT8 *dbuf, UINT16 buflen)
 Returns e-mail data (message) to be sent.

void smtpc_dataacked (void)
 Last data received by remote host.


Function Documentation

void smtpc_error void   
 

Author:
Date:
20.08.2002
This callback function is called by SMTP Client when there happens error of some kind (timeout, losing of connection etc.). It indicates that e-mail was not delivered to server.

Definition at line 84 of file smtpc_callbacks.c.

void smtpc_allok void   
 

Author:
Date:
12.08.2002
This callback function is called by SMTP Client when the packet is succesfully delivered to E-mail server.

Definition at line 99 of file smtpc_callbacks.c.

INT8 smtpc_getdomain UINT8 *    dbuf
 

Author:
Date:
12.08.2002
Parameters:
dbuf  pointer to buffer to which the domain name will be stored
Returns:
  • -1 - Error
  • >0 - Number of bytes inserted
This callback function is called by SMTP Client when it wants to know the local domain. The user is responsible of storing that domain to destbuf without NULL termination ('\0') and returning number of bytes on domain.

Definition at line 120 of file smtpc_callbacks.c.

INT8 smtpc_getsender UINT8 *    dbuf
 

Author:
Date:
12.08.2002
Parameters:
dbuf  pointer to buffer to which the sender will be stored
Returns:
  • -1 - Error
  • >0 - Number of bytes inserted
This callback function is called by SMTP Client when it wants to know the E-mail address of sender. The user is responsible of storing that address to destbuf without NULL termination ('\0') and returning number of bytes on E-mail address.

Definition at line 139 of file smtpc_callbacks.c.

INT8 smtpc_getreceiver UINT8 *    dbuf
 

Author:
Date:
12.08.2002
Parameters:
dbuf  pointer to buffer to which the receiver will be stored
Returns:
  • -1 - Error
  • >0 - Number of bytes inserted
This callback function is called by SMTP Client when it wants to know the E-mail address of receiver. The user is responsible of storing that address to destbuf without NULL termination ('\0') and returning number of bytes on E-mail address.

Definition at line 159 of file smtpc_callbacks.c.

INT8 smtpc_getsubject UINT8 *    dbuf
 

Author:
Date:
12.08.2002
Parameters:
dbuf  pointer to buffer to which the subject will be stored
Returns:
  • -1 - Error
  • >0 - Number of bytes inserted
This callback function is called by SMTP Client when it wants to know the subject of E-mail to be sent. The user is responsible of storing subject to destbuf without NULL termination ('\0') and returning number of bytes inserted.

Definition at line 178 of file smtpc_callbacks.c.

INT16 smtpc_getdata UINT8 *    dbuf,
UINT16    buflen
 

Author:
Date:
12.08.2002
Parameters:
dbuf  pointer to buffer to which the data will be stored
buflen  length of data buffer
Returns:
  • -1 - Error
  • >0 - Number of bytes inserted
This callback function is called by SMTP Client when it wants to get mail plain data from user. The user is responsible of filling dbuf and returning number of bytes assembled. When data end is reached the function must return (-1) without storing any bytes to buffer (so just send data untill you don't have any bytes to sent when callback is made to that function and return -1). Do not move read pointer of your data forward before SMTP makes callback to smtpc_dataacked!

Definition at line 203 of file smtpc_callbacks.c.

void smtpc_dataacked void   
 

Author:
Date:
12.08.2002
This callback function is called by SMTP Client when TCP has ensured that the last packet was transmitted succesfully and next time when smtpc_getdata callback is made new data should be assembled

Definition at line 219 of file smtpc_callbacks.c.


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18