Skip to main content

IPSetAdapterStatus

CAPL Functions » TCP/IP API » IPSetAdapterStatus Valid for: CANoe DE • CANoe4SW DE Note
This function is only available when the Individual TCP/IP stack instance or CANoe TCP/IP Stack is used.

Function Syntax

long IPSetAdapterStatus( dword ifIndex, dword status);

Description

With this function, it is possible to activate or deactivate a network adapter of the TCP/IP stack.
  • When the adapter is set down, all IP addresses of this adapter will be removed, and sending or receiving packets on this adapter will be stopped.
  • If the default gateway was configured in a network which was configured on this adapter, it will also be removed.
  • When the adapter is set up again, the addresses configured in the TCP/IP Stack dialog will be reconfigured, and the default gateway is set again.

Parameters

  • ifIndex: The 1-based network interface index.
  • status:
    • 0: Set adapter down
    • 1: Set adapter up

Return Values

  • 0: The function completed successfully.
  • 1: The function is not supported on the selected TCP/IP stack.
  • WSA_INVALID_PARAMETER (87): Invalid parameter given
  • SOCKET_ERROR (-1): The function failed. Call IpGetLastError to get a more specific error code.

Example