TCPIP_STACK_NetAddressGatewaySet Function

C

bool TCPIP_STACK_NetAddressGatewaySet(
    TCPIP_NET_HANDLE netH, 
    IPV4_ADDR* ipAddress
);

Description

This function sets the network interface IPv4 gateway address.

Preconditions

The TCPIP_STACK_Initialize() function must have been called before calling this function. The network interface should be up and running.

Parameters

ParametersDescription
netHInterface handle to set the gateway address of.
ipAddressIP address to set.

Returns

  • True - If success.

  • False - If no such interface or interface is not enabled.

Remarks

Exercise extreme caution when using these functions to change the settings of a running network interface. Chaning these parameters at runtime can lead to unexpected behavior or loss of network connectivity. The preferred way to change the parameters for a running interface is to do so as part of the network configuration passed at the stack initialization.

Example

TCPIP_NET_HANDLE netH = TCPIP_STACK_NetHandleGet("PIC32INT");
TCPIP_STACK_NetAddressGatewaySet(netH, &myIPAddress);