/*
* 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
*/
/*
*/
/*
* alarms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libpcp.h>
#include "tsalarm.h"
/* Message Types */
int
{
int chnl_fd;
int retries;
/* initialize virtual channel */
if (retries == TSALARM_MAX_RETRIES) {
goto cleanup;
}
(void) sleep(TSALARM_CHANNEL_TIMEOUT);
} else
break;
}
/* create request message data */
goto cleanup;
}
/*
* Send the request and receive the response.
*/
TSALARM_CHANNEL_TIMEOUT) < 0) {
/* we either timed out or erred; either way try again */
(void) sleep(TSALARM_CHANNEL_TIMEOUT);
TSALARM_CHANNEL_TIMEOUT) < 0) {
goto cleanup;
}
}
/*
* verify that the Alarm action has taken place
*/
goto cleanup;
/*
* validate that this data was meant for us
*/
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
/* free recv_msg.msg_data through pointer to make sure it is valid */
/* close virtual channel fd */
return (rc);
}
int
{
int chnl_fd;
int retries;
/* initialize virtual channel */
if (retries == TSALARM_MAX_RETRIES) {
goto cleanup;
}
(void) sleep(TSALARM_CHANNEL_TIMEOUT);
} else
break;
}
/* create request message data */
goto cleanup;
}
if (alarm_state == TSALARM_STATE_ON)
else if (alarm_state == TSALARM_STATE_OFF)
/*
* Send the request and receive the response.
*/
TSALARM_CHANNEL_TIMEOUT) < 0) {
/* we either timed out or erred; either way try again */
(void) sleep(TSALARM_CHANNEL_TIMEOUT);
TSALARM_CHANNEL_TIMEOUT) < 0) {
goto cleanup;
}
}
/*
* verify that the Alarm action has taken place
*/
goto cleanup;
/*
* validate that this data was meant for us
*/
goto cleanup;
}
goto cleanup;
}
/*
* ensure the Alarm action taken is the one requested
*/
goto cleanup;
goto cleanup;
goto cleanup;
}
/* free recv_msg.msg_data through pointer to make sure it is valid */
/* close virtual channel fd */
return (rc);
}