Federated Naming Service Programming Guide

Basic Search

This set of operations is used to enumerate names of objects bound in the target context named name relative to the context ctx with attributes whose values match all those specified by match_attrs. Using return_ref specifies whether to return the references of named objects in the search, while return_attr_ids specifies the attributes to be returned in the search.


FN_searchlist_t *fn_attr_search(
    FN_ctx_t *ctx,
    const FN_composite_name_t *name,
    const FN_attrset_t *match_attrs,
    unsigned int return_ref,
    const FN_attrset_t *return_attr_ids,
    FN_status_t *status);
 
FN_string_t *fn_searchlist_next(
    FN_searchlist_t *sl,
    FN_ref_t **returned_ref,
    FN_attrset_t **returned_attrs,
    FN_status_t *status);
 
void fn_searchlist_destroy(
    FN_searchlist_t *sl);

The call to fn_attr_search() initiates the search in the target context. It returns a handle to an FN_searchlist_t object that is used to enumerate the names of the objects whose attributes match match_attrs.

fn_searchlist_next() returns the next name in the enumeration identified by sl. The reference of the name, if requested, is returned in returned_ref. The attributes specified by return_attr_ids are returned in returned_attrs. Successive calls to fn_searchlist_next() using sl return successive names, and optionally, references and attributes in the enumeration and further update the state of the enumeration.

fn_searchlist_destroy() releases resources used during the enumeration. It can be called at any time to terminate the enumeration.