| gclib 1.34.15 Communications API for Galil controllers and PLCs |

## ◆ GIpRequests()

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 up to 5 seconds while listening for requests.

If gcaps is available, the listing will come from the server via G_UTIL_GCAPS_IPREQUEST. In the absence of the server, gclib will use G_UTIL_IPREQUEST to generate the list. GIpRequests() will take up to 1 second to look for gcaps. 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_adapter_name, network_adapter_ip_address, remembered_ip_assignment. See GAssign() for more infomation about remembered IP assignments. The following is an example output.

    DMC2000, 34023, 00:50:4C:00:84:E7, enp5s0, 192.168.42.92, 192.168.42.200
    DMC2105, 7, 00:50:4C:58:00:07, enp5s0, 192.168.42.92, 0.0.0.0
    DMC2105, 13, 00:50:4C:58:00:0D, enp5s0, 192.168.42.92, 0.0.0.0

See x_examples.cpp for an example.

Definition at line 106 of file gclibo.c.

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

Referenced by ip_assigner().