TCPIP_Helper_SecurePortSet Function

C

bool TCPIP_Helper_SecurePortSet(
    uint16_t port, 
    bool streamSocket, 
    bool isSecure
);

Description

This function sets the internal data for deciding if the required port is a secure port or not. A secure port is one that requires secure connections. The TCP/IP internally maintained table with the ports that require secure connections is manipulated with this function. This table can be queried using the TCPIP_Helper_TCPSecurePortGet() function.

Preconditions

TCP/IP stack properly initialized.

Parameters

ParametersDescription
portThe TCP/UDP port to set.
streamSocketIf true, a stream/TCP port is queried. Else, a datagram/UDP port is queried.
isSecureIf true, the port is set as requiring secure connection. If false, the port is set as not requiring a secure connection and it will be removed from the secure ports table.

Returns

  • True - The port status successfully changed.

  • False - The port status could not be changed (no more slots in the table, port not found, etc.).

Remarks

Currently there is no protection for multiple threads accessing and modifying the entries in the secure port table. It is thus recommended that the updates to the table occur justs once at initialization time and after that all threads perform read-only accesses.