smtp_client_transport.c File Reference

Transport protocol abstraction layer. More...

#include "core/net.h"
#include "smtp/smtp_client.h"
#include "smtp/smtp_client_transport.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   SMTP_TRACE_LEVEL
 

Functions

error_t smtpClientOpenConnection (SmtpClientContext *context)
 Open network connection. More...
 
error_t smtpClientEstablishConnection (SmtpClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
 Establish network connection. More...
 
error_t smtpClientOpenSecureConnection (SmtpClientContext *context)
 Open secure connection. More...
 
error_t smtpClientEstablishSecureConnection (SmtpClientContext *context)
 Establish secure connection. More...
 
error_t smtpClientShutdownConnection (SmtpClientContext *context)
 Shutdown network connection. More...
 
void smtpClientCloseConnection (SmtpClientContext *context)
 Close network connection. More...
 
error_t smtpClientSendData (SmtpClientContext *context, const void *data, size_t length, size_t *written, uint_t flags)
 Send data using the relevant transport protocol. More...
 
error_t smtpClientReceiveData (SmtpClientContext *context, void *data, size_t size, size_t *received, uint_t flags)
 Receive data using the relevant transport protocol. More...
 

Detailed Description

Transport protocol abstraction layer.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file smtp_client_transport.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   SMTP_TRACE_LEVEL

Definition at line 32 of file smtp_client_transport.c.

Function Documentation

◆ smtpClientCloseConnection()

void smtpClientCloseConnection ( SmtpClientContext context)

Close network connection.

Parameters
[in]contextPointer to the SMTP client context

Definition at line 228 of file smtp_client_transport.c.

◆ smtpClientEstablishConnection()

error_t smtpClientEstablishConnection ( SmtpClientContext context,
const IpAddr serverIpAddr,
uint16_t  serverPort 
)

Establish network connection.

Parameters
[in]contextPointer to the SMTP client context
[in]serverIpAddrIP address of the SMTP server to connect to
[in]serverPortTCP port number that will be used to establish the connection
Returns
Error code

Definition at line 86 of file smtp_client_transport.c.

◆ smtpClientEstablishSecureConnection()

error_t smtpClientEstablishSecureConnection ( SmtpClientContext context)

Establish secure connection.

Parameters
[in]contextPointer to the SMTP client context
Returns
Error code

Definition at line 161 of file smtp_client_transport.c.

◆ smtpClientOpenConnection()

error_t smtpClientOpenConnection ( SmtpClientContext context)

Open network connection.

Parameters
[in]contextPointer to the SMTP client context
Returns
Error code

Definition at line 50 of file smtp_client_transport.c.

◆ smtpClientOpenSecureConnection()

error_t smtpClientOpenSecureConnection ( SmtpClientContext context)

Open secure connection.

Parameters
[in]contextPointer to the SMTP client context
Returns
Error code

Definition at line 100 of file smtp_client_transport.c.

◆ smtpClientReceiveData()

error_t smtpClientReceiveData ( SmtpClientContext context,
void *  data,
size_t  size,
size_t *  received,
uint_t  flags 
)

Receive data using the relevant transport protocol.

Parameters
[in]contextPointer to the SMTP client context
[out]dataBuffer into which received data will be placed
[in]sizeMaximum number of bytes that can be received
[out]receivedNumber of bytes that have been received
[in]flagsSet of flags that influences the behavior of this function
Returns
Error code

Definition at line 292 of file smtp_client_transport.c.

◆ smtpClientSendData()

error_t smtpClientSendData ( SmtpClientContext context,
const void *  data,
size_t  length,
size_t *  written,
uint_t  flags 
)

Send data using the relevant transport protocol.

Parameters
[in]contextPointer to the SMTP client context
[in]dataPointer to a buffer containing the data to be transmitted
[in]lengthNumber of bytes to be transmitted
[out]writtenActual number of bytes written (optional parameter)
[in]flagsSet of flags that influences the behavior of this function
Returns
Error code

Definition at line 258 of file smtp_client_transport.c.

◆ smtpClientShutdownConnection()

error_t smtpClientShutdownConnection ( SmtpClientContext context)

Shutdown network connection.

Parameters
[in]contextPointer to the SMTP client context
Returns
Error code

Definition at line 191 of file smtp_client_transport.c.