IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


int SetDefaultGateway ( void *  InterfaceHandle,
unsigned long  ipAddress 
)

This function is used to add the system default gateway for all interfaces.

Parameters:
InterfaceHandle Device handle to specify the interface.
ipAddress The default gateway IP address in Network Byte Order.
Returns:
0 on success, else failure code
Note:
If this function is used, the Gateway entry in the CHIP.INI becomes invalidated, but unchanged.
DefaultGateway() returns the current gateway IP address.
The device handle pointer (InterfaceHandle) is retrievable by Dev_Find_Iface_By_Name().
A list of all installed device drivers is retrievable by Dev_Get_IfaceEntries().
Before setting a new gateway, the old gateway entry must be removed as shown below.

 unsigned long ipAddress;
 void * deviceHandle;
 deviceHandle = Dev_Find_Iface_By_Name("FEC");
 if(DefaultGateway(&ipAddress)==0)
 {
    RemoveDefaultGateway(ipAddress); 
 }
 SetDefaultGateway(deviceHandle,newGatewayIPAddress);
Since:
SC2x3 V1.00 - CLIB V1.00
See also:
RemoveDefaultGateway() , DefaultGateway(), SetStaticRoute()





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:39 2017 by Doxygen 1.6.1