Looks up information about an object in a Local Location Broker (LLB) database.
void lb_$lookup_object_local ( object, sockaddr, slength, lookup_handle)
void lb_$lookup_object_local ( max_results, num_results, results, status)
uuid_$t *object;
socket_$addr_t *sockaddr;
unsigned long slength;
lb_$lookup_handle_t *lookup_handle;
unsigned long max_results;
unsigned long *num_results;
lb_$entry_t results [ ];
status_$t *status;
The lb_$lookup_object_local routine searches the specified LLB database and returns all entries whose fields in the object parameter match the specified object. It returns information about all replicas of an object and all interfaces to the object that are located on the specified host.
The lb_$lookup_interface routine cannot return more than the number of matching entries specified by the max_results parameter at one time. The lookup_handle parameter directs this routine to do sequential lookup calls to find all matching entries.
Input
Item | Description |
---|---|
object | Points to the Universal Unique Identifier (UUID) of the object being looked up. |
sockaddr | Specifies the location of the LLB database to be searched. The socket address must specify the network address of a host. However, the port number in the socket address is ignored. The lookup request is always sent to the host's LLB port. |
slength | Specifies the length, in bytes, of the socket address specified by the sockaddr parameter. |
max_results | Specifies the maximum number of matching entries that can be returned by a single call. This should be the number of elements in the results parameter array. |
Input/Output
Item | Description |
---|---|
lookup_handle | Specifies a location in the database. On input, the value of the lookup_handle parameter indicates the location in the database where the search begins. An input value of lb_$default_lookup_handle specifies that the search starts at the beginning of the database. |
On return, the lookup_handle indicates the next unsearched part of the database (that is, the point at which the next search should begin). A return value of lb_$default_lookup_handle indicates that the search reached the end of the database. Any other value indicates that the search found at most the number of matching entries specified by the max_results parameter before it reached the end of the database. |
Output
Item | Description |
---|---|
num_results | Points to the number of entries that were returned in the results parameter array. |
results | Specifies the array that contains the matching GLB database entries, up to the number specified in the max_results parameter. If the array contains any entries for servers on the local network, those entries appear first. |
status | Points to the completion status. |
In the following example, the repob object is replicated, with only one replica located on any host. To look up information about the repob object, enter:
lb_$lookup_object_local (&repob_id, &location, location_length,
&lookup_handle, 1, &num_results, myob_entry, &st);
Since there is only one replica located on any host, the routine returns at most one result.