GReturn GCALL GAssign | ( | GCStringIn | ip, |
GCStringIn | mac | ||
) |
Uses GUtility(), G_UTIL_GCAPS_ASSIGN or G_UTIL_ASSIGN to assign an IP address over the Ethernet to a controller at a given MAC address.
ip | The null-terminated ip address to assign. The hardware should not yet have an IP address. |
mac | The null-terminated MAC address of the hardware. |
On Linux and Mac, the desired IP address will be pinged prior to the assignment. If the ping is returned, GAssign() will return G_GCLIB_UTILITY_IP_TAKEN.
If gcaps is available, the assign will be performed from the server via G_UTIL_GCAPS_ASSIGN. In the absence of the server, gclib will use G_UTIL_ASSIGN to assign.
See x_examples.cpp for an example.
Definition at line 66 of file gclibo.c.
References G_GCLIB_UTILITY_IP_TAKEN, G_NO_ERROR, G_UTIL_ASSIGN, G_UTIL_GCAPS_ASSIGN, G_UTIL_GCAPS_PING, G_UTIL_PING, and GUtility().