/*
* 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.
*/
#include <mdb/mdb_modapi.h>
#include <sys/hook_impl.h>
/*
* List pfhooks hook list information.
*/
/*ARGSUSED*/
int
{
char *hintname;
hook_t *h;
if (argc)
return (DCMD_USAGE);
return (DCMD_ERR);
}
mdb_printf("%<u>%?s %8s %20s %4s %24s %24s%</u>\n",
"ADDR", "FLAG", "FUNC", "HINT", "NAME", "HINTVALUE");
while (hlp) {
mdb_warn("couldn't read hook list at %p",
hlp);
return (DCMD_ERR);
}
if (!h->h_name) {
mdb_warn("hook list at %p has null role", h);
return (DCMD_ERR);
}
return (DCMD_ERR);
}
switch (h->h_hint) {
case HH_BEFORE :
case HH_AFTER :
hintname = h->h_hintvalue ?
(char *)h->h_hintvalue : "";
break;
default :
hintname = "";
break;
}
mdb_printf("%0?p %8x %0?p %4d %24s %24s\n",
else
mdb_printf("%0?p %8x %20s %4d %24s %24s\n",
}
return (DCMD_OK);
}
/*
* List pfhooks event information.
* List the hooks information in verbose mode as well.
*/
/*ARGSUSED*/
int
{
if (argc)
return (DCMD_USAGE);
return (DCMD_ERR);
}
while (hrp) {
return (DCMD_ERR);
}
mdb_warn("hook register at %p has no hook provider",
hrp);
return (DCMD_ERR);
}
mdb_warn("hook provider at %p has null role",
return (DCMD_ERR);
}
mdb_warn("hook provider at %p has null role",
return (DCMD_ERR);
}
mdb_warn("couldn't read provider role at %p",
return (DCMD_ERR);
}
}
return (DCMD_OK);
}
/*
* List pfhooks family information.
*/
/*ARGSUSED*/
int
{
if (argc)
return (DCMD_USAGE);
mdb_warn("couldn't read netstack_hook");
return (DCMD_ERR);
}
mdb_warn("couldn't read hook family head");
return (DCMD_ERR);
}
while (hfp) {
return (DCMD_ERR);
}
mdb_warn("hook root at %p has null role",
hf.hfi_family);
return (DCMD_ERR);
}
mdb_warn("couldn't read root role at %p",
return (DCMD_ERR);
}
}
return (DCMD_OK);
}
static int
{
mdb_warn("global walk not supported\n");
return (WALK_ERR);
}
return (DCMD_ERR);
}
wsp->walk_cbdata));
}
static int
{
return (DCMD_ERR);
}
return (WALK_DONE);
wsp->walk_cbdata));
}
{ "hookeventlist", "", "display hook event information",
hookeventlist, NULL },
{ NULL }
};
{ "hookevent_stack", "walk list of hooks",
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}