1 /* Include Unity header */
2 #include <unity.h>
3 
4 /* Include standard libraries */
5 #include <stdlib.h>
6 #include <string.h>
7 #include <stdint.h>
8 #include "FreeRTOS.h"
9 #include "task.h"
10 #include "list.h"
11 
12 #include "FreeRTOS_IP.h"
13 #include "FreeRTOS_IP_Private.h"
14 
15 /* ======================== Stub Callback Functions ========================= */
16 
17 /*
18  * @brief Send a neighbour solicitation.
19  * @param[in] pxIPAddress: A network buffer big enough to hold the ICMP packet.
20  * @param[in,out] pxMACAddress: When found, the array of 6 bytes will be filled
21  *                with the MAC-address.
22  * @param[in,out] ppxEndPoint: The pointer to a pointer will point to an
23  *                             end-point to which the device has responded.
24  *
25  * @note Look for ulIPAddress in the ND cache.  If the IP address exists, copy the
26  * associated MAC address into pxMACAddress, refresh the ND cache entry's
27  * age, and return eARPCacheHit.  If the IP address does not exist in the ND
28  * cache return eARPCacheMiss.  If the packet cannot be sent for any reason
29  * (maybe DHCP is still in process, or the addressing needs a gateway but there
30  * isn't a gateway defined) then return eCantSendPacket.
31  */
eNDGetCacheEntry(IPv6_Address_t * pxIPAddress,MACAddress_t * const pxMACAddress,struct xNetworkEndPoint ** ppxEndPoint)32 eARPLookupResult_t eNDGetCacheEntry( IPv6_Address_t * pxIPAddress,
33                                      MACAddress_t * const pxMACAddress,
34                                      struct xNetworkEndPoint ** ppxEndPoint )
35 {
36     memset( pxMACAddress, 0, sizeof( MACAddress_t ) );
37 
38     return eARPCacheHit;
39 }
40 
41 /**
42  * @brief Create an IPv16 address, based on a prefix.
43  *
44  * @param[out] pxIPAddress: The location where the new IPv6 address
45  *                          will be stored.
46  * @param[in] pxPrefix: The prefix to be used.
47  * @param[in] uxPrefixLength: The length of the prefix.
48  * @param[in] xDoRandom: A non-zero value if the bits after the
49  *                       prefix should have a random value.
50  *
51  * @return pdPASS if the operation was successful. Or pdFAIL in
52  *         case xApplicationGetRandomNumber()
53  *         returned an error.
54  */
FreeRTOS_CreateIPv6Address(IPv6_Address_t * pxIPAddress,const IPv6_Address_t * pxPrefix,size_t uxPrefixLength,BaseType_t xDoRandom)55 BaseType_t FreeRTOS_CreateIPv6Address( IPv6_Address_t * pxIPAddress,
56                                        const IPv6_Address_t * pxPrefix,
57                                        size_t uxPrefixLength,
58                                        BaseType_t xDoRandom )
59 {
60 }
61 
62 /**
63  * @brief Send a neighbour solicitation.
64  * @param[in] pxNetworkBuffer: A network buffer big enough to hold the ICMP packet.
65  * @param[in] pxIPAddress: The IPv6 address of the target device.
66  *
67  * @note Send out an ND request for the IPv6 address contained in pxNetworkBuffer, and
68  * add an entry into the ND table that indicates that an ND reply is
69  * outstanding so re-transmissions can be generated.
70  */
vNDSendNeighbourSolicitation(NetworkBufferDescriptor_t * const pxNetworkBuffer,const IPv6_Address_t * pxIPAddress)71 void vNDSendNeighbourSolicitation( NetworkBufferDescriptor_t * const pxNetworkBuffer,
72                                    const IPv6_Address_t * pxIPAddress )
73 {
74 }
75