lb_register(3ncs)
Name
lb_register − register an object and an interface with the Location Broker
Syntax
#include <idl/c/lb.h>
void lb_$register(object, obj_type, obj_interface, flags, annotation, location, location_length, entry, status)
uuid_$t *object;
uuid_$t *obj_type;
uuid_$t *obj_interface;
lb_$server_flag_t flags;
unsigned char annotation[64];
socket_$addr_t *location;
unsigned long location_length;
lb_$entry_t *entry;
status_$t *status;
Arguments
object The UUID of the object being registered.
obj_type The UUID of the type of the object being registered.
obj_interface The UUID of the interface being registered.
flags Must be either lb_$server_flag_local (specifying registration with only the LLB at the local host) or 0 (specifying registration with both the LLB and the GLB).
annotation A character array used only for informational purposes. This field can contain a textual description of the object and the interface. For proper display by the lb_admin tool, the annotation should be terminated by a null character.
location The socket address of the server that exports the interface to the object.
location_length The length, in bytes, of the socket address specified by the location field.
entry A copy of the entry that was entered in the Location Broker database.
status The completion status. If the completion status returned in status.all is equal to status_$ok , then the routine that supplied it was successful.
Description
The lb_$register routine registers with the Location Broker an interface to an object and the location of a server that exports that interface. This routine replaces any existing entry in the Location Broker database that matches object, obj_type, obj_interface, and both the address family and host in location; if no such entry exists, the routine adds a new entry to the database.
If the flags parameter is lb_$server_flag_local, the entry is registered only in the LLB database at the host where the call is issued. Otherwise, the flag should be 0 to register with both the LLB and the GLB databases.
Examples
The following statement registers the bank interface to the object identified by bank_id :
lb_$register (&bank_id, &bank_$uuid, &bank_$if_spec.id, 0,
BankName, &saddr, slen, &entry, &status);
Diagnostics
This section lists status codes for errors returned by this lb_$ routine in status.all.
lb_$database_invalid
The format of the Location Broker database is out of date. The database may have been created by an old version of the Location Broker; in this case, delete the out-of-date database and reregister any entries that it contained. The LLB or GLB that was accessed may be running out-of-date software; in this case, update all Location Brokers to the current software version.
lb_$database_busy
The Location Broker database is currently in use in an incompatible manner.
lb_$update_failed The Location Broker was unable to register the entry.
lb_$cant_access The Location Broker cannot access the database. Among the possible reasons:
1. The database does not exist, and the Location Broker cannot create it.
2. The database exists, but the Location Broker cannot access it.
3. The GLB entry table is full.
lb_$server_unavailable
The Location Broker Client Agent cannot reach the requested GLB or LLB. A communications failure occurred or the broker was not running.
Files
/usr/include/idl/c/glb.h