#### The import_next and lookup_next Search Algorithm

The NSI search operations (import_next and lookup_next) traverse one or more entries in the namespace when searching for compatible binding information. In each directory service entry, these operations ignore non-RPC attributes and process the NSI attributes in the following order:

1. Binding attribute (and object attribute, if present)

2. Group attribute

3. Profile attribute

If an NSI search path includes a group attribute, the search path can encompass every entry named as a group member. If a search path includes a profile attribute, the search path can encompass every entry named as the member of a profile element that contains the target interface identifier. A search finishes only when it finds a server entry containing compatible binding information and the nonnil object UUID, if requested. Search operations take the following steps when traversing a directory service entry:

Step 1: Binding attribute

In each entry, the search operation starts by searching for a compatible interface identifier in the binding attribute, if present.

The absence of a binding attribute or of any compatible interface identifier causes the search operation to go directly to step 2.

The presence of any compatible interface identifier indicates that compatible potential bindings may exist in the binding attribute. At this point, object UUIDs may impact the search, as follows:

· If the client specified the nil object UUID, object UUIDs do not affect the success or failure of the search. The search returns compatible binding information for one or more potential bindings.

· If the client specified a nonnil object UUID, the search reads the object attribute, if present, to look for the requested object UUID. This search for an object UUID has one of the following outcomes:

- On finding the specified object UUID, the search returns the object UUID along with compatible binding information for one or more potential bindings.

- If a requested object UUID is absent, the search continues to step 2.

Note: If a search involves a series of import_next or lookup_next operations, a subsequent next operation resumes the search at the point in the search path where the preceding operation left off.

Step 2: Group attribute

If the binding attribute does not lead to compatible binding information or if a series of import_next or lookup_next operations exhausts the compatible binding information, the search continues by reading the group attribute, if present; if the directory service entry lacks a group attribute, the search goes directly to step 3.

The search operation selects a member of the group at random, goes to the entry of that member, and resumes the search at step 1. Unless a group member leads the search to compatible binding information, the search looks at all the members of the group, one by one in random order, until none remain.

Step 3: Profile attribute

If the binding and group attributes do not lead to compatible binding information, the search continues by reading the profile attribute, if present; if the directory service entry lacks a profile attribute, the search fails.

The search operation identifies all the profile elements containing the requested interface identifier and searches them in the order of their priority, beginning with the 0 (zero) priority elements. Profile elements of a given priority are searched in random order. For the selected profile element, the search reads the member name and goes to the corresponding directory service entry. There, the search resumes at Step 1. Unless a profile element leads the search to compatible binding information, the search eventually looks at all the profile elements with the requested interface identifier, one by one, until none remain.

If the starting entry does not contain NSI attributes, or if none of the steps satisfies the search, the search operation returns the status code rpc_s_no_more_bindings to the client.

Note: The inquire next (inq_next) operations for objects, groups, or profiles look at only the entry specified in its corresponding inquire begin (inq_begin) operation. The search ignores nested groups or nested profiles.

The following figure illustrates the three steps of the import_next and lookup_next search operations.

The import_next, lookup_next Search Algorithm in a Single Entry

####