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 }
xNetworkInterfaceInitialise(void)80 BaseType_t xNetworkInterfaceInitialise( void )
81 {
82 }
vApplicationIPNetworkEventHook(eIPCallbackEvent_t eNetworkEvent)83 void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
84 {
85 }
xApplicationGetRandomNumber(uint32_t * pulNumber)86 BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
87 {
88 }
vApplicationDaemonTaskStartupHook(void)89 void vApplicationDaemonTaskStartupHook( void )
90 {
91 }
vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer,StackType_t ** ppxTimerTaskStackBuffer,uint32_t * pulTimerTaskStackSize)92 void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
93 StackType_t ** ppxTimerTaskStackBuffer,
94 uint32_t * pulTimerTaskStackSize )
95 {
96 }
vPortDeleteThread(void * pvTaskToDelete)97 void vPortDeleteThread( void * pvTaskToDelete )
98 {
99 }
vApplicationIdleHook(void)100 void vApplicationIdleHook( void )
101 {
102 }
vApplicationTickHook(void)103 void vApplicationTickHook( void )
104 {
105 }
ulGetRunTimeCounterValue(void)106 unsigned long ulGetRunTimeCounterValue( void )
107 {
108 }
vPortEndScheduler(void)109 void vPortEndScheduler( void )
110 {
111 }
xPortStartScheduler(void)112 BaseType_t xPortStartScheduler( void )
113 {
114 }
vPortEnterCritical(void)115 void vPortEnterCritical( void )
116 {
117 }
vPortExitCritical(void)118 void vPortExitCritical( void )
119 {
120 }
121
pvPortMalloc(size_t xWantedSize)122 void * pvPortMalloc( size_t xWantedSize )
123 {
124 return malloc( xWantedSize );
125 }
126
vPortFree(void * pv)127 void vPortFree( void * pv )
128 {
129 free( pv );
130 }
131
vPortGenerateSimulatedInterrupt(uint32_t ulInterruptNumber)132 void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber )
133 {
134 }
vPortCloseRunningThread(void * pvTaskToDelete,volatile BaseType_t * pxPendYield)135 void vPortCloseRunningThread( void * pvTaskToDelete,
136 volatile BaseType_t * pxPendYield )
137 {
138 }
vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer,StackType_t ** ppxIdleTaskStackBuffer,uint32_t * pulIdleTaskStackSize)139 void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
140 StackType_t ** ppxIdleTaskStackBuffer,
141 uint32_t * pulIdleTaskStackSize )
142 {
143 }
vConfigureTimerForRunTimeStats(void)144 void vConfigureTimerForRunTimeStats( void )
145 {
146 }
147
148
xNetworkInterfaceOutput(NetworkBufferDescriptor_t * const pxNetworkBuffer,BaseType_t bReleaseAfterSend)149 BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxNetworkBuffer,
150 BaseType_t bReleaseAfterSend )
151 {
152 return pdPASS;
153 }
154 /*-----------------------------------------------------------*/
155