/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#define SOL2
#include <net/ppp_defs.h>
#include <sppptun/sppptun_impl.h>
#include <mdb/mdb_modapi.h>
#include <stdio.h>
/* ****************** sppp ****************** */
static int
{
mdb_warn("failed to read sps_list");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_ERR);
}
return (status);
}
static int
{
if (*qfmt)
mdb_printf("? unset ");
-1) {
} else {
}
if (IS_SPS_CONTROL(sps)) {
mdb_printf("Control\n");
} else if (IS_SPS_PIOATTACH(sps)) {
mdb_printf("Stats\n");
mdb_printf("Unknown\n");
mdb_printf("DLPI Unbound\n");
} else {
illaddr = 0;
break;
}
}
if (illaddr != 0) {
illaddr = 0;
}
}
switch (sps->sps_req_sap) {
case ETHERTYPE_IP:
mdb_printf("DLPI IPv4 ");
if (*qfmt) {
mdb_printf("\n");
} else if (illaddr == 0) {
mdb_printf("(no addresses)\n");
} else {
/*
* SCCS oddity here -- % <capital> %
* suffers from keyword replacement.
* Avoid that by using ANSI string
* pasting.
*/
mdb_printf("%I:%I" "%s\n",
}
break;
case ETHERTYPE_IPV6:
mdb_printf("DLPI IPv6 ");
if (*qfmt) {
mdb_printf("\n");
break;
}
if (illaddr == 0) {
mdb_printf("(no addresses)\n");
break;
}
"", "");
break;
case ETHERTYPE_ALLSAP:
mdb_printf("DLPI Snoop\n");
break;
default:
break;
}
}
return (WALK_NEXT);
}
static int
{
argc)
return (DCMD_USAGE);
if (qfmt) {
"RecvQ", "ZoneID", "Interface", "Type");
} else {
"ZoneID", "Interface", "Type");
}
}
if (flags & DCMD_ADDRSPEC) {
mdb_warn("failed to walk sps_list");
return (DCMD_ERR);
}
return (DCMD_OK);
}
static int
{
mdb_warn("failed to read ppa_list");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_ERR);
}
return (status);
}
/* ARGSUSED */
static int
{
return (WALK_NEXT);
}
/* ARGSUSED */
static int
{
"ZoneID", "Interface", "Control", "LowerQ");
}
if (flags & DCMD_ADDRSPEC) {
mdb_warn("failed to walk ppa_list");
return (DCMD_ERR);
}
return (DCMD_OK);
}
static void
{
sizeof (sps)) {
-1) {
} else {
}
}
}
static uintptr_t
{
return (NULL);
}
static uintptr_t
{
return (NULL);
sizeof (ppa))
return (NULL);
}
/* ****************** sppptun ****************** */
struct tcl_walk_data {
};
static void
{
}
}
static int
{
return (WALK_ERR);
mdb_warn("failed to read tcl_nslots");
return (WALK_ERR);
}
if (tcl_nslots == 0)
return (WALK_DONE);
mdb_warn("failed to read tcl_slots");
return (WALK_ERR);
}
return (WALK_ERR);
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
return (WALK_ERR);
}
return (status);
}
/* ARGSUSED */
static int
{
tcl->tcl_ctrl_tll);
mdb_printf("<daemon>\n");
} else {
}
return (WALK_NEXT);
}
/* ARGSUSED */
static int
{
mdb_printf("%<u>%?s %-6s %?s %?s Ty LSes RSes %s%</u>\n",
"Address", "ZoneID", "Data", "Control", "Interface");
}
if (flags & DCMD_ADDRSPEC) {
else
-1) {
mdb_warn("failed to walk tcl_slots");
return (DCMD_ERR);
}
return (DCMD_OK);
}
struct tll_walk_data {
void *listhead;
void *next;
};
static void
{
}
}
static int
{
mdb_warn("failed to find tunll_list");
return (WALK_ERR);
}
mdb_warn("can't read tunll_list at %p",
return (WALK_ERR);
}
return (WALK_ERR);
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
/* LINTED */
return (WALK_ERR);
}
return (status);
}
/* ARGSUSED */
static int
{
mdb_printf(" %x:%x:%x:%x:%x:%x",
}
mdb_printf("\n");
return (WALK_NEXT);
}
/* ARGSUSED */
static int
{
"ZoneID", "Interface Name", "Daemon", "Local Address");
}
if (flags & DCMD_ADDRSPEC) {
else
-1) {
mdb_warn("failed to walk tunll_list");
return (DCMD_ERR);
}
return (DCMD_OK);
}
union tun_state {
};
static int
{
/*
* First, get the flags on this structure. This is either a
* tuncl_t or a tunll_t.
*/
return (0);
}
} else {
return (0);
}
}
}
return (-1);
}
static void
{
return;
else
}
static uintptr_t
{
return (NULL);
} else {
/* Not quite right, but ... */
}
}
static uintptr_t
{
return (NULL);
return (NULL);
return (NULL);
}
}
}
{ "tuncl", "", "display sppptun client stream state structures",
tuncl },
{ "tunll", "", "display sppptun lower stream state structures",
tunll },
{ NULL }
};
{ "sppp", "walk active spppstr_t structures",
{ "sppa", "walk active sppa_t structures",
{ "tuncl", "walk active tuncl_t structures",
{ "tunll", "walk active tunll_t structures",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}
void
_mdb_fini(void)
{
}