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 NetworkBufferDescriptor_t * pxARPWaitingNetworkBuffer = NULL;
16 
17 volatile BaseType_t xInsideInterrupt = pdFALSE;
18 
19 /** @brief The expected IP version and header length coded into the IP header itself. */
20 #define ipIP_VERSION_AND_HEADER_LENGTH_BYTE    ( ( uint8_t ) 0x45 )
21 
22 UDPPacketHeader_t xDefaultPartUDPPacketHeader =
23 {
24     /* .ucBytes : */
25     {
26         0x11, 0x22, 0x33, 0x44, 0x55, 0x66,  /* Ethernet source MAC address. */
27         0x08, 0x00,                          /* Ethernet frame type. */
28         ipIP_VERSION_AND_HEADER_LENGTH_BYTE, /* ucVersionHeaderLength. */
29         0x00,                                /* ucDifferentiatedServicesCode. */
30         0x00, 0x00,                          /* usLength. */
31         0x00, 0x00,                          /* usIdentification. */
32         0x00, 0x00,                          /* usFragmentOffset. */
33         ipconfigUDP_TIME_TO_LIVE,            /* ucTimeToLive */
34         ipPROTOCOL_UDP,                      /* ucProtocol. */
35         0x00, 0x00,                          /* usHeaderChecksum. */
36         0x00, 0x00, 0x00, 0x00               /* Source IP address. */
37     }
38 };
39 
40 /** @brief For convenience, a MAC address of all 0xffs is defined const for quick
41  * reference. */
42 const MACAddress_t xBroadcastMACAddress = { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
43 
44 /** @brief Structure that stores the netmask, gateway address and DNS server addresses. */
45 NetworkAddressingParameters_t xNetworkAddressing =
46 {
47     0xC0C0C0C0, /* 192.192.192.192 - Default IP address. */
48     0xFFFFFF00, /* 255.255.255.0 - Netmask. */
49     0xC0C0C001, /* 192.192.192.1 - Gateway Address. */
50     0x01020304, /* 1.2.3.4 - DNS server address. */
51     0xC0C0C0FF
52 };              /* 192.192.192.255 - Broadcast address. */
53 
xPortGetMinimumEverFreeHeapSize(void)54 size_t xPortGetMinimumEverFreeHeapSize( void )
55 {
56     return 0;
57 }
58 
59 
xApplicationDNSQueryHook(const char * pcName)60 BaseType_t xApplicationDNSQueryHook( const char * pcName )
61 {
62 }
63 
pxPortInitialiseStack(StackType_t * pxTopOfStack,StackType_t * pxEndOfStack,TaskFunction_t pxCode,void * pvParameters)64 StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
65                                      StackType_t * pxEndOfStack,
66                                      TaskFunction_t pxCode,
67                                      void * pvParameters )
68 {
69 }
70 
pcApplicationHostnameHook(void)71 const char * pcApplicationHostnameHook( void )
72 {
73 }
ulApplicationGetNextSequenceNumber(uint32_t ulSourceAddress,uint16_t usSourcePort,uint32_t ulDestinationAddress,uint16_t usDestinationPort)74 uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
75                                              uint16_t usSourcePort,
76                                              uint32_t ulDestinationAddress,
77                                              uint16_t usDestinationPort )
78 {
79 }
vApplicationIPNetworkEventHook(eIPCallbackEvent_t eNetworkEvent)80 void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
81 {
82 }
xApplicationGetRandomNumber(uint32_t * pulNumber)83 BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
84 {
85 }
vApplicationDaemonTaskStartupHook(void)86 void vApplicationDaemonTaskStartupHook( void )
87 {
88 }
vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer,StackType_t ** ppxTimerTaskStackBuffer,uint32_t * pulTimerTaskStackSize)89 void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
90                                      StackType_t ** ppxTimerTaskStackBuffer,
91                                      uint32_t * pulTimerTaskStackSize )
92 {
93 }
vPortDeleteThread(void * pvTaskToDelete)94 void vPortDeleteThread( void * pvTaskToDelete )
95 {
96 }
vApplicationIdleHook(void)97 void vApplicationIdleHook( void )
98 {
99 }
vApplicationTickHook(void)100 void vApplicationTickHook( void )
101 {
102 }
ulGetRunTimeCounterValue(void)103 unsigned long ulGetRunTimeCounterValue( void )
104 {
105 }
vPortEndScheduler(void)106 void vPortEndScheduler( void )
107 {
108 }
xPortStartScheduler(void)109 BaseType_t xPortStartScheduler( void )
110 {
111 }
vPortEnterCritical(void)112 void vPortEnterCritical( void )
113 {
114 }
vPortExitCritical(void)115 void vPortExitCritical( void )
116 {
117 }
118 
pvPortMalloc(size_t xWantedSize)119 void * pvPortMalloc( size_t xWantedSize )
120 {
121     return malloc( xWantedSize );
122 }
123 
vPortFree(void * pv)124 void vPortFree( void * pv )
125 {
126     free( pv );
127 }
128 
vPortGenerateSimulatedInterrupt(uint32_t ulInterruptNumber)129 void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber )
130 {
131 }
vPortCloseRunningThread(void * pvTaskToDelete,volatile BaseType_t * pxPendYield)132 void vPortCloseRunningThread( void * pvTaskToDelete,
133                               volatile BaseType_t * pxPendYield )
134 {
135 }
vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer,StackType_t ** ppxIdleTaskStackBuffer,uint32_t * pulIdleTaskStackSize)136 void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
137                                     StackType_t ** ppxIdleTaskStackBuffer,
138                                     uint32_t * pulIdleTaskStackSize )
139 {
140 }
vConfigureTimerForRunTimeStats(void)141 void vConfigureTimerForRunTimeStats( void )
142 {
143 }
144