/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* config.c: support for the scadm configlog option (to display the
* service processor configuration log)
*/
#include <libintl.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "librsc.h"
#include "adm.h"
/* #define DEBUG */
void
{
ADM_Start();
/*
* Start by sending a zero-length request to ALOM, so that
* we can learn the length of the console log. We expect
* ALOM to return the length of the entire log. We get
* a snapshot of the length of the log here - it may however
* continue to grow as we're reading it. We read only as
* much of the log as we get in this snapshot.
*/
DP_GET_CONFIG_LOG_R, sizeof (*rscReply));
/*
* If we do not want the whole log, and the log is bigger than
* the length limit, then fetch just the last ADM_DEFAULT_LOG_LENGTH
* bytes from the log. Else just get the whole thing.
*/
} else {
}
/*
* Timeout for RSC response.
*/
/*
* This loop runs as long as there is data in the log, or until
* we hit the default limit (above). It's possible that ALOM may
* shrink the log - we need to account for this. If ALOM returns
* no data, we bail out.
*/
while (bytes_remaining) {
DP_GET_CONFIG_LOG_R, sizeof (*rscReply));
/* If ALOM returns zero bytes, we're done. */
if (response_size == 0) {
break;
}
}
/*
* If the byte at the original sequence number is no
* longer in the log, print a message.
*/
}
/* Print the config log */
stdout) != response_size) {
" to stdout"));
break;
}
}
putchar('\n');
}