Solaris DHCP Service Developer's Guide

Description

Searches a DHCP network container for instances that match the query described by the combination of query and targetp. If the partial argument is B_TRUE, then partial query results are acceptable to the caller. Thus, when partial is B_TRUE, any query that returns at least one matching record is considered successful. When partial is B_FALSE, the query returns DSVC_SUCCESS only if it has been applied to the entire container.

The query argument consists of 2 fields, each 16 bits long. The lower 16 bits select which fields {client id, flags, client IP, server IP, expiration, macro, or comment} of targetp are to be considered in the query. The upper 16 bits identify whether a particular field value selected in the lower 16 bits must match (bit set) or not match (bit clear). Bits 7 through 15 in both 16-bit fields are currently unused, and must be set to 0. Useful macros for constructing queries can be found in Example 3–1.

The count field specifies the maximum number of matching records to return. A count value of -1 requests the return of all records that match, regardless of the number. A count value of 0 causes lookup_dn to return immediately with no data.

resultp is set to point to the returned list of records. If resultp is NULL, then the caller is simply interested in knowing how many records match the query. Note that these records are dynamically allocated, and therefore the caller is responsible for freeing them. lookup_dn() returns the number of matching records in the records argument. A records value of 0 means that no records matched the query.