/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* MODULE: udat.c
*
* PURPOSE: DAT Provider and Consumer registry functions.
*
* $Id: udat.c,v 1.13 2003/08/20 14:28:40 hobie16 Exp $
*/
#include "dat_dr.h"
#include "dat_init.h"
#include "dat_osd.h"
#ifndef DAT_NO_STATIC_REGISTRY
#include "dat_sr.h"
#endif
/*
*
* Internal Function Declarations
*
*/
udat_check_state(void);
/*
*
* External Function Definitions
*
*/
/*
*
* Provider API
*
*/
/*
* Function: dat_registry_add_provider
*/
{
"DAT Registry: dat_registry_add_provider() called\n");
if (UDAT_IS_BAD_POINTER(provider)) {
}
if (UDAT_IS_BAD_POINTER(provider_info)) {
}
if (DAT_FALSE == udat_check_state()) {
return (DAT_ERROR(DAT_INVALID_STATE, 0));
}
}
/*
* Function: dat_registry_remove_provider
*/
{
"DAT Registry: dat_registry_remove_provider() called\n");
if (UDAT_IS_BAD_POINTER(provider)) {
}
if (DAT_FALSE == udat_check_state()) {
return (DAT_ERROR(DAT_INVALID_STATE, 0));
}
return (dat_dr_remove(provider_info));
}
/*
*
* Consumer API
*
*/
/*
* Function: dat_ia_open
*/
{
"DAT Registry: dat_ia_open() called\n");
if (UDAT_IS_BAD_POINTER(_name)) {
}
if (DAT_NAME_MAX_LENGTH <= len) {
}
if (UDAT_IS_BAD_POINTER(ia_handle)) {
}
if (DAT_FALSE == udat_check_state()) {
return (DAT_ERROR(DAT_INVALID_STATE, 0));
}
/* Find out if this is an RO aware client and if so, strip the prefix */
0);
/* strip off the prefix from the provider's name if present */
if (ro_aware_client) {
}
/*
* Since DAT allows providers to be loaded by either the static
* registry or explicitly through OS dependent methods, do not
* return an error if no providers are loaded via the static registry.
* Don't even bother calling the static registry if DAT is compiled
* with no static registry support.
*/
#ifndef DAT_NO_STATIC_REGISTRY
(void) dat_sr_provider_open(&info);
#endif
if (status != DAT_SUCCESS) {
"DAT Registry: dat_ia_open() provider information "
"for IA name %s not found in dynamic registry\n",
_name);
return (status);
}
}
/*
* Function: dat_ia_close
*/
{
const char *ia_name;
"DAT Registry: dat_ia_close() called\n");
if (UDAT_IS_BAD_POINTER(ia_handle)) {
}
if (DAT_FALSE == udat_check_state()) {
return (DAT_ERROR(DAT_INVALID_STATE, 0));
}
NULL,
0,
NULL,
&provider_attr))) {
"DAT Registry: query function for %s provider failed\n",
ia_name);
} else if (DAT_SUCCESS != (status =
"DAT Registry: close function for %s provider failed\n",
ia_name);
} else {
if (DAT_SUCCESS != status) {
"DAT Registry: dynamic registry unable to close "
"provider for IA name %s\n",
ia_name);
}
#ifndef DAT_NO_STATIC_REGISTRY
if (DAT_SUCCESS != status) {
"DAT Registry: static registry unable to close "
"provider for IA name %s\n",
ia_name);
}
#endif
}
return (status);
}
/*
* Function: dat_registry_list_providers
*/
{
"DAT Registry: dat_registry_list_providers() called\n");
if (DAT_FALSE == udat_check_state()) {
return (DAT_ERROR(DAT_INVALID_STATE, 0));
}
if ((UDAT_IS_BAD_POINTER(entries_returned))) {
}
}
if (0 == max_to_return) {
/*
* the user is allowed to call with max_to_return set to zero.
* in which case we simply return (in *entries_returned) the
* number of providers currently installed. We must also
* (per spec) return an error
*/
#ifndef DAT_NO_STATIC_REGISTRY
(void) dat_sr_size(entries_returned);
#else
(void) dat_dr_size(entries_returned);
#endif
} else {
#ifndef DAT_NO_STATIC_REGISTRY
#else
#endif
}
return (dat_status);
}
/*
*
* Internal Function Definitions
*
*/
/*
* Function: udat_check_state
*/
/*
* This function returns TRUE if the DAT registry is in a state capable
* of handling DAT API calls and false otherwise.
*/
udat_check_state(void)
{
if (DAT_MODULE_STATE_UNINITIALIZED == state) {
dat_init();
} else if (DAT_MODULE_STATE_DEINITIALIZED == state) {
} else {
}
return (status);
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 8
* End:
*/