sockfs.c revision 2e3183c027b6ee946250860898d7ae82b066348a
/*
* 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 <sys/socketvar.h>
#include <mdb/mdb_modapi.h>
/*
* Look up the symbol name for the given sockparams list and walk
* all the entries.
*/
static boolean_t
{
return (B_FALSE);
}
return (B_FALSE);
}
return (B_TRUE);
}
/*
* dcmd to print sockparams info.
*
* If no address is given then the default is to print all sockparams on the
* global list (i.e., installed with soconfig(1)). To also print the ephemeral
* entries the '-e' flag should be used. Only ephemeral entries can be printed
* by specifying the '-E' flag.
*/
static int
{
struct sockparams sp;
char strdev[MAXPATHLEN];
char sockmod[MODMAXNAMELEN];
if ((flags & DCMD_ADDRSPEC) == 0) {
/*
* Determine what lists should be printed
*/
return (DCMD_USAGE);
if (!opt_E) {
return (DCMD_ERR);
}
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*
* If we are piping the output, then just print out the address,
* otherwise summarize the sockparams info.
*/
if ((flags & DCMD_PIPE_OUT) != 0) {
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%-?s %3s %3s %3s %15s %15s %6s %6s\n",
"ADDR", "FAM", "TYP", "PRO", "STRDEV", "SOCKMOD", "REFS",
"FLGS");
}
return (DCMD_ERR);
}
mdb_printf("%0?p %3u %3u %3u %15s %15s %6u %#6x\n",
addr,
return (DCMD_OK);
}
/*
* Help function
*/
void
sockparams_help(void)
{
mdb_printf("Print sockparams information for a give sockparams ptr.\n"
"Without the address, list available sockparams. Default "
"behavior is to list only entries that were installed by the "
"admin (via soconfig(1M)).\n\n"
"Options:\n"
" -e:\t\tlist ephemeral sockparams\n"
" -E:\t\tonly list ephemeral sockparams\n");
}
static const mdb_dcmd_t dcmds[] = {
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}