Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Updated Jul 2025

FreeRTOS_SetNetmask()

[FreeRTOS-Plus-TCP API Reference]

FreeRTOS_IP.h

1void FreeRTOS_SetNetmask( uint32_t ulNetmask );

This function can be used to update the IPv4 subnet mask used by the FreeRTOS-Plus-TCP device after the TCP stack has already been initialized with a call to FreeRTOS_IPInit().

Parameters:

  • ulNetmask

    The 32-bit IPv4 netmask, in network endian order, which the device should use. FreeRTOS_htonl
    can be used to get the network endian representation of the 32-bit IP netmask.

Caution:

This function is not thread safe and should be used with the

taskENTER_CRITICAL/taskEXIT_CRITICAL
pair. A call to this function should be made only when there is no active connection (either UDP or TCP), or else that connection might be severed.

Example usage:

See the FreeRTOS_SetIPAddress page for an example.