1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-24 20:29:40 +08:00
Files
FreeRTOS-Plus-TCP/source/include/FreeRTOS_DHCPv6.h
Tony Josi 4841b83def Build fix for unit tests for sockets - ipv4 (#600)
* Fix basic build issue
* Fixed builds issues with the sockets unit tests

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
2022-12-09 11:16:59 +05:30

105 lines
4.8 KiB
C

/*
* FreeRTOS+TCP V2.3.1
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
#ifndef FREERTOS_DHCPV6_H
#define FREERTOS_DHCPV6_H
#ifdef __cplusplus
extern "C" {
#endif
/* Application level configuration options. */
#include "FreeRTOS_DHCP.h"
#include "FreeRTOSIPConfig.h"
#include "IPTraceMacroDefaults.h"
#define DHCPv6_MAX_CLIENT_SERVER_ID_LENGTH 128
/** @brief The ID of a client or a server. */
typedef struct xClientServerID
{
uint16_t usDUIDType; /**< A DHCP Unique Identifier ( DUID ). */
uint16_t usHardwareType; /**< The hardware type: 1 = Ethernet. */
uint8_t pucID[ DHCPv6_MAX_CLIENT_SERVER_ID_LENGTH ]; /**< Universally Unique IDentifier (UUID) format. */
size_t uxLength; /**< The number of valid bytes within 'pucID'. */
} ClientServerID_t;
/** @brief DHCPMessage_IPv6_t holds all data of a DHCP client. */
typedef struct xDHCPMessage_IPv6
{
uint8_t uxMessageType; /**< The type of the last message received: Advertise / Confirm / Reply / Decline */
uint8_t ucTransactionID[ 3 ]; /**< ID of a transaction, shall be renewed when the transaction is ready ( and a reply has been received ). */
uint32_t ulTransactionID; /**< The same as above but now as a long integer. */
IPv6_Address_t ucDNSServer; /**< The IP-address of the DHCP server. */
uint32_t ulPreferredLifeTime; /**< The preferred life time. */
uint32_t ulValidLifeTime; /**< The valid life time. */
uint32_t ulTimeStamp; /**< DUID Time: seconds since 1-1-2000. */
uint8_t ucprefixLength; /**< The length of the prefix offered. */
uint8_t ucHasUID; /**< When pdFALSE: a transaction ID must be created. */
IPv6_Address_t xPrefixAddress; /**< The prefix offered. */
IPv6_Address_t xIPAddress; /**< The IP-address offered. */
ClientServerID_t xClientID; /**< The UUID of the client. */
ClientServerID_t xServerID; /**< The UUID of the server. */
} DHCPMessage_IPv6_t;
/** @brief A struct describing an option. */
typedef struct xDHCPOptionSet
{
size_t uxOptionLength; /**< The length of the option being handled. */
size_t uxStart; /**< The position in xMessage where the option starts. */
} DHCPOptionSet_t;
/* Returns the current state of a DHCP process. */
eDHCPState_t eGetDHCPv6State( struct xNetworkEndPoint * pxEndPoint );
struct xNetworkEndPoint;
/*
* NOT A PUBLIC API FUNCTION.
* It will be called when the DHCP timer expires, or when
* data has been received on the DHCP socket.
*/
void vDHCPv6Process( BaseType_t xReset,
struct xNetworkEndPoint * pxEndPoint );
/* Prototype of the hook (or callback) function that must be provided by the
* application if ipconfigUSE_DHCP_HOOK is set to 1. See the following URL for
* usage information:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html#ipconfigUSE_DHCP_HOOK
*/
eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase,
uint32_t ulIPAddress );
#ifdef __cplusplus
} /* extern "C" */
#endif
/* The application should supply the following time-function.
* It must return the number of seconds that have passed since
* 1/1/1970. */
extern uint32_t ulApplicationTimeHook( void );
#endif /* FREERTOS_DHCPv6_H */