| gclib 386 Communications API for Galil controllers and PLCs |

All Data Structures Files Functions Variables Typedefs Macros Pages

GReturn GCALL GIpRequests | ( | GCStringOut | requests,
|  | GSize | requests_len
| ) |  |

Uses GUtility(), G_UTIL_GCAPS_IPREQUEST or G_UTIL_IPREQUEST to provide a list of all Galil controllers requesting IP addresses via BOOT-P or DHCP.

Parameters

  requests | The buffer to hold the list of requesting controllers. Data will be null terminated, even if the data must be truncated to do so. See below for more information.
  requests_len | The length of the requests buffer.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

GIpRequests() will block about 5 seconds while listening for requests.

If gcaps is available, the listing will come from the server via G_UTIL_GCAPS_IPREQUEST. In the abscence of the server, gclib will use G_UTIL_IPREQUEST to generate the list.

Attention
  When not using gcaps, Linux/OS X users must be root to use GIpRequests() and have UDP access to bind and listen on port 67.

Each line of the returned data will be of the form model, serial_number, MAC_address, network_adaptor_name, network_adaptor_ip_address. For example:

    DMC4000, 291, 00:50:4C:20:01:23, LAN, 10.1.3.10
    RIO47000, 37290, 00:50:4C:28:91:AA, Static, 192.168.0.41

Note
  GIpRequests() will take up to 1 second to look for gcaps.

See x_examples.cpp for an example.

Definition at line 95 of file gclibo.c.

References G_NO_ERROR, G_UTIL_GCAPS_IPREQUEST, G_UTIL_IPREQUEST, and GUtility().