4 changes: 2 additions & 2 deletions coap/coap_message.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions coap/coap_message.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_MESSAGE_H #ifndef _COAP_MESSAGE_H
Expand Down
4 changes: 2 additions & 2 deletions coap/coap_option.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
6 changes: 4 additions & 2 deletions coap/coap_option.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_OPTION_H #ifndef _COAP_OPTION_H
Expand Down Expand Up @@ -179,6 +179,8 @@ typedef enum
COAP_CONTENT_FORMAT_APP_PKIX_CERT = 287, COAP_CONTENT_FORMAT_APP_PKIX_CERT = 287,
COAP_CONTENT_FORMAT_APP_SENML_XML = 310, COAP_CONTENT_FORMAT_APP_SENML_XML = 310,
COAP_CONTENT_FORMAT_APP_SENSML_XML = 311, COAP_CONTENT_FORMAT_APP_SENSML_XML = 311,
COAP_CONTENT_FORMAT_SENML_ETCH_JSON = 320,
COAP_CONTENT_FORMAT_SENML_ETCH_CBOR = 322,
COAP_CONTENT_FORMAT_APP_VND_OCF_CBOR = 10000, COAP_CONTENT_FORMAT_APP_VND_OCF_CBOR = 10000,
COAP_CONTENT_FORMAT_APP_OSCORE = 10001, COAP_CONTENT_FORMAT_APP_OSCORE = 10001,
COAP_CONTENT_FORMAT_APP_JSON_DEFLATE = 11050, COAP_CONTENT_FORMAT_APP_JSON_DEFLATE = 11050,
Expand Down
4 changes: 2 additions & 2 deletions coap/coap_server.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions coap/coap_server.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_SERVER_H #ifndef _COAP_SERVER_H
Expand Down
11 changes: 6 additions & 5 deletions coap/coap_server_misc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -106,7 +106,8 @@ void coapServerTick(CoapServerContext *context)
/** /**
* @brief Process CoAP request * @brief Process CoAP request
* @param[in] context Pointer to the CoAP server context * @param[in] context Pointer to the CoAP server context
* @param[in] request Pointer to the request message * @param[in] data Pointer to the incoming CoAP message
* @param[in] length Length of the CoAP message, in bytes
* @return Error code * @return Error code
**/ **/


Expand Down Expand Up @@ -332,7 +333,7 @@ error_t coapServerInitResponse(CoapServerContext *context)
context->response.length = sizeof(CoapMessageHeader) + responseHeader->tokenLen; context->response.length = sizeof(CoapMessageHeader) + responseHeader->tokenLen;
context->response.pos = 0; context->response.pos = 0;


//Sucessful processing //Successful processing
return NO_ERROR; return NO_ERROR;
} }


Expand Down Expand Up @@ -428,7 +429,7 @@ error_t coapServerFormatReset(CoapServerContext *context, uint16_t mid)
//Set the length of the CoAP message //Set the length of the CoAP message
context->response.length = sizeof(CoapMessageHeader); context->response.length = sizeof(CoapMessageHeader);


//Sucessful processing //Successful processing
return NO_ERROR; return NO_ERROR;
} }


