RTFW_TCPIP_CONFIGURATION

RTFW_TCPIP_CONFIGURATION represents the configuration of the TCP/IP Stack. See structure RTFW_TCPIP_INTERFACE for configuration parameters specific to a network interface.

Syntax

Copy
typedef struct _RTFW_TCPIP_CONFIGURATION(
    size_t Size;
    bool AutoStart;
    bool Verbose;
    unsinged int IdealProcessor;
    unsigned int IPReassemblyTimeout;
    unsigned int MaxARPEntries;
    unsigned int MaxSockets;
    unsigned int TimerPriority;
    unsigned int TimerExecutePriority;
    unsigned int TickInterval;
    DWORD TimerIdealProcessor;
    unsigned int MaxConcurrency;
    unsigned int Memory;
    unsigned int ExtMSpacePoolMinimumSize;
    bool MSpacePoolExpandable;
    unsigned int MSpacePoolExpandSize;
} RTFW_TCPIP_CONFIGURATION, * PRTFW_TCPIP_CONFIGURATION;

Members

Size

The size of this structure (in bytes). Client code must set this member to sizeof(RTFW_TCPIP_CONFIGURATION) before passing this structure to any function.

AutoStart

If TRUE, the Stack automatically starts with the Subsystem. If FALSE, the Stack does not automatically start with the Subsystem.

Verbose

If TRUE, the TCP/IP Stack operates in verbose mode. If FALSE, the Stack does not operate in verbose mode.

IdealProcessor

The TCP/IP Stack's ideal processor. This must specify the processor number of an RTSS processor, otherwise, RtfwTCPIPSetConfiguration fails and sets the last error value to RT_ERROR_INVALID_IDEAL_PROCESSOR. Use #define RTFW_DEFAULT_RTSS_PROCESSOR UINT_MAX in RtfwApi.h to use the parent thread’s ideal processor or the system default value from wRTOS Settings.

IPReassemblyTimeout

The period (in seconds) for the TCP/IP Stack to wait before timing out upon reassembly of a fragmented IP packet. Valid values are in the range 1 to 120 (inclusive). The default value is 60.

MaxARPEntries

The maximum number of ARP entries supported by the TCP/IP Stack. Valid values are in the range 1 to 65,535 (inclusive). The default value is 256.

MaxSockets

The maximum number of sockets supported by the Stack. Valid values are in the range 1 to 1024 (inclusive). The default value is 64.

TimerPriority

The priority of the TCP/IP Stack's first real-time timer thread, which updates timer variables. This value must be in the range of valid wRTOS real-time priorities: 0 to 127 (inclusive). The default value is 66. See Remarks for more information on the TCP/IP Stack timer system.

TimerExecutePriority

The priority of the TCP/IP Stack's second real-time timer thread, which executes functions for expired timers. This value must be in the range of valid wRTOS real-time priorities: 0 to 127 (inclusive). This value must be less than or equal to the value set for TimerPriority. The default value is 60. See Remarks for more information on the TCP/IP Stack timer system.

TickInterval

The TCP/IP Stack’s timer interval, in milliseconds. This is the fundamental granularity of all time-related operations within the TCP/IP Stack. This value must be within the range 1 MS to 1000 MS and must be a positive multiple of the HAL timer period (see structure RTFW_SUBSYSTEM_CONFIGURATION). If the HAL timer period is changed using RtfwSetSubsystemConfiguration, and the TCP/IP Stack timer interval is not an integer multiple of the new HAL timer period, the TCP/IP Stack timer interval is changed to be the next higher integer multiple of the HAL timer period.

Note: This parameter's units are milliseconds, but the HAL timer period's units are microseconds, so unit conversion must be performed when computing a valid value for this parameter.

TimerIdealProcessor

The ideal processor of the TCP/IP Stack's timer thread. This must specify the processor number of an RTSS processor, otherwise, RtfwTCPIPSetConfiguration fails and sets the last error value to RT_ERROR_INVALID_IDEAL_PROCESSOR. If this value is zero or RTFW_FIRST_RTSS_PROCESSOR, it refers to the same RTSS processor that is configured by member IdealProcessor, which is not necessarily the first RTSS processor. Use #define RTFW_DEFAULT_RTSS_PROCESSOR UINT_MAX in RtfwApi.h to use the parent thread’s ideal processor or the system default value from wRTOS Settings.

MaxConcurrency

The number of threads that are allowed to run concurrently within the TCP/IP stack.

The TCP/IP Stack needs to initialize certain attributes when started to allow a certain number of threads to run and provide services for each client that requests services from the TCP/IP stack.

For example, running a client and a server application will require 1 concurrency each. The TCP/IP Stack running by itself requires 1 concurrency to run the Loopback interface. Loading and managing interfaces requires an average of 3 threads, thus a concurrency of 3 for each interface.

Note: We recommend that this value be calculated automatically (default).

Note: If the TCP/IP Stack requires more threads than the initialization process prepared for, the Stack will become unstable.

Calculate automatically is the default. This setting prepares an expected surplus of resources based on the number of interfaces the TCP/IP Stack will manage.

Memory

The amount of memory, in kilobytes, to be allocated for the TCP/IP Stack’s internal resources. This value must be within the range 2048 KB to 4,194,304 KB (4 GB).

ExtMSpacePoolMinimumSize

The minimum size, in bytes, of the TCP/IP Stack's initial external MSpace.

MSpacePoolExpandable

If TRUE, the TCP/IP Stack's external MSpace will expand automatically when necessary. If FALSE, the TCP/IP Stack's external MSpace will not expand automatically.

MSpacePoolExpandSize

The size (in bytes) to expand the TCP/IP Stack's external MSpace. This member is ignored if MSpacePoolExpandable is FALSE.

Remarks

The TCP/IP Stack timer system is one of the main components of TCP/IP. It is responsible for notifying the Stack of the amount of time that has elapsed. This is very important for a protocol stack. The TCP/IP Stack must know how long a TCP packet takes to get to a remote system, as well as the amount of time an ARP entry has been in the ARP table. Additionally, the Stack's timer system uses a timer for its internal routing entries. The Stack uses a timer thread to handle all TCP/IP timer related functions.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtfwtcpipApi.h

RtfwTCPIPlib

See Also: