|
|||||||||||||||
The function that performs the output (vLoggingPrintf() in the code above) must be reentrant.
ipconfigHAS_PRINTF and FreeRTOS_printfSome of the TCP/IP stack demo applications generate output messages. The TCP/IP stack outputs these messages by calling the FreeRTOS_printf macro. To obtain the demo application messages set ipconfigHAS_PRINTF to 1, then define FreeRTOS_printf() to a function that takes a printf() style format string and variable number of inputs, and sends the formatted messages to an output of your choice.Do not define FreeRTOS_printf if ipconfigHAS_PRINTF is set to 0. The following code is taken from the FreeRTOS+TCP example for the RTOS's Win32 simulator, which has the ability to output application messages to a UDP port, standard out, and to a disk file:
The function that performs the output (vLoggingPrintf() in the code above) must be reentrant.
ipconfigTCP_MAY_LOG_PORT( x )ipconfigTCP_MAY_LOG_PORT( x ) can be defined to specify which port numbers should or should not be logged by FreeRTOS_lprintf(). For example, the following definition will not generate log messages for ports 23 or 2402:
ipconfigCHECK_IP_QUEUE_SPACEA FreeRTOS queue is used to send events from application tasks to the IP stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can be queued for processing at any one time. If ipconfigCHECK_IP_QUEUE_SPACE is set to 1 then the uxGetMinimumIPQueueSpace() function can be used to query the minimum amount of free space that has existed in the queue since the system booted.
ipconfigWATCHDOG_TIMER()ipconfigWATCHDOG_TIMER() is a macro that is called on each iteration of the IP task and may be useful if the application included watchdog type functionality that needs to know the IP task is still cycling (although the fact that the IP task is cycling does not necessarily indicate it is functioning correctly).ipconfigWATCHDOG_TIMER() can be defined to perform any action desired by the application writer. If ipconfigWATCHDOG_TIMER() is left undefined then it will be removed completely by the pre-processor (it will default to an empty macro).
Hardware and Driver Specific SettingsipconfigBYTE_ORDERIf the microcontroller on which FreeRTOS+TCP is running is big endian then ipconfigBYTE_ORDER must be set to pdFREERTOS_BIG_ENDIAN. If the microcontroller is little endian then ipconfigBYTE_ORDER must be set to pdFREERTOS_LITTLE_ENDIAN. The Byte Order and Endian section of the Embedded Networking Basics and Glossary page provides an explanation of byte order considerations in IP networks.
ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUMIf the network driver or network hardware is calculating the IP, TCP and UDP checksums of outgoing packets then set ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM to 1, otherwise set ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM to 0.Throughput and processor load are greatly improved by implementing drivers that make use of hardware checksum calculations.
ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUMIf the network driver or network hardware is calculating the IP, TCP and UDP checksums of incoming packets, and discarding packets that are found to contain invalid checksums, then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1, otherwise set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 0.Throughput and processor load are greatly improved by implementing drivers that make use of hardware checksum calculations.
ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPESEthernet/hardware MAC addresses are used to address Ethernet frames. If the network driver or hardware is discarding packets that do not contain a MAC address of interest then set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 1. Otherwise set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0.Throughput and processor load are greatly improved by implementing network address filtering in hardware. Most network interfaces allow multiple MAC addresses to be defined so filtering can allow through the unique hardware address of the node, the broadcast address, and various multicast addresses.
ipconfigETHERNET_DRIVER_FILTERS_PACKETSFor expert users only.Whereas ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is used to specify whether or not the network driver or hardware filters Ethernet frames, ipconfigETHERNET_DRIVER_FILTERS_PACKETS is used to specify whether or not the network driver filters the IP, UDP or TCP data within the Ethernet frame. The TCP/IP stack is only interested in receiving data that is either addresses to a socket (IP address and port number) on the local node, or is a broadcast or multicast packet. Throughput and process load can be greatly improved by preventing packets that do not meet these criteria from being sent to the TCP/IP stack. FreeRTOS provides some features that allow such filtering to take place in the network driver. For example, xPortHasUDPSocket() can be used as follows:
ipconfigNETWORK_MTUThe MTU is the maximum number of bytes the payload of a network frame can contain. For normal Ethernet V2 frames the maximum MTU is 1500 (although a lower number may be required for Internet routing). Setting a lower value can save RAM, depending on the buffer management scheme used. If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must be divisible by 8.If ipconfigNETWORK_MTU is not defined then the following defaults will be applied:
ipconfigNUM_NETWORK_BUFFER_DESCRIPTORSipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that are available to the TCP/IP stack. The total number of network buffers is limited to ensure the total amount of RAM that can be consumed by the TCP/IP stack is capped to a pre-determinable value. How the storage area is actually allocated to the network buffer structures is not fixed, but part of the portable layer. The simplest scheme simply allocates the exact amount of storage as it is required.More information on network buffers and network buffer descriptors is provided on the pages that describe porting FreeRTOS+TCP to other hardware and the pxGetNetworkBufferWithDescriptor() porting specific API function.
ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMESIf ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames that are not in Ethernet II format will be dropped. This option is included for potential future IP stack developments.
ipconfigUSE_LINKED_RX_MESSAGESAdvanced users only.When ipconfigUSE_LINKED_RX_MESSAGES is set to 1 it is possible to reduce CPU load during periods of heavy network traffic by linking multiple received packets together, then passing all the linked packets to the IP RTOS task in one go.
ipconfigZERO_COPY_TX_DRIVERAdvanced users only.If ipconfigZERO_COPY_TX_DRIVER is set to 1 then the driver function xNetworkInterfaceOutput() will always be called with its bReleaseAfterSend parameter set to pdTRUE - meaning it is always the driver that is responsible for freeing the network buffer and network buffer descriptor. This is useful if the driver implements a zero-copy scheme whereby the packet data is sent directly from within the network buffer (for example by pointing a DMA descriptor at the data within the network buffer), instead of copying the data out of the network buffer before the data is sent (for example by copying the data into a separate pre-allocated DMA descriptor). In such cases the driver needs to take ownership of the network buffer because the network buffer can only be freed after the data has actually been transmitted - which might be some time after the xNetworkInterfaceOutput() function returns. See the examples on the Porting FreeRTOS to a Different Microcontroller documentation page for worked examples.
ipconfigBUFFER_PADDING and ipconfigPACKET_FILLER_SIZEAdvanced driver implementation use only.When the application requests a network buffer, the size of the network buffer is specified by the application writer, but the size of the network buffer actually obtained is increased by ipconfigBUFFER_PADDING bytes. The first ipconfigBUFFER_PADDING bytes of the buffer is then used to hold metadata about the buffer, and the area that actually stores the data follows the metadata. This mechanism is transparent to the user as the user only see a pointer to the area within the buffer actually used to hold network data. Some network hardware has very specific byte alignment requirements, so ipconfigBUFFER_PADDING is provided as a configurable parameter to allow the writer of the network driver to influence the alignment of the start of the data that follows the metadata.
TCP Specific ConstantsipconfigUSE_TCPSet ipconfigUSE_TCP to 1 to enable TCP. If ipconfigUSE_TCP is set to 0 then only UDP is available.
ipconfigTCP_TIME_TO_LIVEDefines the Time To Live TTL) values used in outgoing TCP packets.
ipconfigTCP_RX_BUFFER_LENGTH and ipconfigTCP_TX_BUFFER_LENGTHEach TCP socket has a buffer for reception and a separate buffer for transmission.The default buffer size is (4 * ipconfigTCP_MSS). FreeRTOS_setsockopt() can be used with the FREERTOS_SO_RCVBUF and FREERTOS_SO_SNDBUF parameters to set the receive and send buffer sizes respectively - but this must be done between the socket being created and the buffers used by the socket being created. The receive buffer is not created until data is actually received, and the transmit buffer is not created until data is actually sent to the socket for transmission. Once the buffers have been created their size cannot be changed. If a listening socket creates a new socket in response to an incoming connect request then the new socket will inherit the buffers sizes of the listening socket.
ipconfigUSE_TCP_WINSliding Windows allows messages to arrive out-of-order.Set ipconfigUSE_TCP_WIN to 1 to include sliding window behaviour in TCP sockets. Set ipconfigUSE_TCP_WIN to 0 to exclude sliding window behaviour in TCP sockets. Sliding windows can increase throughput while minimising network traffic at the expense of consuming more RAM. The size of the sliding window can be changed from its default using the FREERTOS_SO_WIN_PROPERTIES parameter to FreeRTOS_setsockopt(). The sliding window size is specified in units of MSS (so if the MSS is set to 200 bytes then a sliding window size of 2 is equal to 400 bytes) and must always be smaller than or equal to the size of the internal buffers in both directions. If a listening socket creates a new socket in response to an incoming connect request then the new socket will inherit the sliding window sizes of the listening socket.
ipconfigTCP_WIN_SEG_COUNTIf ipconfigUSE_TCP_WIN is set to 1 then each socket will use a sliding window. Sliding windows allow messages to arrive out-of order, and FreeRTOS+TCP uses window descriptors to track information about the packets in a window.A pool of descriptors is allocated when the first TCP connection is made. The descriptors are shared between all the sockets. ipconfigTCP_WIN_SEG_COUNT set the number of descriptors in the pool, and each descriptor is approximately 64 bytes. As an example: If a system will have at most 16 simultaneous TCP connections, and each connection will have an Rx and Tx window of at most 8 segments, then the worst case maximum number of descriptors that will be required is 256 ( 16 * 2 * 8 ). However, the practical worst case is normally much lower than this as most packets will arrive in order.
ipconfigUSE_TCP_TIMESTAMPSTCP time stamp functionality is available, but its usage is quite limited. Time-stamps can only be used if the initial SYN packet contains the time-stamp option. In most cases, incoming connection won't have the time-stamp option set.Set ipconfigUSE_TCP_TIMESTAMPS to 1 to include TCP time stamp functionality. Set ipconfigUSE_TCP_TIMESTAMPS to 0 to exclude TCP time stamp functionality.
ipconfigTCP_MSSSets the MSS value (in bytes) for all TCP packets.Note that FreeRTOS+TCP contains checks that the defined ipconfigNETWORK_MTU and ipconfigTCP_MSS values are consistent with each other.
ipconfigTCP_KEEP_ALIVESockets that are connected but do not transmit any data for an extended period can be disconnected by routers or firewalls that time out. This can be avoided at the application level by ensuring the application periodically sends a packet. Alternatively FreeRTOS+TCP can be configured to automatically send keep alive messages when it detects that a connection is dormant. Note that, while having FreeRTOS+TCP automatically send keep alive messages is the more convenient method, it is also the least reliable method because some routers will discard keep alive messages.Set ipconfigTCP_KEEP_ALIVE to 1 to have FreeRTOS+TCP periodically send keep alive messages on connected but dormant sockets. Set ipconfigTCP_KEEP_ALIVE to 0 to prevent the automatic transmission of keep alive messages. If FreeRTOS+TCP does not receive a reply to a keep alive message then the connection will be broken and the socket will be marked as closed. Subsequent FreeRTOS_recv() calls on the socket will return -pdFREERTOS_ERRNO_ENOTCONN.
ipconfigTCP_KEEP_ALIVE_INTERVALIf ipconfigTCP_KEEP_ALIVE is set to 1 then ipconfigTCP_KEEP_ALIVE_INTERVAL sets the interval in seconds between successive keep alive messages. Keep alive messages are not sent at all unless ipconfigTCP_KEEP_ALIVE_INTERVAL seconds have passed since the last packet was sent or received.
ipconfigTCP_HANG_PROTECTIONIf ipconfigTCP_HANG_PROTECTION is set to 1 then FreeRTOS+TCP will mark a socket as closed if there is no status change on the socket within the period of time specified by ipconfigTCP_HANG_PROTECTION_TIME.
ipconfigTCP_HANG_PROTECTION_TIMEIf ipconfigTCP_HANG_PROTECTION is set to 1 then ipconfigTCP_HANG_PROTECTION_TIME sets the interval in seconds between the status of a socket last changing and the anti-hang mechanism marking the socket as closed.
ipconfigIGNORE_UNKNOWN_PACKETSNormally TCP packets that have a bad or unknown destination will result in a RESET being sent back to the remote host. If ipconfigIGNORE_UNKNOWN_PACKETS is set to 1 then such resets will be suppressed (not sent).
UDP Specific ConstantsipconfigUDP_TIME_TO_LIVEDefines the Time To Live (TTL) values used in outgoing UDP packets.
ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKSSockets have a send block time attribute. If FreeRTOS_sendto() is called but a network buffer cannot be obtained then the calling RTOS task is held in the Blocked state (so other tasks can continue to executed) until either a network buffer becomes available or the send block time expires. If the send block time expires then the send operation is aborted.The maximum allowable send block time is capped to the value set by ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS. Capping the maximum allowable send block time prevents prevents a deadlock occurring when all the network buffers are in use and the tasks that process (and subsequently free) the network buffers are themselves blocked waiting for a network buffer. ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in milliseconds can be converted to a time in ticks by dividing the time in milliseconds by portTICK_PERIOD_MS.
ipconfigUDP_MAX_RX_PACKETSipconfigUDP_MAX_RX_PACKETS defines the maximum number of packets that can exist in the Rx queue of a UDP socket. For example, if ipconfigUDP_MAX_RX_PACKETS is set to 5 and there are already 5 packets queued on the UDP socket then subsequent packets received on that socket will be dropped until the queue length is less than 5 again.
Other Constants Effecting Socket BehaviouripconfigINCLUDE_FULL_INET_ADDRImplementing FreeRTOS_inet_addr() necessitates the use of string handling routines, which are relatively large. To save code space the full FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr() takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter. FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets (for example, 192, 168, 0, 1) as its parameters. If ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is not set to 1 then only FreeRTOS_indet_addr_quick() is available.
ipconfigALLOW_SOCKET_SEND_WITHOUT_BINDThe address of a socket is the combination of its IP address and its port number. FreeRTOS_bind() is used to manually allocate a port number to a socket (to 'bind' the socket to a port), but manual binding is not normally necessary for client sockets (those sockets that initiate outgoing connections rather than wait for incoming connections on a known port number). If ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP stack automatically binding the socket to a port number from the range socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto() on a socket that has not yet been bound will result in the send operation being aborted.
ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIMEAPI functions used to read data from a socket can block to wait for data to become available. ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME sets the default block time defined in RTOS ticks. If ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME is not defined then the default block time will be set to portMAX_DELAY - meaning an RTOS task that is blocked on a socket read will not leave the Blocked state until data is available. Note tasks in the Blocked state do not consume any CPU time.ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME is specified in ticks. The macros pdMS_TO_TICKS() and portTICK_PERIOD_MS can both be used to convert a time specified in milliseconds to a time specified in ticks. The time out time can be changed at any time using the FREERTOS_SO_RCVTIMEO parameter with FreeRTOS_setsockopt(). Note: Infinite block times should be used with extreme care in order to avoid a situation where all tasks are blocked indefinitely to wait for another RTOS task (which is also blocked indefinitely) to free a network buffer. A socket can be set to non-blocking mode by setting both the send and receive block time to 0. This might be desirable when an RTOS task is using more than one socket - in which case blocking can instead by performed on all the sockets at once using FreeRTOS_select(), or the RTOS task can set ipconfigSOCKET_HAS_USER_SEMAPHORE to one then block on its own semaphore.
ipconfigSOCK_DEFAULT_SEND_BLOCK_TIMEWhen writing to a socket the write may not be able to proceed immediately. For example, depending on the configuration, a write might have to wait for a network buffer to become available. API functions used to write data to a socket can block to wait for the write to succeed. ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME sets the default block time defined in RTOS ticks. If ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME is not defined then the default block time will be set to portMAX_DELAY - meaning an RTOS task that is blocked on a socket read will not leave the Blocked state until data is available. Note tasks in the Blocked state do not consume any CPU time.ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME is specified in ticks. The macros pdMS_TO_TICKS() and portTICK_PERIOD_MS can both be used to convert a time specified in milliseconds to a time specified in ticks. The time out time can be changed at any time using the FREERTOS_SO_SNDTIMEO parameter with FreeRTOS_setsockopt(). Note: Infinite block times should be used with extreme care in order to avoid a situation where all tasks are blocked indefinitely to wait for another RTOS task (which is also blocked indefinitely) to free a network buffer. A socket can be set to non-blocking mode by setting both the send and receive block time to 0. This might be desirable when an RTOS task is using more than one socket - in which case blocking can instead by performed on all the sockets at once using FreeRTOS_select(), or the RTOS task can set ipconfigSOCKET_HAS_USER_SEMAPHORE to one then block on its own semaphore. A socket can be set to non-blocking mode by setting both the send and receive block time to 0.
ipconfigSOCKET_HAS_USER_SEMAPHOREBy default sockets will block on a send or receive that cannot complete immediately. See the description of the ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME and ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME parameters.If an RTOS task is using multiple sockets and cannot block on one socket at a time then the sockets can be set into non-blocking mode, and the RTOS task can block on all the sockets at once by either using the FreeRTOS_select() function or by setting ipconfigSOCKET_HAS_USER_SEMAPHORE to 1, using the FREERTOS_SO_SET_SEMAPHORE parameter with FreeRTOS_setsockopt() to provide a semaphore to the socket, and then blocking on the semaphore. The semaphore will be given when any of the sockets are able to proceed - at which time the RTOS task can inspect all the sockets individually using non blocking API calls to determine which socket caused it to unblock.
ipconfigSUPPORT_SIGNALSIf ipconfigSUPPORT_SIGNALS is set to 1 then the FreeRTOS_SignalSocket() API function is included in the build. FreeRTOS_SignalSocket() can be used to send a signal to a socket, the result of which is that any task blocked on a read from the socket will leave the Blocked state (abort the blocking read operation).
ipconfigSUPPORT_SELECT_FUNCTIONSet ipconfigSUPPORT_SELECT_FUNCTION to 1 to include support for the FreeRTOS_select() and associated API functions, or 0 to exclude FreeRTOS_select() and associated API functions from the build.
Constants Affecting the ARP BehaviouripconfigARP_CACHE_ENTRIESThe ARP cache is a table that maps IP addresses to MAC addresses.The IP stack can only send a UDP message to a remove IP address if it knowns the MAC address associated with the IP address, or the MAC address of the router used to contact the remote IP address. When a UDP message is received from a remote IP address the MAC address and IP address are added to the ARP cache. When a UDP message is sent to a remote IP address that does not already appear in the ARP cache then the UDP message is replaced by a ARP message that solicits the required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum number of entries that can exist in the ARP table at any one time.
ipconfigMAX_ARP_RETRANSMISSIONSARP requests that do not result in an ARP response will be re-transmitted a maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is aborted.
ipconfigMAX_ARP_AGEipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP table being created or refreshed and the entry being removed because it is stale. New ARP requests are sent for ARP cache entries that are nearing their maximum age.ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is equal to 1500 seconds (or 25 minutes).
ipconfigARP_REVERSED_LOOKUPAdvanced users only.If ipconfigARP_REVERSED_LOOKUP is set to 1 then the xGetARPCacheEntryByMac() function is available for use. xGetARPCacheEntryByMac() performs an IP address look up from a MAC address.
ipconfigARP_STORES_REMOTE_ADDRESSESAdvanced users only.ipconfigARP_STORES_REMOTE_ADDRESSES is provided for the case when a message that requires a reply arrives from the Internet, but from a computer attached to a LAN rather than via the defined gateway. Before replying to the message the TCP/IP stack RTOS task will loop up the message's IP address in the ARP table - but if ipconfigARP_STORES_REMOTE_ADDRESSES is set to 0 then ARP will return the MAC address of the defined gateway because the destination address is outside of the netmask. That might prevent the reply reaching its intended destination. If ipconfigARP_STORES_REMOTE_ADDRESSES is set to 1 then remote addresses will also be stored in the ARP table, along with the MAC address from which the message was received. This can allow the message in the scenario above to be routed and delivered correctly.
ipconfigUSE_ARP_REVERSED_LOOKUPAdvanced users only.Normally ARP will look up an IP address from a MAC address. If ipconfigUSE_ARP_REVERSED_LOOKUP is set to 1 then a function that does the reverse is also available. eARPGetCacheEntryByMac() looks up a MAC address from an IP address.
ipconfigUSE_ARP_REMOVE_ENTRYAdvanced users only.If ipconfigUSE_ARP_REMOVE_ENTRY is set to 1 then ulARPRemoveCacheEntryByMac() is included in the build. ulARPRemoveCacheEntryByMac() uses a MAC address to look up, and then remove, an entry from the ARP cache. If the MAC address is found in the ARP cache then the IP address associated with the MAC address is returned. If the MAC address is not found in the ARP cache then 0 is returned.
Constants Affecting DHCP and Name Service BehaviouripconfigUSE_DNSSet ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used through the FreeRTOS_gethostbyname() API function.ipconfigDNS_REQUEST_ATTEMPTSipconfigDNS_REQUEST_ATTEMPTS sets the number of times ARP will attempt to obtain an ARP response before giving up.
ipconfigUSE_DNS_CACHEIf ipconfigUSE_DNS_CACHE is set to 1 then the DNS cache will be enabled. If ipconfigUSE_DNS_CACHE is set to 0 then the DNS cache will be disabled.
ipconfigDNS_CACHE_ENTRIESIf ipconfigUSE_DNS_CACHE is set to 1 then ipconfigDNS_CACHE_ENTRIES defines the number of entries in the DNS cache.
ipconfigDNS_CACHE_NAME_LENGTHThe maximum number of characters a DNS host name can take, including the NULL terminator.
ipconfigUSE_LLMNRSet ipconfigUSE_LLMNR to 1 to include LLMNR.
ipconfigUSE_NBNSSet ipconfigUSE_NBNS to 1 to include NBNS.
ipconfigUSE_DHCPIf ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP address, netmask, DNS server address and gateway address from a DHCP server - and revert to using the defined static address if an IP address cannot be obtained.If ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will not attempt to obtain its address information from a DHCP server, and instead immediately use the defined static address information.
ipconfigMAXIMUM_DISCOVER_TX_PERIODWhen ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at increasing time intervals until either a reply is received from a DHCP server and accepted, or the interval between transmissions reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The TCP/IP stack will revert to using the static IP address passed as a parameter to FreeRTOS_IPInit() if the re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without a DHCP reply being received.
ipconfigUSE_DHCP_HOOKA normal DHCP transaction involves the following sequence:
If ipconfigUSE_DHCP_HOOK is set to 1 then FreeRTOS+TCP will call an application provided hook (or 'callback') function called xApplicationDHCPUserHook() both before the initial discovery packet is sent, and after a DHCP offer has been received - the hook function can be used to terminate the DHCP process at either one of these two phases in the DHCP sequence. For example, the application writer can effectively disable DHCP, even when ipconfigUSE_DHCP is set to 1, by terminating the DHCP process before the initial discovery packet is sent. As another example, the application writer can check a static IP address is compatible with the network to which the device is connected by receiving an IP address offer from a DHCP server, but then terminating the DHCP process without sending a request packet to claim the offered IP address. If ipconfigUSE_DHCP_HOOK is set to 1 then the application writer must provide a hook (callback) function with the following name and prototype:
ipconfigDHCP_REGISTER_HOSTNAMEOften DHCP servers can show the names of devices that have leased IP addresses. When ipconfigDHCP_REGISTER_HOSTNAME is set to 1 the device running FreeRTOS+TCP can identify itself to a DHCP server with a human readable name by returning the name from an application provided hook (or 'callback') function called pcApplicationHostnameHook().When ipconfigDHCP_REGISTER_HOSTNAME is set to 1 the application must provide a hook (callback) function with the following name and prototype:
Constants Affecting IP and ICMP BehaviouripconfigCAN_FRAGMENT_OUTGOING_PACKETSIf ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 1 then UDP packets that contain more data than will fit in a single network frame will be fragmented across multiple IP packets. Also see the ipconfigNETWORK_MTU setting. If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must be divisible by 8. Setting ipconfigCAN_FRAGMENT_OUTGOING_PACKETS to 1 will increase both the code size and execution time.
ipconfigREPLY_TO_INCOMING_PINGSIf ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the TCP/IP stack will generate replies to incoming ICMP echo (ping) requests.
ipconfigSUPPORT_OUTGOING_PINGSIf ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the FreeRTOS_SendPingRequest() API function is available.
Constants Providing Target SupportipconfigRAND32()ipconfigRAND32() is called by the TCP/IP stack to generate a random number that is then used as a DHCP transaction number. Random number generation is performed via this macro to allow applications to use their own random number generation method. For example, it might be possible to generate a random number by sampling noise on an analogue input.Note: The random number generator must be seeded before the TCP/IP stack is started, so before FreeRTOS_IPInit() is called.
ipconfigHAS_INLINE_FUNCTIONSIf the compiler in use supports inline functions, and portINLINE is defined to the correct inline keyword for the compiler, then set ipconfigHAS_INLINE_FUNCTIONS to 1. Otherwise set ipconfigHAS_INLINE_FUNCTIONS to 0 which will result in some inline functions using an alternative macro implementation.
|
[ Back to the top ]
[ About FreeRTOS ]
[ Privacy ]
[ FreeRTOS Labs Sitemap ]
[ Main FreeRTOS Sitemap ]
[
]
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|