Expand Down
4 changes: 2 additions & 2 deletions coap/coap_server_misc.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_SERVER_MISC_H #ifndef _COAP_SERVER_MISC_H
Expand Down
32 changes: 16 additions & 16 deletions coap/coap_server_request.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -102,7 +102,7 @@ error_t coapServerGetUriQuery(CoapServerContext *context, char_t *queryString,


/** /**
* @brief Read an opaque option from the CoAP request * @brief Read an opaque option from the CoAP request
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number to search for * @param[in] optionNum Option number to search for
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[out] optionValue Pointer to the first byte of the option value * @param[out] optionValue Pointer to the first byte of the option value
Expand All @@ -125,7 +125,7 @@ error_t coapServerGetOpaqueOption(CoapServerContext *context, uint16_t optionNum


/** /**
* @brief Read a string option from the CoAP request * @brief Read a string option from the CoAP request
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number to search for * @param[in] optionNum Option number to search for
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[out] optionValue Pointer to the first byte of the option value * @param[out] optionValue Pointer to the first byte of the option value
Expand All @@ -148,7 +148,7 @@ error_t coapServerGetStringOption(CoapServerContext *context, uint16_t optionNum


/** /**
* @brief Read an uint option from the CoAP request * @brief Read an uint option from the CoAP request
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number to search for * @param[in] optionNum Option number to search for
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[out] optionValue Option value (unsigned integer) * @param[out] optionValue Option value (unsigned integer)
Expand All @@ -170,7 +170,7 @@ error_t coapServerGetUintOption(CoapServerContext *context, uint16_t optionNum,


/** /**
* @brief Get request payload * @brief Get request payload
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[out] payload Pointer to the first byte of the payload * @param[out] payload Pointer to the first byte of the payload
* @param[out] payloadLen Length of the payload, in bytes * @param[out] payloadLen Length of the payload, in bytes
* @return Error code * @return Error code
Expand All @@ -190,7 +190,7 @@ error_t coapServerGetPayload(CoapServerContext *context, const uint8_t **payload


/** /**
* @brief Read request payload data * @brief Read request payload data
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[out] data Buffer into which received data will be placed * @param[out] data Buffer into which received data will be placed
* @param[in] size Maximum number of bytes that can be received * @param[in] size Maximum number of bytes that can be received
* @param[out] length Number of bytes that have been received * @param[out] length Number of bytes that have been received
Expand All @@ -211,7 +211,7 @@ error_t coapServerReadPayload(CoapServerContext *context, void *data, size_t siz


/** /**
* @brief Set response method * @brief Set response method
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] code Response code * @param[in] code Response code
* @return Error code * @return Error code
**/ **/
Expand All @@ -229,7 +229,7 @@ error_t coapServerSetResponseCode(CoapServerContext *context, CoapCode code)


/** /**
* @brief Set Location-Path option * @brief Set Location-Path option
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] path NULL-terminated string that contains the path component * @param[in] path NULL-terminated string that contains the path component
* @return Error code * @return Error code
**/ **/
Expand All @@ -249,7 +249,7 @@ error_t coapServerSetLocationPath(CoapServerContext *context,


/** /**
* @brief Set Location-Query option * @brief Set Location-Query option
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] queryString NULL-terminated string that contains the query string * @param[in] queryString NULL-terminated string that contains the query string
* @return Error code * @return Error code
**/ **/
Expand All @@ -269,7 +269,7 @@ error_t coapServerSetLocationQuery(CoapServerContext *context,


/** /**
* @brief Add an opaque option to the CoAP response * @brief Add an opaque option to the CoAP response
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number * @param[in] optionNum Option number
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[in] optionValue Pointer to the first byte of the option value * @param[in] optionValue Pointer to the first byte of the option value
Expand All @@ -296,7 +296,7 @@ error_t coapServerSetOpaqueOption(CoapServerContext *context, uint16_t optionNum


/** /**
* @brief Add a string option to the CoAP response * @brief Add a string option to the CoAP response
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number * @param[in] optionNum Option number
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[in] optionValue NULL-terminated string that contains the option value * @param[in] optionValue NULL-terminated string that contains the option value
Expand All @@ -323,7 +323,7 @@ error_t coapServerSetStringOption(CoapServerContext *context, uint16_t optionNum


/** /**
* @brief Add a uint option to the CoAP response * @brief Add a uint option to the CoAP response
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number * @param[in] optionNum Option number
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @param[in] optionValue Option value (unsigned integer) * @param[in] optionValue Option value (unsigned integer)
Expand All @@ -345,7 +345,7 @@ error_t coapServerSetUintOption(CoapServerContext *context, uint16_t optionNum,


/** /**
* @brief Remove an option from the CoAP response * @brief Remove an option from the CoAP response
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] optionNum Option number * @param[in] optionNum Option number
* @param[in] optionIndex Occurrence index (for repeatable options only) * @param[in] optionIndex Occurrence index (for repeatable options only)
* @return Error code * @return Error code
Expand All @@ -365,7 +365,7 @@ error_t coapServerDeleteOption(CoapServerContext *context, uint16_t optionNum,


/** /**
* @brief Set response payload * @brief Set response payload
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[out] payload Pointer to request payload * @param[out] payload Pointer to request payload
* @param[out] payloadLen Length of the payload, in bytes * @param[out] payloadLen Length of the payload, in bytes
* @return Error code * @return Error code
Expand All @@ -389,7 +389,7 @@ error_t coapServerSetPayload(CoapServerContext *context, const void *payload,


/** /**
* @brief Write payload data * @brief Write payload data
* @param[in] message Pointer to the CoAP message * @param[in] context Pointer to the CoAP server context
* @param[in] data Pointer to a buffer containing the data to be written * @param[in] data Pointer to a buffer containing the data to be written
* @param[in] length Number of bytes to written * @param[in] length Number of bytes to written
* @return Error code * @return Error code
Expand Down
4 changes: 2 additions & 2 deletions coap/coap_server_request.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_SERVER_REQUEST_H #ifndef _COAP_SERVER_REQUEST_H
Expand Down
15 changes: 8 additions & 7 deletions coap/coap_server_transport.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -411,11 +411,11 @@ error_t coapServerReceiveCallback(void *handle, void *data,


/** /**
* @brief DTLS cookie generation callback function * @brief DTLS cookie generation callback function
* @param[in] context Pointer to the TLS context * @param[in] context Pointer to the DTLS context
* @param[in] clientParams Client parameters * @param[in] clientParams Client's parameters
* @param[out] cookie Pointer to the first byte of the cookie * @param[out] cookie Pointer to the first byte of the cookie
* @param[in,out] length Length of the cookie, in bytes * @param[in,out] length Length of the cookie, in bytes
* @param[in] param An opaque pointer provided by the user * @param[in] param Pointer to the DTLS session
* @return Error code * @return Error code
**/ **/


Expand Down Expand Up @@ -480,10 +480,11 @@ error_t coapServerCookieGenerateCallback(TlsContext *context,


/** /**
* @brief DTLS cookie verification callback function * @brief DTLS cookie verification callback function
* @param[in] handle An opaque pointer specified by the user * @param[in] context Pointer to the DTLS context
* @param[in] params Client parameters * @param[in] clientParams Client's parameters
* @param[in] cookie Pointer to the first byte of the cookie * @param[in] cookie Pointer to the first byte of the cookie
* @param[in] length Length of the cookie, in bytes * @param[in] length Length of the cookie, in bytes
* @param[in] param Pointer to the DTLS session
* @return Error code * @return Error code
**/ **/


Expand Down
4 changes: 2 additions & 2 deletions coap/coap_server_transport.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _COAP_SERVER_TRANSPORT_H #ifndef _COAP_SERVER_TRANSPORT_H
Expand Down
5 changes: 2 additions & 3 deletions core/bsd_socket.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -1915,7 +1915,6 @@ int_t selectFdIsSet(fd_set *fds, int_t s)
/** /**
* @brief Host name resolution * @brief Host name resolution
* @param[in] name Name of the host to resolve * @param[in] name Name of the host to resolve
* @param[out] info Address of the specified host
* @return Pointer to the hostent structure or a NULL if an error occurs * @return Pointer to the hostent structure or a NULL if an error occurs
**/ **/


Expand Down
4 changes: 2 additions & 2 deletions core/bsd_socket.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _BSD_SOCKET_H #ifndef _BSD_SOCKET_H
Expand Down
4 changes: 2 additions & 2 deletions core/ethernet.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
7 changes: 4 additions & 3 deletions core/ethernet.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _ETHERNET_H #ifndef _ETHERNET_H
Expand Down Expand Up @@ -158,7 +158,8 @@ typedef enum
ETH_TYPE_VLAN = 0x8100, ETH_TYPE_VLAN = 0x8100,
ETH_TYPE_IPV6 = 0x86DD, ETH_TYPE_IPV6 = 0x86DD,
ETH_TYPE_EAPOL = 0x888E, ETH_TYPE_EAPOL = 0x888E,
ETH_TYPE_VMAN = 0x88A8 ETH_TYPE_VMAN = 0x88A8,
ETH_TYPE_LLDP = 0x88CC
} EthType; } EthType;




Expand Down
4 changes: 2 additions & 2 deletions core/ethernet_misc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/ethernet_misc.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _ETHERNET_MISC_H #ifndef _ETHERNET_MISC_H
Expand Down
8 changes: 4 additions & 4 deletions core/ip.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -686,7 +686,7 @@ error_t ipStringToAddr(const char_t *str, IpAddr *ipAddr)


#if (IPV6_SUPPORT == ENABLED) #if (IPV6_SUPPORT == ENABLED)
//IPv6 address? //IPv6 address?
if(strchr(str, ':')) if(osStrchr(str, ':') != NULL)
{ {
//IPv6 addresses are 16-byte long //IPv6 addresses are 16-byte long
ipAddr->length = sizeof(Ipv6Addr); ipAddr->length = sizeof(Ipv6Addr);
Expand All @@ -697,7 +697,7 @@ error_t ipStringToAddr(const char_t *str, IpAddr *ipAddr)
#endif #endif
#if (IPV4_SUPPORT == ENABLED) #if (IPV4_SUPPORT == ENABLED)
//IPv4 address? //IPv4 address?
if(strchr(str, '.')) if(osStrchr(str, '.') != NULL)
{ {
//IPv4 addresses are 4-byte long //IPv4 addresses are 4-byte long
ipAddr->length = sizeof(Ipv4Addr); ipAddr->length = sizeof(Ipv4Addr);
Expand Down
4 changes: 2 additions & 2 deletions core/ip.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _IP_H #ifndef _IP_H
Expand Down
4 changes: 2 additions & 2 deletions core/net.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
8 changes: 4 additions & 4 deletions core/net.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _NET_H #ifndef _NET_H
Expand Down Expand Up @@ -90,13 +90,13 @@ struct _NetInterface;
#endif #endif


//Version string //Version string
#define CYCLONE_TCP_VERSION_STRING "2.0.0" #define CYCLONE_TCP_VERSION_STRING "2.0.2"
//Major version //Major version
#define CYCLONE_TCP_MAJOR_VERSION 2 #define CYCLONE_TCP_MAJOR_VERSION 2
//Minor version //Minor version
#define CYCLONE_TCP_MINOR_VERSION 0 #define CYCLONE_TCP_MINOR_VERSION 0
//Revision number //Revision number
#define CYCLONE_TCP_REV_NUMBER 0 #define CYCLONE_TCP_REV_NUMBER 2


//RTOS support //RTOS support
#ifndef NET_RTOS_SUPPORT #ifndef NET_RTOS_SUPPORT
Expand Down
4 changes: 2 additions & 2 deletions core/net_legacy.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _NET_LEGACY_H #ifndef _NET_LEGACY_H
Expand Down
4 changes: 2 additions & 2 deletions core/net_mem.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/net_mem.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _NET_MEM_H #ifndef _NET_MEM_H
Expand Down
4 changes: 2 additions & 2 deletions core/net_misc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/net_misc.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _NET_MISC_H #ifndef _NET_MISC_H
Expand Down
10 changes: 5 additions & 5 deletions core/nic.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -283,9 +283,6 @@ error_t nicSendPacket(NetInterface *interface, const NetBuffer *buffer,
error_t error; error_t error;
bool_t status; bool_t status;


//Gather entropy
netContext.entropy += netGetSystemTickCount();

#if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG) #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
//Retrieve the length of the packet //Retrieve the length of the packet
size_t length = netBufferGetLength(buffer) - offset; size_t length = netBufferGetLength(buffer) - offset;
Expand All @@ -295,6 +292,9 @@ error_t nicSendPacket(NetInterface *interface, const NetBuffer *buffer,
TRACE_DEBUG_NET_BUFFER(" ", buffer, offset, length); TRACE_DEBUG_NET_BUFFER(" ", buffer, offset, length);
#endif #endif


//Gather entropy
netContext.entropy += netGetSystemTickCount();

//Check whether the interface is enabled for operation //Check whether the interface is enabled for operation
if(interface->configured && interface->nicDriver != NULL) if(interface->configured && interface->nicDriver != NULL)
{ {
Expand Down
4 changes: 2 additions & 2 deletions core/nic.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _NIC_H #ifndef _NIC_H
Expand Down
4 changes: 2 additions & 2 deletions core/ping.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/ping.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _PING_H #ifndef _PING_H
Expand Down
41 changes: 28 additions & 13 deletions core/raw_socket.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -30,7 +30,7 @@
* underlying transport provider * underlying transport provider
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -246,6 +246,8 @@ error_t rawSocketProcessIpPacket(NetInterface *interface,


//Initialize next field //Initialize next field
queueItem->next = NULL; queueItem->next = NULL;
//Network interface where the packet was received
queueItem->interface = interface;
//Port number is unused //Port number is unused
queueItem->srcPort = 0; queueItem->srcPort = 0;


Expand Down Expand Up @@ -426,6 +428,9 @@ void rawSocketProcessEthPacket(NetInterface *interface, EthHeader *header,


//Initialize next field //Initialize next field
queueItem->next = NULL; queueItem->next = NULL;
//Network interface where the packet was received
queueItem->interface = interface;

//Other fields are meaningless //Other fields are meaningless
queueItem->srcPort = 0; queueItem->srcPort = 0;
queueItem->srcIpAddr = IP_ADDR_ANY; queueItem->srcIpAddr = IP_ADDR_ANY;
Expand Down Expand Up @@ -468,8 +473,15 @@ error_t rawSocketSendIpPacket(Socket *socket, const SocketMsg *message,
IpPseudoHeader pseudoHeader; IpPseudoHeader pseudoHeader;
NetTxAncillary ancillary; NetTxAncillary ancillary;


//The socket may be bound to a particular network interface //Select the relevant network interface
interface = socket->interface; if(message->interface != NULL)
{
interface = message->interface;
}
else
{
interface = socket->interface;
}


//Allocate a buffer memory to hold the raw IP datagram //Allocate a buffer memory to hold the raw IP datagram
buffer = ipAllocBuffer(0, &offset); buffer = ipAllocBuffer(0, &offset);
Expand Down Expand Up @@ -635,7 +647,11 @@ error_t rawSocketSendEthPacket(Socket *socket, const SocketMsg *message,
NetInterface *interface; NetInterface *interface;


//Select the relevant network interface //Select the relevant network interface
if(socket->interface != NULL) if(message->interface != NULL)
{
interface = message->interface;
}
else if(socket->interface != NULL)
{ {
interface = socket->interface; interface = socket->interface;
} }
Expand Down Expand Up @@ -751,11 +767,7 @@ error_t rawSocketSendEthPacket(Socket *socket, const SocketMsg *message,
/** /**
* @brief Receive an IP packet from a raw socket * @brief Receive an IP packet from a raw socket
* @param[in] socket Handle referencing the socket * @param[in] socket Handle referencing the socket
* @param[out] srcIpAddr Source IP address (optional) * @param[out] message Received IP packet and ancillary data
* @param[out] destIpAddr Destination IP address (optional)
* @param[out] data Buffer where to store the incoming data
* @param[in] size Maximum number of bytes that can be received
* @param[out] received Number of bytes that have been received
* @param[in] flags Set of flags that influences the behavior of this function * @param[in] flags Set of flags that influences the behavior of this function
* @return Error code * @return Error code
**/ **/
Expand Down Expand Up @@ -797,6 +809,8 @@ error_t rawSocketReceiveIpPacket(Socket *socket, SocketMsg *message,
message->length = netBufferRead(message->data, queueItem->buffer, message->length = netBufferRead(message->data, queueItem->buffer,
queueItem->offset, message->size); queueItem->offset, message->size);


//Network interface where the packet was received
message->interface = queueItem->interface;
//Save the source IP address //Save the source IP address
message->srcIpAddr = queueItem->srcIpAddr; message->srcIpAddr = queueItem->srcIpAddr;
//Save the source port number //Save the source port number
Expand Down Expand Up @@ -857,9 +871,7 @@ error_t rawSocketReceiveIpPacket(Socket *socket, SocketMsg *message,
/** /**
* @brief Receive an Ethernet packet from a raw socket * @brief Receive an Ethernet packet from a raw socket
* @param[in] socket Handle referencing the socket * @param[in] socket Handle referencing the socket
* @param[out] data Buffer where to store the incoming data * @param[out] message Received Ethernet packet and ancillary data
* @param[in] size Maximum number of bytes that can be received
* @param[out] received Number of bytes that have been received
* @param[in] flags Set of flags that influences the behavior of this function * @param[in] flags Set of flags that influences the behavior of this function
* @return Error code * @return Error code
**/ **/
Expand Down Expand Up @@ -901,6 +913,9 @@ error_t rawSocketReceiveEthPacket(Socket *socket, SocketMsg *message,
message->length = netBufferRead(message->data, queueItem->buffer, message->length = netBufferRead(message->data, queueItem->buffer,
queueItem->offset, message->size); queueItem->offset, message->size);


//Network interface where the packet was received
message->interface = queueItem->interface;

#if (ETH_SUPPORT == ENABLED) #if (ETH_SUPPORT == ENABLED)
//Save source and destination MAC addresses //Save source and destination MAC addresses
message->srcMacAddr = queueItem->ancillary.srcMacAddr; message->srcMacAddr = queueItem->ancillary.srcMacAddr;
Expand Down
4 changes: 2 additions & 2 deletions core/raw_socket.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _RAW_SOCKET_H #ifndef _RAW_SOCKET_H
Expand Down
9 changes: 5 additions & 4 deletions core/socket.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -55,6 +55,7 @@ const SocketMsg SOCKET_DEFAULT_MSG =
0, //Size of the payload, in bytes 0, //Size of the payload, in bytes
0, //Actual length of the payload, in bytes 0, //Actual length of the payload, in bytes
0, //Time-to-live value 0, //Time-to-live value
NULL, //Underlying network interface
{0}, //Source IP address {0}, //Source IP address
0, //Source port 0, //Source port
{0}, //Destination IP address {0}, //Destination IP address
Expand Down Expand Up @@ -1603,14 +1604,14 @@ error_t getHostByName(NetInterface *interface,
protocol = HOST_NAME_RESOLVER_MDNS; protocol = HOST_NAME_RESOLVER_MDNS;
#endif #endif
} }
else if(n <= 15 && !strchr(name, '.') && type == HOST_TYPE_IPV4) else if(n <= 15 && !osStrchr(name, '.') && type == HOST_TYPE_IPV4)
{ {
#if (NBNS_CLIENT_SUPPORT == ENABLED) #if (NBNS_CLIENT_SUPPORT == ENABLED)
//Use NetBIOS Name Service to resolve the specified host name //Use NetBIOS Name Service to resolve the specified host name
protocol = HOST_NAME_RESOLVER_NBNS; protocol = HOST_NAME_RESOLVER_NBNS;
#endif #endif
} }
else if(!strchr(name, '.')) else if(!osStrchr(name, '.'))
{ {
#if (LLMNR_CLIENT_SUPPORT == ENABLED) #if (LLMNR_CLIENT_SUPPORT == ENABLED)
//Use LLMNR to resolve the specified host name //Use LLMNR to resolve the specified host name
Expand Down
32 changes: 17 additions & 15 deletions core/socket.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _SOCKET_H #ifndef _SOCKET_H
Expand Down Expand Up @@ -198,24 +198,25 @@ typedef enum


typedef struct typedef struct
{ {
void *data; ///<Pointer to the payload void *data; ///<Pointer to the payload
size_t size; ///<Size of the payload, in bytes size_t size; ///<Size of the payload, in bytes
size_t length; ///<Actual length of the payload, in bytes size_t length; ///<Actual length of the payload, in bytes
uint8_t ttl; ///<Time-to-live value uint8_t ttl; ///<Time-to-live value
IpAddr srcIpAddr; ///<Source IP address NetInterface *interface; ///<Underlying network interface
uint16_t srcPort; ///<Source port IpAddr srcIpAddr; ///<Source IP address
IpAddr destIpAddr; ///<Destination IP address uint16_t srcPort; ///<Source port
uint16_t destPort; ///<Destination port IpAddr destIpAddr; ///<Destination IP address
uint16_t destPort; ///<Destination port
#if (ETH_SUPPORT == ENABLED) #if (ETH_SUPPORT == ENABLED)
MacAddr srcMacAddr; ///<Source MAC address MacAddr srcMacAddr; ///<Source MAC address
MacAddr destMacAddr; ///<Destination MAC address MacAddr destMacAddr; ///<Destination MAC address
#endif #endif
#if (ETH_PORT_TAGGING_SUPPORT == ENABLED) #if (ETH_PORT_TAGGING_SUPPORT == ENABLED)
uint8_t switchPort; ///<Switch port identifier uint8_t switchPort; ///<Switch port identifier
#endif #endif
#if (ETH_TIMESTAMP_SUPPORT == ENABLED) #if (ETH_TIMESTAMP_SUPPORT == ENABLED)
int32_t timestampId; ///<Unique identifier for hardware time stamping int32_t timestampId; ///<Unique identifier for hardware time stamping
NetTimestamp timestamp; ///<Captured time stamp NetTimestamp timestamp; ///<Captured time stamp
#endif #endif
} SocketMsg; } SocketMsg;


Expand All @@ -227,6 +228,7 @@ typedef struct
typedef struct _SocketQueueItem typedef struct _SocketQueueItem
{ {
struct _SocketQueueItem *next; struct _SocketQueueItem *next;
NetInterface *interface;
IpAddr srcIpAddr; IpAddr srcIpAddr;
uint16_t srcPort; uint16_t srcPort;
IpAddr destIpAddr; IpAddr destIpAddr;
Expand Down
4 changes: 2 additions & 2 deletions core/tcp.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/tcp.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _TCP_H #ifndef _TCP_H
Expand Down
4 changes: 2 additions & 2 deletions core/tcp_fsm.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand Down Expand Up @@ -34,7 +34,7 @@
* - RFC 1122: Requirements for Internet Hosts - Communication Layers * - RFC 1122: Requirements for Internet Hosts - Communication Layers
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/tcp_fsm.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _TCP_FSM_H #ifndef _TCP_FSM_H
Expand Down
157 changes: 98 additions & 59 deletions core/tcp_misc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -341,9 +341,14 @@ error_t tcpSendResetSegment(NetInterface *interface,


//Advance the acknowledgment number over the SYN or the FIN //Advance the acknowledgment number over the SYN or the FIN
if(segment->flags & TCP_FLAG_SYN) if(segment->flags & TCP_FLAG_SYN)
{
ackNum++; ackNum++;
}

if(segment->flags & TCP_FLAG_FIN) if(segment->flags & TCP_FLAG_FIN)
{
ackNum++; ackNum++;
}
} }


//Allocate a memory buffer to hold the reset segment //Allocate a memory buffer to hold the reset segment
Expand Down Expand Up @@ -426,6 +431,7 @@ error_t tcpSendResetSegment(NetInterface *interface,
//Debug message //Debug message
TRACE_DEBUG("%s: Sending TCP reset segment...\r\n", TRACE_DEBUG("%s: Sending TCP reset segment...\r\n",
formatSystemTime(osGetSystemTime(), NULL)); formatSystemTime(osGetSystemTime(), NULL));

//Dump TCP header contents for debugging purpose //Dump TCP header contents for debugging purpose
tcpDumpHeader(segment2, length, 0, 0); tcpDumpHeader(segment2, length, 0, 0);


Expand Down Expand Up @@ -456,40 +462,55 @@ error_t tcpSendResetSegment(NetInterface *interface,
error_t tcpAddOption(TcpHeader *segment, uint8_t kind, const void *value, error_t tcpAddOption(TcpHeader *segment, uint8_t kind, const void *value,
uint8_t length) uint8_t length)
{ {
uint_t i; error_t error;
size_t i;
size_t paddingSize; size_t paddingSize;
TcpOption *option; TcpOption *option;


//Length of the complete option field //The option-length counts the two octets of option-kind and option-length
//as well as the option-data octets (refer to RFC 793, section 3.1)
length += sizeof(TcpOption); length += sizeof(TcpOption);


//Make sure there is enough space to add the specified option //Make sure there is enough room to add the option
if((segment->dataOffset * 4 + length) > TCP_MAX_HEADER_LENGTH) if((segment->dataOffset * 4 + length) <= TCP_MAX_HEADER_LENGTH)
return ERROR_FAILURE; {
//Index of the first available byte
i = (segment->dataOffset * 4) - sizeof(TcpHeader);


//Index of the first available byte //Calculate the number of padding bytes
i = segment->dataOffset * 4 - sizeof(TcpHeader); paddingSize = (length % 4) ? 4 - (length % 4) : 0;


//Calculate the number of padding bytes //Write padding bytes
paddingSize = (length % 4) ? 4 - (length % 4) : 0; while(paddingSize--)
//Write padding bytes {
while(paddingSize--) segment->options[i++] = TCP_OPTION_NOP;
segment->options[i++] = TCP_OPTION_NOP; }


//Point to the current location //Point to the current location
option = (TcpOption *) (segment->options + i); option = (TcpOption *) (segment->options + i);
//Write specified option
option->kind = kind;
option->length = length;
osMemcpy(option->value, value, length - sizeof(TcpOption));
//Adjust index value
i += length;


//Update TCP header length //Format option
segment->dataOffset = (sizeof(TcpHeader) + i) / 4; option->kind = kind;
option->length = length;
osMemcpy(option->value, value, length - sizeof(TcpOption));


//Option successfully added //Adjust index value
return NO_ERROR; i += length;

//Update the length of the TCP header
segment->dataOffset = (sizeof(TcpHeader) + i) / 4;

//Successful processing
error = NO_ERROR;
}
else
{
//Report an error
error = ERROR_FAILURE;
}

//Return status code
return error;
} }




Expand All @@ -503,48 +524,57 @@ error_t tcpAddOption(TcpHeader *segment, uint8_t kind, const void *value,


TcpOption *tcpGetOption(TcpHeader *segment, uint8_t kind) TcpOption *tcpGetOption(TcpHeader *segment, uint8_t kind)
{ {
size_t i;
size_t length; size_t length;
uint_t i;
TcpOption *option; TcpOption *option;


//Make sure the TCP header is valid //Make sure the TCP header is valid
if(segment->dataOffset < 5) if(segment->dataOffset >= (sizeof(TcpHeader) / 4))
return NULL; {
//Compute the length of the options field
length = (segment->dataOffset * 4) - sizeof(TcpHeader);


//Compute the length of the options field //Point to the very first option
length = segment->dataOffset * 4 - sizeof(TcpHeader); i = 0;


//Point to the very first option //Loop through the list of options
i = 0; while(i < length)
{
//Point to the current option
option = (TcpOption *) (segment->options + i);


//Parse TCP options //Check option code
while(i < length) if(option->kind == TCP_OPTION_END)
{ {
//Point to the current option //This option code indicates the end of the option list
option = (TcpOption *) (segment->options + i); break;
}
else if(option->kind == TCP_OPTION_NOP)
{
//This option consists of a single octet
i++;
}
else
{
//The option code is followed by a one-byte length field
if((i + 1) >= length)
break;


//NOP option detected? //Check the length of the option
if(option->kind == TCP_OPTION_NOP) if(option->length < sizeof(TcpOption) || (i + option->length) > length)
{ break;
i++;
continue;
}
//END option detected?
if(option->kind == TCP_OPTION_END)
break;
//Check option length
if((i + 1) >= length || (i + option->length) > length)
break;


//Current option kind match the specified one? //Matching option code?
if(option->kind == kind) if(option->kind == kind)
return option; return option;


//Jump to next the next option //Jump to the next option
i += option->length; i += option->length;
}
}
} }


//Specified option code not found //The specified option code does not exist
return NULL; return NULL;
} }


Expand Down Expand Up @@ -641,10 +671,13 @@ error_t tcpCheckSeqNum(Socket *socket, TcpHeader *segment, size_t length)
//Debug message //Debug message
TRACE_WARNING("Sequence number is not acceptable!\r\n"); TRACE_WARNING("Sequence number is not acceptable!\r\n");


//If an incoming segment is not acceptable, an acknowledgment //If an incoming segment is not acceptable, an acknowledgment should
//should be sent in reply (unless the RST bit is set) //be sent in reply (unless the RST bit is set)
if(!(segment->flags & TCP_FLAG_RST)) if(!(segment->flags & TCP_FLAG_RST))
tcpSendSegment(socket, TCP_FLAG_ACK, socket->sndNxt, socket->rcvNxt, 0, FALSE); {
tcpSendSegment(socket, TCP_FLAG_ACK, socket->sndNxt, socket->rcvNxt,
0, FALSE);
}


//Return status code //Return status code
return ERROR_FAILURE; return ERROR_FAILURE;
Expand Down Expand Up @@ -1239,11 +1272,17 @@ void tcpUpdateRetransmitQueue(Socket *socket)


//Calculate the length of the TCP segment //Calculate the length of the TCP segment
if(header->flags & TCP_FLAG_SYN) if(header->flags & TCP_FLAG_SYN)
{
length = 1; length = 1;
}
else if(header->flags & TCP_FLAG_FIN) else if(header->flags & TCP_FLAG_FIN)
{
length = queueItem->length + 1; length = queueItem->length + 1;
}
else else
{
length = queueItem->length; length = queueItem->length;
}


//If an acknowledgment is received for a segment before its timer //If an acknowledgment is received for a segment before its timer
//expires, the segment is removed from the retransmission queue //expires, the segment is removed from the retransmission queue
Expand Down
4 changes: 2 additions & 2 deletions core/tcp_misc.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _TCP_MISC_H #ifndef _TCP_MISC_H
Expand Down
4 changes: 2 additions & 2 deletions core/tcp_timer.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions core/tcp_timer.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _TCP_TIMER_H #ifndef _TCP_TIMER_H
Expand Down
31 changes: 20 additions & 11 deletions core/udp.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -363,6 +363,8 @@ error_t udpProcessDatagram(NetInterface *interface, IpPseudoHeader *pseudoHeader


//Initialize next field //Initialize next field
queueItem->next = NULL; queueItem->next = NULL;
//Network interface where the packet was received
queueItem->interface = interface;
//Record the source port number //Record the source port number
queueItem->srcPort = ntohs(header->srcPort); queueItem->srcPort = ntohs(header->srcPort);


Expand Down Expand Up @@ -427,8 +429,19 @@ error_t udpSendDatagram(Socket *socket, const SocketMsg *message, uint_t flags)
error_t error; error_t error;
size_t offset; size_t offset;
NetBuffer *buffer; NetBuffer *buffer;
NetInterface *interface;
NetTxAncillary ancillary; NetTxAncillary ancillary;


//Select the relevant network interface
if(message->interface != NULL)
{
interface = message->interface;
}
else
{
interface = socket->interface;
}

//Allocate a memory buffer to hold the UDP datagram //Allocate a memory buffer to hold the UDP datagram
buffer = udpAllocBuffer(0, &offset); buffer = udpAllocBuffer(0, &offset);
//Failed to allocate buffer? //Failed to allocate buffer?
Expand Down Expand Up @@ -499,9 +512,8 @@ error_t udpSendDatagram(Socket *socket, const SocketMsg *message, uint_t flags)
#endif #endif


//Send UDP datagram //Send UDP datagram
error = udpSendBuffer(socket->interface, &message->srcIpAddr, error = udpSendBuffer(interface, &message->srcIpAddr, socket->localPort,
socket->localPort, &message->destIpAddr, message->destPort, buffer, &message->destIpAddr, message->destPort, buffer, offset, &ancillary);
offset, &ancillary);
} }


//Free previously allocated memory //Free previously allocated memory
Expand Down Expand Up @@ -678,12 +690,7 @@ error_t udpSendBuffer(NetInterface *interface, const IpAddr *srcIpAddr,
/** /**
* @brief Receive data from a UDP socket * @brief Receive data from a UDP socket
* @param[in] socket Handle referencing the socket * @param[in] socket Handle referencing the socket
* @param[out] srcIpAddr Source IP address (optional) * @param[out] message Received UDP datagram and ancillary data
* @param[out] srcPort Source port number (optional)
* @param[out] destIpAddr Destination IP address (optional)
* @param[out] data Buffer where to store the incoming data
* @param[in] size Maximum number of bytes that can be received
* @param[out] received Number of bytes that have been received
* @param[in] flags Set of flags that influences the behavior of this function * @param[in] flags Set of flags that influences the behavior of this function
* @return Error code * @return Error code
**/ **/
Expand Down Expand Up @@ -724,6 +731,8 @@ error_t udpReceiveDatagram(Socket *socket, SocketMsg *message, uint_t flags)
message->length = netBufferRead(message->data, queueItem->buffer, message->length = netBufferRead(message->data, queueItem->buffer,
queueItem->offset, message->size); queueItem->offset, message->size);


//Network interface where the packet was received
message->interface = queueItem->interface;
//Save the source IP address //Save the source IP address
message->srcIpAddr = queueItem->srcIpAddr; message->srcIpAddr = queueItem->srcIpAddr;
//Save the source port number //Save the source port number
Expand Down
4 changes: 2 additions & 2 deletions core/udp.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _UDP_H #ifndef _UDP_H
Expand Down
18 changes: 11 additions & 7 deletions dhcp/dhcp_client.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -33,7 +33,7 @@
* - RFC 4039: Rapid Commit Option for the DHCP version 4 * - RFC 4039: Rapid Commit Option for the DHCP version 4
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -1378,9 +1378,7 @@ void dhcpClientProcessMessage(NetInterface *interface,
length = netBufferGetLength(buffer) - offset; length = netBufferGetLength(buffer) - offset;


//Make sure the DHCP message is valid //Make sure the DHCP message is valid
if(length < sizeof(DhcpMessage)) if(length < sizeof(DhcpMessage) || length > DHCP_MAX_MSG_SIZE)
return;
if(length > DHCP_MAX_MSG_SIZE)
return; return;


//Point to the beginning of the DHCP message //Point to the beginning of the DHCP message
Expand All @@ -1399,12 +1397,15 @@ void dhcpClientProcessMessage(NetInterface *interface,
//The DHCP server shall respond with a BOOTREPLY opcode //The DHCP server shall respond with a BOOTREPLY opcode
if(message->op != DHCP_OPCODE_BOOTREPLY) if(message->op != DHCP_OPCODE_BOOTREPLY)
return; return;

//Enforce hardware type //Enforce hardware type
if(message->htype != DHCP_HARDWARE_TYPE_ETH) if(message->htype != DHCP_HARDWARE_TYPE_ETH)
return; return;

//Check the length of the hardware address //Check the length of the hardware address
if(message->hlen != sizeof(MacAddr)) if(message->hlen != sizeof(MacAddr))
return; return;

//Check magic cookie //Check magic cookie
if(message->magicCookie != HTONL(DHCP_MAGIC_COOKIE)) if(message->magicCookie != HTONL(DHCP_MAGIC_COOKIE))
return; return;
Expand Down Expand Up @@ -1460,9 +1461,11 @@ void dhcpClientParseOffer(DhcpClientContext *context,
//Discard any received packet that does not match the transaction ID //Discard any received packet that does not match the transaction ID
if(ntohl(message->xid) != context->transactionId) if(ntohl(message->xid) != context->transactionId)
return; return;

//Make sure the IP address offered to the client is valid //Make sure the IP address offered to the client is valid
if(message->yiaddr == IPV4_UNSPECIFIED_ADDR) if(message->yiaddr == IPV4_UNSPECIFIED_ADDR)
return; return;

//Check MAC address //Check MAC address
if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr)) if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr))
return; return;
Expand Down Expand Up @@ -1494,7 +1497,6 @@ void dhcpClientParseOffer(DhcpClientContext *context,
* @param[in] context Pointer to the DHCP client context * @param[in] context Pointer to the DHCP client context
* @param[in] message Pointer to the incoming DHCP message * @param[in] message Pointer to the incoming DHCP message
* @param[in] length Length of the incoming message to parse * @param[in] length Length of the incoming message to parse
* @return Error code
**/ **/


void dhcpClientParseAck(DhcpClientContext *context, void dhcpClientParseAck(DhcpClientContext *context,
Expand Down Expand Up @@ -1522,9 +1524,11 @@ void dhcpClientParseAck(DhcpClientContext *context,
//Discard any received packet that does not match the transaction ID //Discard any received packet that does not match the transaction ID
if(ntohl(message->xid) != context->transactionId) if(ntohl(message->xid) != context->transactionId)
return; return;

//Make sure the IP address assigned to the client is valid //Make sure the IP address assigned to the client is valid
if(message->yiaddr == IPV4_UNSPECIFIED_ADDR) if(message->yiaddr == IPV4_UNSPECIFIED_ADDR)
return; return;

//Check MAC address //Check MAC address
if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr)) if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr))
return; return;
Expand Down Expand Up @@ -1729,7 +1733,6 @@ void dhcpClientParseAck(DhcpClientContext *context,
* @param[in] context Pointer to the DHCP client context * @param[in] context Pointer to the DHCP client context
* @param[in] message Pointer to the incoming DHCP message * @param[in] message Pointer to the incoming DHCP message
* @param[in] length Length of the incoming message to parse * @param[in] length Length of the incoming message to parse
* @return Error code
**/ **/


void dhcpClientParseNak(DhcpClientContext *context, void dhcpClientParseNak(DhcpClientContext *context,
Expand All @@ -1751,6 +1754,7 @@ void dhcpClientParseNak(DhcpClientContext *context,
//Discard any received packet that does not match the transaction ID //Discard any received packet that does not match the transaction ID
if(ntohl(message->xid) != context->transactionId) if(ntohl(message->xid) != context->transactionId)
return; return;

//Check MAC address //Check MAC address
if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr)) if(!macCompAddr(&message->chaddr, &logicalInterface->macAddr))
return; return;
Expand Down
4 changes: 2 additions & 2 deletions dhcp/dhcp_client.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCP_CLIENT_H #ifndef _DHCP_CLIENT_H
Expand Down
78 changes: 46 additions & 32 deletions dhcp/dhcp_common.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -67,7 +67,7 @@ void dhcpAddOption(DhcpMessage *message, uint8_t optionCode,
if(option->code == DHCP_OPT_END) if(option->code == DHCP_OPT_END)
break; break;


//Jump to next the next option //Jump to the next option
n += sizeof(DhcpOption) + option->length; n += sizeof(DhcpOption) + option->length;
} }


Expand All @@ -84,7 +84,7 @@ void dhcpAddOption(DhcpMessage *message, uint8_t optionCode,
//Option value //Option value
osMemcpy(option->value, optionValue, optionLen); osMemcpy(option->value, optionValue, optionLen);


//Jump to next the next option //Jump to the next option
n += sizeof(DhcpOption) + option->length; n += sizeof(DhcpOption) + option->length;


//Point to the buffer where the option is to be written //Point to the buffer where the option is to be written
Expand All @@ -108,40 +108,54 @@ void dhcpAddOption(DhcpMessage *message, uint8_t optionCode,
DhcpOption *dhcpGetOption(const DhcpMessage *message, DhcpOption *dhcpGetOption(const DhcpMessage *message,
size_t length, uint8_t optionCode) size_t length, uint8_t optionCode)
{ {
uint_t i; size_t i;
DhcpOption *option; DhcpOption *option;


//Make sure the DHCP header is valid //Make sure the DHCP header is valid
if(length < sizeof(DhcpMessage)) if(length >= sizeof(DhcpMessage))
return NULL;
//Get the length of the options field
length -= sizeof(DhcpMessage);

//Parse DHCP options
for(i = 0; i < length; i++)
{ {
//Point to the current option //Get the length of the options field
option = (DhcpOption *) (message->options + i); length -= sizeof(DhcpMessage);


//Pad option detected? //Loop through the list of options
if(option->code == DHCP_OPT_PAD) for(i = 0; i < length; i++)
continue; {
//End option detected? //Point to the current option
if(option->code == DHCP_OPT_END) option = (DhcpOption *) (message->options + i);
break;
//Check option length //Check option code
if((i + 1) >= length || (i + 1 + option->length) >= length) if(option->code == DHCP_OPT_PAD)
break; {

//The pad option can be used to cause subsequent fields to align
//Current option code matches the specified one? //on word boundaries
if(option->code == optionCode) }
return option; else if(option->code == DHCP_OPT_END)

{
//Jump to the next option //The end option marks the end of valid information in the vendor
i += option->length + 1; //field
break;
}
else
{
//The option code is followed by a one-byte length field
if((i + 1) >= length)
break;

//Check the length of the option
if((i + sizeof(DhcpOption) + option->length) > length)
break;

//Matching option code?
if(option->code == optionCode)
return option;

//Jump to the next option
i += option->length + 1;
}
}
} }


//Specified option code not found //The specified option code does not exist
return NULL; return NULL;
} }


Expand Down
4 changes: 2 additions & 2 deletions dhcp/dhcp_common.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCP_COMMON_H #ifndef _DHCP_COMMON_H
Expand Down
4 changes: 2 additions & 2 deletions dhcp/dhcp_debug.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dhcp/dhcp_debug.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCP_DEBUG_H #ifndef _DHCP_DEBUG_H
Expand Down
8 changes: 4 additions & 4 deletions dhcp/dhcp_server.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -33,7 +33,7 @@
* - RFC 4039: Rapid Commit Option for the DHCP version 4 * - RFC 4039: Rapid Commit Option for the DHCP version 4
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -456,7 +456,7 @@ void dhcpServerParseDiscover(DhcpServerContext *context,
} }
} }


//Sucessful processing //Successful processing
error = NO_ERROR; error = NO_ERROR;
} }
else else
Expand All @@ -476,7 +476,7 @@ void dhcpServerParseDiscover(DhcpServerContext *context,
{ {
//Record IP address //Record IP address
binding->ipAddr = requestedIpAddr; binding->ipAddr = requestedIpAddr;
//Sucessful processing //Successful processing
error = NO_ERROR; error = NO_ERROR;
} }
else else
Expand Down
4 changes: 2 additions & 2 deletions dhcp/dhcp_server.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCP_SERVER_H #ifndef _DHCP_SERVER_H
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_client.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -33,7 +33,7 @@
* with the latter to obtain configuration parameters. Refer to RFC 3315 * with the latter to obtain configuration parameters. Refer to RFC 3315
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_client.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCPV6_CLIENT_H #ifndef _DHCPV6_CLIENT_H
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_common.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -33,7 +33,7 @@
* with the latter to obtain configuration parameters. Refer to RFC 3315 * with the latter to obtain configuration parameters. Refer to RFC 3315
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_common.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCPV6_COMMON_H #ifndef _DHCPV6_COMMON_H
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_debug.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_debug.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCPV6_DEBUG_H #ifndef _DHCPV6_DEBUG_H
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_relay.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -31,7 +31,7 @@
* alongside a routing function in a common node. Refer to RFC 3315 * alongside a routing function in a common node. Refer to RFC 3315
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6_relay.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DHCPV6_RELAY_H #ifndef _DHCPV6_RELAY_H
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_cache.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_cache.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DNS_CACHE_H #ifndef _DNS_CACHE_H
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_client.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_client.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DNS_CLIENT_H #ifndef _DNS_CLIENT_H
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_common.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_common.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DNS_COMMON_H #ifndef _DNS_COMMON_H
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_debug.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dns/dns_debug.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DNS_DEBUG_H #ifndef _DNS_DEBUG_H
Expand Down
4 changes: 2 additions & 2 deletions dns_sd/dns_sd.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -33,7 +33,7 @@
* - RFC 2782: A DNS RR for specifying the location of services (DNS SRV) * - RFC 2782: A DNS RR for specifying the location of services (DNS SRV)
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions dns_sd/dns_sd.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _DNS_SD_H #ifndef _DNS_SD_H
Expand Down
160 changes: 88 additions & 72 deletions drivers/eth/dm9000_driver.c

Large diffs are not rendered by default.

759 changes: 460 additions & 299 deletions drivers/eth/dm9000_driver.h

Large diffs are not rendered by default.

308 changes: 159 additions & 149 deletions drivers/eth/enc28j60_driver.c

Large diffs are not rendered by default.

683 changes: 379 additions & 304 deletions drivers/eth/enc28j60_driver.h

Large diffs are not rendered by default.

250 changes: 138 additions & 112 deletions drivers/eth/enc624j600_driver.c

Large diffs are not rendered by default.

794 changes: 443 additions & 351 deletions drivers/eth/enc624j600_driver.h

Large diffs are not rendered by default.

155 changes: 84 additions & 71 deletions drivers/eth/ksz8851_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -87,12 +87,13 @@ error_t ksz8851Init(NetInterface *interface)
interface->extIntDriver->init(); interface->extIntDriver->init();


//Debug message //Debug message
TRACE_DEBUG("CIDER=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_CIDER)); TRACE_DEBUG("CIDER=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_CIDER));
TRACE_DEBUG("PHY1ILR=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_PHY1ILR)); TRACE_DEBUG("PHY1ILR=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_PHY1ILR));
TRACE_DEBUG("PHY1IHR=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_PHY1IHR)); TRACE_DEBUG("PHY1IHR=0x%04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_PHY1IHR));


//Check device ID and revision ID //Check device ID and revision ID
if(ksz8851ReadReg(interface, KSZ8851_REG_CIDER) != KSZ8851_REV_A3_ID) if(ksz8851ReadReg(interface, KSZ8851_CIDER) != (KSZ8851_CIDER_FAMILY_ID_DEFAULT |
KSZ8851_CIDER_CHIP_ID_DEFAULT | KSZ8851_CIDER_REV_ID_A3))
{ {
return ERROR_WRONG_IDENTIFIER; return ERROR_WRONG_IDENTIFIER;
} }
Expand All @@ -119,47 +120,56 @@ error_t ksz8851Init(NetInterface *interface)
} }


//Initialize MAC address //Initialize MAC address
ksz8851WriteReg(interface, KSZ8851_REG_MARH, htons(interface->macAddr.w[0])); ksz8851WriteReg(interface, KSZ8851_MARH, htons(interface->macAddr.w[0]));
ksz8851WriteReg(interface, KSZ8851_REG_MARM, htons(interface->macAddr.w[1])); ksz8851WriteReg(interface, KSZ8851_MARM, htons(interface->macAddr.w[1]));
ksz8851WriteReg(interface, KSZ8851_REG_MARL, htons(interface->macAddr.w[2])); ksz8851WriteReg(interface, KSZ8851_MARL, htons(interface->macAddr.w[2]));

//Packets shorter than 64 bytes are padded and the CRC is automatically
//generated
ksz8851WriteReg(interface, KSZ8851_TXCR, KSZ8851_TXCR_TXFCE |
KSZ8851_TXCR_TXPE | KSZ8851_TXCR_TXCE);


//Packets shorter than 64 bytes are padded and the CRC is automatically generated
ksz8851WriteReg(interface, KSZ8851_REG_TXCR, TXCR_TXFCE | TXCR_TXPE | TXCR_TXCE);
//Automatically increment TX data pointer //Automatically increment TX data pointer
ksz8851WriteReg(interface, KSZ8851_REG_TXFDPR, TXFDPR_TXFPAI); ksz8851WriteReg(interface, KSZ8851_TXFDPR, KSZ8851_TXFDPR_TXFPAI);


//Configure address filtering //Configure address filtering
ksz8851WriteReg(interface, KSZ8851_REG_RXCR1, ksz8851WriteReg(interface, KSZ8851_RXCR1, KSZ8851_RXCR1_RXPAFMA |
RXCR1_RXPAFMA | RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXME | RXCR1_RXUE); KSZ8851_RXCR1_RXFCE | KSZ8851_RXCR1_RXBE | KSZ8851_RXCR1_RXME |
KSZ8851_RXCR1_RXUE);


//No checksum verification //No checksum verification
ksz8851WriteReg(interface, KSZ8851_REG_RXCR2, ksz8851WriteReg(interface, KSZ8851_RXCR2, KSZ8851_RXCR2_SRDBL_SINGLE_FRAME |
RXCR2_SRDBL2 | RXCR2_IUFFP | RXCR2_RXIUFCEZ); KSZ8851_RXCR2_IUFFP | KSZ8851_RXCR2_RXIUFCEZ);


//Enable automatic RXQ frame buffer dequeue //Enable automatic RXQ frame buffer dequeue
ksz8851WriteReg(interface, KSZ8851_REG_RXQCR, RXQCR_RXFCTE | RXQCR_ADRFE); ksz8851WriteReg(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_RXFCTE |
KSZ8851_RXQCR_ADRFE);

//Automatically increment RX data pointer //Automatically increment RX data pointer
ksz8851WriteReg(interface, KSZ8851_REG_RXFDPR, RXFDPR_RXFPAI); ksz8851WriteReg(interface, KSZ8851_RXFDPR, KSZ8851_RXFDPR_RXFPAI);
//Configure receive frame count threshold //Configure receive frame count threshold
ksz8851WriteReg(interface, KSZ8851_REG_RXFCTR, 1); ksz8851WriteReg(interface, KSZ8851_RXFCTR, 1);


//Force link in half-duplex if auto-negotiation failed //Force link in half-duplex if auto-negotiation failed
ksz8851ClearBit(interface, KSZ8851_REG_P1CR, P1CR_FORCE_DUPLEX); ksz8851ClearBit(interface, KSZ8851_P1CR, KSZ8851_P1CR_FORCE_DUPLEX);
//Restart auto-negotiation //Restart auto-negotiation
ksz8851SetBit(interface, KSZ8851_REG_P1CR, P1CR_RESTART_AN); ksz8851SetBit(interface, KSZ8851_P1CR, KSZ8851_P1CR_RESTART_AN);


//Clear interrupt flags //Clear interrupt flags
ksz8851SetBit(interface, KSZ8851_REG_ISR, ISR_LCIS | ISR_TXIS | ksz8851SetBit(interface, KSZ8851_ISR, KSZ8851_ISR_LCIS |
ISR_RXIS | ISR_RXOIS | ISR_TXPSIS | ISR_RXPSIS | ISR_TXSAIS | KSZ8851_ISR_TXIS | KSZ8851_ISR_RXIS | KSZ8851_ISR_RXOIS |
ISR_RXWFDIS | ISR_RXMPDIS | ISR_LDIS | ISR_EDIS | ISR_SPIBEIS); KSZ8851_ISR_TXPSIS | KSZ8851_ISR_RXPSIS | KSZ8851_ISR_TXSAIS |
KSZ8851_ISR_RXWFDIS | KSZ8851_ISR_RXMPDIS | KSZ8851_ISR_LDIS |
KSZ8851_ISR_EDIS | KSZ8851_ISR_SPIBEIS);


//Configure interrupts as desired //Configure interrupts as desired
ksz8851SetBit(interface, KSZ8851_REG_IER, IER_LCIE | IER_TXIE | IER_RXIE); ksz8851SetBit(interface, KSZ8851_IER, KSZ8851_IER_LCIE |
KSZ8851_IER_TXIE | KSZ8851_IER_RXIE);


//Enable TX operation //Enable TX operation
ksz8851SetBit(interface, KSZ8851_REG_TXCR, TXCR_TXE); ksz8851SetBit(interface, KSZ8851_TXCR, KSZ8851_TXCR_TXE);
//Enable RX operation //Enable RX operation
ksz8851SetBit(interface, KSZ8851_REG_RXCR1, RXCR1_RXE); ksz8851SetBit(interface, KSZ8851_RXCR1, KSZ8851_RXCR1_RXE);


//Accept any packets from the upper layer //Accept any packets from the upper layer
osSetEvent(&interface->nicTxEvent); osSetEvent(&interface->nicTxEvent);
Expand Down Expand Up @@ -225,18 +235,18 @@ bool_t ksz8851IrqHandler(NetInterface *interface)
flag = FALSE; flag = FALSE;


//Save IER register value //Save IER register value
ier = ksz8851ReadReg(interface, KSZ8851_REG_IER); ier = ksz8851ReadReg(interface, KSZ8851_IER);
//Disable interrupts to release the interrupt line //Disable interrupts to release the interrupt line
ksz8851WriteReg(interface, KSZ8851_REG_IER, 0); ksz8851WriteReg(interface, KSZ8851_IER, 0);


//Read interrupt status register //Read interrupt status register
isr = ksz8851ReadReg(interface, KSZ8851_REG_ISR); isr = ksz8851ReadReg(interface, KSZ8851_ISR);


//Link status change? //Link status change?
if((isr & ISR_LCIS) != 0) if((isr & KSZ8851_ISR_LCIS) != 0)
{ {
//Disable LCIE interrupt //Disable LCIE interrupt
ier &= ~IER_LCIE; ier &= ~KSZ8851_IER_LCIE;


//Set event flag //Set event flag
interface->nicEvent = TRUE; interface->nicEvent = TRUE;
Expand All @@ -245,13 +255,13 @@ bool_t ksz8851IrqHandler(NetInterface *interface)
} }


//Packet transmission complete? //Packet transmission complete?
if((isr & ISR_TXIS) != 0) if((isr & KSZ8851_ISR_TXIS) != 0)
{ {
//Clear interrupt flag //Clear interrupt flag
ksz8851WriteReg(interface, KSZ8851_REG_ISR, ISR_TXIS); ksz8851WriteReg(interface, KSZ8851_ISR, KSZ8851_ISR_TXIS);


//Get the amount of free memory available in the TX FIFO //Get the amount of free memory available in the TX FIFO
n = ksz8851ReadReg(interface, KSZ8851_REG_TXMIR) & TXMIR_TXMA_MASK; n = ksz8851ReadReg(interface, KSZ8851_TXMIR) & KSZ8851_TXMIR_TXMA;


//Check whether the TX FIFO is available for writing //Check whether the TX FIFO is available for writing
if(n >= (ETH_MAX_FRAME_SIZE + 8)) if(n >= (ETH_MAX_FRAME_SIZE + 8))
Expand All @@ -262,10 +272,10 @@ bool_t ksz8851IrqHandler(NetInterface *interface)
} }


//Packet received? //Packet received?
if((isr & ISR_RXIS) != 0) if((isr & KSZ8851_ISR_RXIS) != 0)
{ {
//Disable RXIE interrupt //Disable RXIE interrupt
ier &= ~IER_RXIE; ier &= ~KSZ8851_IER_RXIE;


//Set event flag //Set event flag
interface->nicEvent = TRUE; interface->nicEvent = TRUE;
Expand All @@ -274,7 +284,7 @@ bool_t ksz8851IrqHandler(NetInterface *interface)
} }


//Re-enable interrupts once the interrupt has been serviced //Re-enable interrupts once the interrupt has been serviced
ksz8851WriteReg(interface, KSZ8851_REG_IER, ier); ksz8851WriteReg(interface, KSZ8851_IER, ier);


//A higher priority task must be woken? //A higher priority task must be woken?
return flag; return flag;
Expand All @@ -292,21 +302,21 @@ void ksz8851EventHandler(NetInterface *interface)
uint_t frameCount; uint_t frameCount;


//Read interrupt status register //Read interrupt status register
status = ksz8851ReadReg(interface, KSZ8851_REG_ISR); status = ksz8851ReadReg(interface, KSZ8851_ISR);


//Check whether the link status has changed? //Check whether the link status has changed?
if((status & ISR_LCIS) != 0) if((status & KSZ8851_ISR_LCIS) != 0)
{ {
//Clear interrupt flag //Clear interrupt flag
ksz8851WriteReg(interface, KSZ8851_REG_ISR, ISR_LCIS); ksz8851WriteReg(interface, KSZ8851_ISR, KSZ8851_ISR_LCIS);
//Read PHY status register //Read PHY status register
status = ksz8851ReadReg(interface, KSZ8851_REG_P1SR); status = ksz8851ReadReg(interface, KSZ8851_P1SR);


//Check link state //Check link state
if((status & P1SR_LINK_GOOD) != 0) if((status & KSZ8851_P1SR_LINK_GOOD) != 0)
{ {
//Get current speed //Get current speed
if((status & P1SR_OPERATION_SPEED) != 0) if((status & KSZ8851_P1SR_OPERATION_SPEED) != 0)
{ {
interface->linkSpeed = NIC_LINK_SPEED_100MBPS; interface->linkSpeed = NIC_LINK_SPEED_100MBPS;
} }
Expand All @@ -316,7 +326,7 @@ void ksz8851EventHandler(NetInterface *interface)
} }


//Determine the new duplex mode //Determine the new duplex mode
if((status & P1SR_OPERATION_DUPLEX) != 0) if((status & KSZ8851_P1SR_OPERATION_DUPLEX) != 0)
{ {
interface->duplexMode = NIC_FULL_DUPLEX_MODE; interface->duplexMode = NIC_FULL_DUPLEX_MODE;
} }
Expand All @@ -339,12 +349,12 @@ void ksz8851EventHandler(NetInterface *interface)
} }


//Check whether a packet has been received? //Check whether a packet has been received?
if((status & ISR_RXIS) != 0) if((status & KSZ8851_ISR_RXIS) != 0)
{ {
//Clear interrupt flag //Clear interrupt flag
ksz8851WriteReg(interface, KSZ8851_REG_ISR, ISR_RXIS); ksz8851WriteReg(interface, KSZ8851_ISR, KSZ8851_ISR_RXIS);
//Get the total number of frames that are pending in the buffer //Get the total number of frames that are pending in the buffer
frameCount = MSB(ksz8851ReadReg(interface, KSZ8851_REG_RXFCTR)); frameCount = MSB(ksz8851ReadReg(interface, KSZ8851_RXFCTR));


//Process all pending packets //Process all pending packets
while(frameCount > 0) while(frameCount > 0)
Expand All @@ -357,7 +367,7 @@ void ksz8851EventHandler(NetInterface *interface)
} }


//Re-enable LCIE and RXIE interrupts //Re-enable LCIE and RXIE interrupts
ksz8851SetBit(interface, KSZ8851_REG_IER, IER_LCIE | IER_RXIE); ksz8851SetBit(interface, KSZ8851_IER, KSZ8851_IER_LCIE | KSZ8851_IER_RXIE);
} }




Expand Down Expand Up @@ -395,7 +405,7 @@ error_t ksz8851SendPacket(NetInterface *interface,
} }


//Get the amount of free memory available in the TX FIFO //Get the amount of free memory available in the TX FIFO
n = ksz8851ReadReg(interface, KSZ8851_REG_TXMIR) & TXMIR_TXMA_MASK; n = ksz8851ReadReg(interface, KSZ8851_TXMIR) & KSZ8851_TXMIR_TXMA;


//Make sure the TX FIFO is available for writing //Make sure the TX FIFO is available for writing
if(n < (length + 8)) if(n < (length + 8))
Expand All @@ -407,24 +417,26 @@ error_t ksz8851SendPacket(NetInterface *interface,
netBufferRead(context->txBuffer, buffer, offset, length); netBufferRead(context->txBuffer, buffer, offset, length);


//Format control word //Format control word
header.controlWord = htole16(TX_CTRL_TXIC | (context->frameId++ & TX_CTRL_TXFID)); header.controlWord = htole16(KSZ8851_TX_CTRL_TXIC |
(context->frameId++ & KSZ8851_TX_CTRL_TXFID));

//Total number of bytes to be transmitted //Total number of bytes to be transmitted
header.byteCount = htole16(length); header.byteCount = htole16(length);


//Enable TXQ write access //Enable TXQ write access
ksz8851SetBit(interface, KSZ8851_REG_RXQCR, RXQCR_SDA); ksz8851SetBit(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_SDA);
//Write TX packet header //Write TX packet header
ksz8851WriteFifo(interface, (uint8_t *) &header, sizeof(Ksz8851TxHeader)); ksz8851WriteFifo(interface, (uint8_t *) &header, sizeof(Ksz8851TxHeader));
//Write data //Write data
ksz8851WriteFifo(interface, context->txBuffer, length); ksz8851WriteFifo(interface, context->txBuffer, length);
//End TXQ write access //End TXQ write access
ksz8851ClearBit(interface, KSZ8851_REG_RXQCR, RXQCR_SDA); ksz8851ClearBit(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_SDA);


//Start transmission //Start transmission
ksz8851SetBit(interface, KSZ8851_REG_TXQCR, TXQCR_METFE); ksz8851SetBit(interface, KSZ8851_TXQCR, KSZ8851_TXQCR_METFE);


//Get the amount of free memory available in the TX FIFO //Get the amount of free memory available in the TX FIFO
n = ksz8851ReadReg(interface, KSZ8851_REG_TXMIR) & TXMIR_TXMA_MASK; n = ksz8851ReadReg(interface, KSZ8851_TXMIR) & KSZ8851_TXMIR_TXMA;


//Check whether the TX FIFO is available for writing //Check whether the TX FIFO is available for writing
if(n >= (ETH_MAX_FRAME_SIZE + 8)) if(n >= (ETH_MAX_FRAME_SIZE + 8))
Expand Down Expand Up @@ -455,28 +467,29 @@ error_t ksz8851ReceivePacket(NetInterface *interface)
context = (Ksz8851Context *) interface->nicContext; context = (Ksz8851Context *) interface->nicContext;


//Read received frame status from RXFHSR //Read received frame status from RXFHSR
status = ksz8851ReadReg(interface, KSZ8851_REG_RXFHSR); status = ksz8851ReadReg(interface, KSZ8851_RXFHSR);


//Make sure the frame is valid //Make sure the frame is valid
if((status & RXFHSR_RXFV) != 0) if((status & KSZ8851_RXFHSR_RXFV) != 0)
{ {
//Check error flags //Check error flags
if((status & (RXFHSR_RXMR | RXFHSR_RXFTL | RXFHSR_RXRF | RXFHSR_RXCE)) == 0) if((status & (KSZ8851_RXFHSR_RXMR | KSZ8851_RXFHSR_RXFTL |
KSZ8851_RXFHSR_RXRF | KSZ8851_RXFHSR_RXCE)) == 0)
{ {
//Read received frame byte size from RXFHBCR //Read received frame byte size from RXFHBCR
n = ksz8851ReadReg(interface, KSZ8851_REG_RXFHBCR) & RXFHBCR_RXBC_MASK; n = ksz8851ReadReg(interface, KSZ8851_RXFHBCR) & KSZ8851_RXFHBCR_RXBC;


//Ensure the frame size is acceptable //Ensure the frame size is acceptable
if(n > 0 && n <= ETH_MAX_FRAME_SIZE) if(n > 0 && n <= ETH_MAX_FRAME_SIZE)
{ {
//Reset QMU RXQ frame pointer to zero //Reset QMU RXQ frame pointer to zero
ksz8851WriteReg(interface, KSZ8851_REG_RXFDPR, RXFDPR_RXFPAI); ksz8851WriteReg(interface, KSZ8851_RXFDPR, KSZ8851_RXFDPR_RXFPAI);
//Enable RXQ read access //Enable RXQ read access
ksz8851SetBit(interface, KSZ8851_REG_RXQCR, RXQCR_SDA); ksz8851SetBit(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_SDA);
//Read data //Read data
ksz8851ReadFifo(interface, context->rxBuffer, n); ksz8851ReadFifo(interface, context->rxBuffer, n);
//End RXQ read access //End RXQ read access
ksz8851ClearBit(interface, KSZ8851_REG_RXQCR, RXQCR_SDA); ksz8851ClearBit(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_SDA);


//Additional options can be passed to the stack along with the packet //Additional options can be passed to the stack along with the packet
ancillary = NET_DEFAULT_RX_ANCILLARY; ancillary = NET_DEFAULT_RX_ANCILLARY;
Expand All @@ -490,7 +503,7 @@ error_t ksz8851ReceivePacket(NetInterface *interface)
} }


//Release the current error frame from RXQ //Release the current error frame from RXQ
ksz8851SetBit(interface, KSZ8851_REG_RXQCR, RXQCR_RRXEF); ksz8851SetBit(interface, KSZ8851_RXQCR, KSZ8851_RXQCR_RRXEF);
//Report an error //Report an error
return ERROR_INVALID_PACKET; return ERROR_INVALID_PACKET;
} }
Expand Down Expand Up @@ -536,16 +549,16 @@ error_t ksz8851UpdateMacAddrFilter(NetInterface *interface)
} }


//Write the hash table to the KSZ8851 controller //Write the hash table to the KSZ8851 controller
ksz8851WriteReg(interface, KSZ8851_REG_MAHTR0, hashTable[0]); ksz8851WriteReg(interface, KSZ8851_MAHTR0, hashTable[0]);
ksz8851WriteReg(interface, KSZ8851_REG_MAHTR1, hashTable[1]); ksz8851WriteReg(interface, KSZ8851_MAHTR1, hashTable[1]);
ksz8851WriteReg(interface, KSZ8851_REG_MAHTR2, hashTable[2]); ksz8851WriteReg(interface, KSZ8851_MAHTR2, hashTable[2]);
ksz8851WriteReg(interface, KSZ8851_REG_MAHTR3, hashTable[3]); ksz8851WriteReg(interface, KSZ8851_MAHTR3, hashTable[3]);


//Debug message //Debug message
TRACE_DEBUG(" MAHTR0 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_MAHTR0)); TRACE_DEBUG(" MAHTR0 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_MAHTR0));
TRACE_DEBUG(" MAHTR1 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_MAHTR1)); TRACE_DEBUG(" MAHTR1 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_MAHTR1));
TRACE_DEBUG(" MAHTR2 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_MAHTR2)); TRACE_DEBUG(" MAHTR2 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_MAHTR2));
TRACE_DEBUG(" MAHTR3 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_REG_MAHTR3)); TRACE_DEBUG(" MAHTR3 = %04" PRIX16 "\r\n", ksz8851ReadReg(interface, KSZ8851_MAHTR3));


//Successful processing //Successful processing
return NO_ERROR; return NO_ERROR;
Expand Down
782 changes: 405 additions & 377 deletions drivers/eth/ksz8851_driver.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions drivers/loopback/loopback_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/loopback/loopback_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _LOOPBACK_DRIVER_H #ifndef _LOOPBACK_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/a2fxxxm3_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/a2fxxxm3_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _A2FXXXM3_ETH_DRIVER_H #ifndef _A2FXXXM3_ETH_DRIVER_H
Expand Down
12 changes: 6 additions & 6 deletions drivers/mac/am335x_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -86,7 +86,7 @@ static Am335xTxBufferDesc txBufferDesc2[AM335X_ETH_TX_BUFFER_COUNT];
#pragma location = AM335X_ETH_RAM_CPPI_SECTION #pragma location = AM335X_ETH_RAM_CPPI_SECTION
static Am335xRxBufferDesc rxBufferDesc[AM335X_ETH_RX_BUFFER_COUNT]; static Am335xRxBufferDesc rxBufferDesc[AM335X_ETH_RX_BUFFER_COUNT];


//Keil MDK-ARM or GCC compiler? //GCC compiler?
#else #else


//Transmit buffer (port 1) //Transmit buffer (port 1)
Expand Down Expand Up @@ -1804,7 +1804,7 @@ error_t am335xEthAddVlanEntry(uint_t port, uint_t vlanId)
//Add a new entry to the ALE table //Add a new entry to the ALE table
am335xEthWriteEntry(index, &entry); am335xEthWriteEntry(index, &entry);


//Sucessful processing //Successful processing
error = NO_ERROR; error = NO_ERROR;
} }
else else
Expand Down Expand Up @@ -1875,7 +1875,7 @@ error_t am335xEthAddVlanAddrEntry(uint_t port, uint_t vlanId, MacAddr *macAddr)
//Add a new entry to the ALE table //Add a new entry to the ALE table
am335xEthWriteEntry(index, &entry); am335xEthWriteEntry(index, &entry);


//Sucessful processing //Successful processing
error = NO_ERROR; error = NO_ERROR;
} }
else else
Expand Down Expand Up @@ -1917,7 +1917,7 @@ error_t am335xEthDeleteVlanAddrEntry(uint_t port, uint_t vlanId, MacAddr *macAdd
//Update the ALE table //Update the ALE table
am335xEthWriteEntry(index, &entry); am335xEthWriteEntry(index, &entry);


//Sucessful processing //Successful processing
error = NO_ERROR; error = NO_ERROR;
} }
else else
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/am335x_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _AM335X_ETH_DRIVER_H #ifndef _AM335X_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/aps3_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/aps3_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _APS3_ETH_DRIVER_H #ifndef _APS3_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/avr32_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/avr32_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _AVR32_ETH_DRIVER_H #ifndef _AVR32_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/efm32gg11_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/efm32gg11_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _EFM32GG11_ETH_DRIVER_H #ifndef _EFM32GG11_ETH_DRIVER_H
Expand Down
6 changes: 2 additions & 4 deletions drivers/mac/esp32_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -403,7 +403,6 @@ void esp32EthTick(NetInterface *interface)


void esp32EthEnableIrq(NetInterface *interface) void esp32EthEnableIrq(NetInterface *interface)
{ {

//Valid Ethernet PHY or switch driver? //Valid Ethernet PHY or switch driver?
if(interface->phyDriver != NULL) if(interface->phyDriver != NULL)
{ {
Expand All @@ -429,7 +428,6 @@ void esp32EthEnableIrq(NetInterface *interface)


void esp32EthDisableIrq(NetInterface *interface) void esp32EthDisableIrq(NetInterface *interface)
{ {

//Valid Ethernet PHY or switch driver? //Valid Ethernet PHY or switch driver?
if(interface->phyDriver != NULL) if(interface->phyDriver != NULL)
{ {
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/esp32_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _ESP32_ETH_DRIVER_H #ifndef _ESP32_ETH_DRIVER_H
Expand Down
6 changes: 3 additions & 3 deletions drivers/mac/f28m35x_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down Expand Up @@ -56,7 +56,7 @@ static uint8_t txBuffer[ETH_MAX_FRAME_SIZE + 2];
#pragma data_alignment = 4 #pragma data_alignment = 4
static uint8_t rxBuffer[ETH_MAX_FRAME_SIZE]; static uint8_t rxBuffer[ETH_MAX_FRAME_SIZE];


//Keil MDK-ARM or GCC compiler? //GCC compiler?
#else #else


//Transmit buffer //Transmit buffer
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/f28m35x_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _F28M35X_ETH_DRIVER_H #ifndef _F28M35X_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/fm4_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/fm4_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _FM4_ETH_DRIVER_H #ifndef _FM4_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/gd32f307_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/gd32f307_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _GD32F307_ETH_DRIVER_H #ifndef _GD32F307_ETH_DRIVER_H
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/lm3s_eth_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


//Switch to the appropriate trace level //Switch to the appropriate trace level
Expand Down
4 changes: 2 additions & 2 deletions drivers/mac/lm3s_eth_driver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
* *
* Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.
* *
* This file is part of CycloneTCP Open. * This file is part of CycloneTCP Open.
* *
Expand All @@ -25,7 +25,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @author Oryx Embedded SARL (www.oryx-embedded.com) * @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 2.0.0 * @version 2.0.2
**/ **/


#ifndef _LM3S_ETH_DRIVER_H #ifndef _LM3S_ETH_DRIVER_H
Expand Down
Loading