mms_mgmt.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* Define functions used to manage API lists.
*/
#include <mms.h>
#include <mgmt_mms.h>
/*
* mms_acc_insert
*
* Add a response to the accept pointer.
*/
void
{
int rc;
}
/*
*/
}
}
}
/*
* mms_acc_wakeup
*
* Wake-up threads waiting for the an accept response.
*/
void
{
int rc;
}
/*
*/
}
}
}
/*
* mms_be_wait
*
* Wait for a pending begin-end sequence to complete.
*/
void
{
int rc;
}
while (sp->mms_be_pending) {
&sp->mms_be_mutex)) != 0) {
"on begin-end condition variable, error "
}
}
if (be_start)
}
}
/*
* mms_be_wakeup
*
* Wake-up threads waiting for a begin-end sequence to complete.
*/
void
{
int rc;
}
}
}
"sequences");
}
/*
* mms_cmd_create
*
* Create an element to manage asynchronous requests.
*/
void
{
}
}
/*
* mms_cmd_extract
*
* Parse a command, extracting the command type and task id.
*/
int
{
int rc;
*cmdtype = MMS_CMD_OTHER;
if (rc) {
return (rc);
}
return (MMS_INVALID_REQ);
}
*cmdtype = MMS_CMD_BEGIN;
*cmdtype = MMS_CMD_END;
}
return (MMS_API_OK);
}
/*
* mms_cmd_flush
*
* Flush all entries from the command queue.
*/
void
{
int rc;
}
/*
* Send error final response for all outstanding commands.
*/
/*
* If the command was sent asynchronously, then execute the
* callback function, sending a generated error response.
* For commands sent over a synchronous connection,
* mms_obtain_response will return the error response.
*/
if (err_rsp) {
}
}
}
}
}
/*
* mms_cmd_free
*
* This function frees memory associated with a command list element.
*/
void
{
return;
"list element memory");
}
/*
* mms_cmd_get_task
*
* Extract the task id from the command.
*/
char *
{
char *task;
"mms_cmd_get_task: Couldn't find a task clause");
return (NULL);
}
"mms_cmd_get_task: Couldn't find the task string");
return (NULL);
}
"mms_cmd_get_task: Task string is null");
return (NULL);
}
return (task);
}
/*
* mms_cmd_insert
*
* Add an element to the command list.
*/
void
{
int rc;
}
/*
* Add cmd element to outstanding command list so that reader
* thread knows what to do with the response, either add to
* response list or do a callback.
*/
}
}
/*
* mms_cmd_remove
*
* Return the command list element for task 'tid'.
*/
{
int rc;
/*
* Obtain the command structure that is associated with the
* taskid of the last command sent to MMS.
*/
}
"mms_cmd_remove: Entry in command list"
" found for final response for taskid %s", tid);
break;
}
}
"mms_cmd_remove, Did not find final response "
"entry in command list for command with taskid %s", tid);
}
}
return (cmd_ele);
}
/*
* mms_ev_insert
*
* Insert response in the event list and wakeup any threads reading
* events.
*/
void
{
int rc;
}
"event list condition variable failed with errno -"
}
}
}
/*
* mms_rsp_create
*
* Create an MMS response.
*/
{
"response list element failed with errno - %s",
}
return (rsp);
}
/*
* mms_rsp_find
*
* Find the response, with the specified id, in the response list.
*/
{
"response for command with taskid %s", tid);
break;
}
}
return (ele);
}
/*
* mms_rsp_insert
*
* Add a response to the response list.
*/
void
{
int rc;
}
"response list condition variable failed with errno - %s",
}
}
}
/*
* mms_rsp_wakeup
*
* Wakeup threads waiting for a final response.
*/
void
{
int rc;
}
}
}
}
/*
* mms_start_notify
*
* Notify anyone waiting for the asynchronous interface to start
* processing requests.
*/
void
{
int rc;
}
"reader start condition variable failed with errno - %s",
}
}
}
/*
* mms_thread_exit
*
* Decrement the thread count.
*/
void
{
int rc;
sp->mms_thrd_cnt--;
}
if (--sp->mms_thrd_cnt == 0 &&
"mms_thread_exit: Last client thread to exit, "
"send broadcast to wake up goodbye");
"thrd cnt variable failed with errno - %s",
}
}
}
}
/*
* mms_thread_start
*
* Start MMS API processing for a thread.
*/
void
{
int rc;
}
sp->mms_thrd_cnt++;
sp->mms_thrd_cnt--;
}
}