/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* mdb dcmds for selected structures from
*/
#include <sys/mdb_modapi.h>
#include "crypto_cmds.h"
/*ARGSUSED*/
int
{
if (!(flags & DCMD_ADDRSPEC))
return (DCMD_USAGE);
return (DCMD_ERR);
}
/* XXX a future RFE will interpret cm_type */
return (DCMD_OK);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
char *segstrings[] = {
"UIO_USERSPACE",
"UIO_SYSSPACE",
"UIO_USERISPACE"
};
int i;
== -1) {
mdb_warn("uio_prt: could not read uio");
}
mdb_inc_indent(4);
for (i = 0; i < uio.uio_iovcnt; i++) {
== -1) {
mdb_printf("uio_iov\t?????");
mdb_warn("uio_prt: could not read uio_iov[%s]", i);
} else
}
mdb_dec_indent(4);
}
static char *cdstrings[] = {
"INVALID FORMAT",
"CRYPTO_DATA_RAW",
"CRYPTO_DATA_UIO",
"CRYPTO_DATA_MBLK"
};
/*
* Routine to print either of two structrually identical sub-structures --
* with different naming conventions. Might be changed if we decide
* to merge the two. They are the cdu union from crypto_data_t and
* the one from crypto_dual_data_t.
*/
typedef union crypto_data_union {
/*ARGSUSED*/
static void
{
switch (format) {
case CRYPTO_DATA_RAW:
mdb_inc_indent(4);
mdb_dec_indent(4);
break;
case CRYPTO_DATA_UIO:
mdb_inc_indent(4);
mdb_dec_indent(4);
break;
case CRYPTO_DATA_MBLK:
break;
default:
mdb_printf("cm_format\t??????\n");
break;
}
}
/*ARGSUSED*/
int
{
if (!(flags & DCMD_ADDRSPEC))
return (DCMD_USAGE);
return (DCMD_ERR);
}
else
mdb_inc_indent(4);
mdb_dec_indent(4);
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
if (!(flags & DCMD_ADDRSPEC))
return (DCMD_USAGE);
return (DCMD_ERR);
}
else
mdb_printf("cdu:\n");
mdb_inc_indent(4);
"ddu");
mdb_dec_indent(4);
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
if (!(flags & DCMD_ADDRSPEC))
return (DCMD_USAGE);
return (DCMD_ERR);
}
case CRYPTO_KEY_RAW:
mdb_printf("ck_format:\tCRYPTO_KEY_RAW\n");
"cku_data.cku_key_value.cku_data.cku_v_length:\t%d\n",
mdb_printf("cku_data.cku_key_value.cku_v_data:\t%p\n",
break;
case CRYPTO_KEY_REFERENCE:
mdb_printf("ck_format:\tCRYPTO_KEY_REFERENCE\n");
mdb_printf("cku_data.cku_key_id:\t%u\n",
break;
case CRYPTO_KEY_ATTR_LIST:
mdb_printf("ck_format:\tCRYPTO_KEY_ATTR_LIST\n");
mdb_printf("cku_data.cku_key_attrs.cku_a_count:\t%u\n",
mdb_printf("cku_data.cku_key_attrs.cku_o_oattr:\t%p\n",
break;
default:
mdb_printf("ck_format:\t\t?????\n");
break;
}
return (DCMD_OK);
}