void get_bind (int server_type) { uuid_t obj_uuid; unsigned32 status; rpc_ns_handle_t imp_ctxt; char *obj_uuid_string; char *entry_name; rpc_binding_handle_t *binding_handle; if (server_type == 1) { printf ( "Obtaining phone server's binding handle\n" ); obj_uuid_string = PHON_OBJ_UUID; entry_name = PHON_ENTRY_NAME; binding_handle = &phon_bh; } else { printf ( "Obtaining address server's binding handle\n" ); obj_uuid_string = ADDR_OBJ_UUID; entry_name = ADDR_ENTRY_NAME; binding_handle = &addr_bh; } /* endif */ /* Create object UUID for phone directory from string. */ uuid_from_string ( obj_uuid_string, &obj_uuid, &status ); ERRCHK ( status ); /* Set up context to import the bindings of the phone server. */ rpc_ns_binding_import_begin ( rpc_c_ns_syntax_dce, entry_name, look_v1_0_c_ifspec, &obj_uuid, &imp_ctxt, &status ); ERRCHK ( status ); /* Get the first binding handle of the phone server. */ rpc_ns_binding_import_next ( imp_ctxt, binding_handle, &status ); ERRCHK ( status ); /* Release the context. */ rpc_ns_binding_import_done ( &imp_ctxt, &status ); ERRCHK ( status ); if (server_type == 1) { printf ( "Phone server's binding done\n" ); } else { printf ( "Address server's binding done\n" ); } /* endif */ }
void rpc_ns_binding_lookup_begin ( unsigned32 entry_name_syntax, unsigned_char_p_t entry_name, rpc_if_handle_t if_spec, uuid_p_t object_uuid, unsigned32 binding_max_count ATTRIBUTE_UNUSED, rpc_ns_handle_t *lookup_context, unsigned32 *status ) { rpc_ns_binding_import_begin(entry_name_syntax, entry_name, if_spec, object_uuid, lookup_context, status); }