snoop_mount.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 (c) 1991, 1999-2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ident "%Z%%M% %I% %E% SMI" /* SunOS */
#include <setjmp.h>
#include <string.h>
#include "snoop.h"
#include "snoop_nfs.h"
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
extern char *dlc_header;
static void mountcall(int, int);
static void mountreply(int, int);
static void sum_mountstat(char *);
static void sum_mountstat3(char *);
static char *sum_mountfh(void);
static char *sum_mountfh3(void);
static char *sum_exports(void);
static char *sum_mounts(void);
static int detail_mountstat(void);
static void detail_mountstat3(void);
static void detail_mountfh(void);
static void detail_mountfh3(void);
static void detail_exports(void);
static void detail_mounts(void);
static char *statusmsg3(ulong_t);
static char *procnames_short[] = {
"Null", /* 0 */
"Mount", /* 1 */
"Get mount list", /* 2 */
"Unmount", /* 3 */
"Unmountall", /* 4 */
"Get export list", /* 5 */
"Get export list", /* 6 */
"PATHCONF", /* 7 */
};
static char *procnames_long[] = {
"Null procedure", /* 0 */
"Add mount entry", /* 1 */
"Return mount entries", /* 2 */
"Remove mount entry", /* 3 */
"Remove all mount entries", /* 4 */
"Return export list", /* 5 */
"Return export list", /* 6 */
"Get POSIX Pathconf info", /* 7 */
};
#define MAXPROC 7
void
char *data;
int len;
{
char *line;
return;
return;
}
line = get_sum_line();
switch (proc) {
case MOUNTPROC_MNT:
case MOUNTPROC_UMNT:
break;
case MOUNTPROC_DUMP:
case MOUNTPROC_UMNTALL:
case MOUNTPROC_EXPORT:
case MOUNTPROC_EXPORTALL:
#ifdef MOUNTPROC_PATHCONF
case MOUNTPROC_PATHCONF:
if (vers != 3)
MNTPATHLEN));
#endif
break;
default:
break;
}
} else {
switch (proc) {
case MOUNTPROC_MNT:
if (vers == 3)
else
break;
case MOUNTPROC_DUMP:
break;
case MOUNTPROC_UMNT:
case MOUNTPROC_UMNTALL:
break;
case MOUNTPROC_EXPORTALL:
/*
* EXPORTALL is the same as EXPORT in v1
* and v2, and it doesn't exist in v3.
*/
if (vers == 3)
break;
/*FALLTHROUGH*/
case MOUNTPROC_EXPORT:
break;
#ifdef MOUNTPROC_PATHCONF
case MOUNTPROC_PATHCONF:
if (vers != 2)
break;
#ifdef notyet
#endif
break;
#endif
default:
break;
}
}
}
show_space();
return;
}
"Proc = %d (%s)",
else
show_trailer();
}
}
/*
* Interpret call packets in detail
*/
static void
{
switch (proc) {
case MOUNTPROC_MNT:
case MOUNTPROC_UMNT:
break;
case MOUNTPROC_DUMP:
break;
case MOUNTPROC_UMNTALL:
break;
case MOUNTPROC_EXPORTALL:
if (vers == 3)
break;
break;
case MOUNTPROC_EXPORT:
break;
#ifdef MOUNTPROC_PATHCONF
case MOUNTPROC_PATHCONF:
if (vers != 2)
break;
#endif
break;
default:
break;
}
}
/*
* Interpret reply packets in detail
*/
static void
{
switch (proc) {
case MOUNTPROC_MNT:
if (vers == 3) {
} else {
if (detail_mountstat() == 0) {
}
}
break;
case MOUNTPROC_DUMP:
break;
case MOUNTPROC_UMNT:
case MOUNTPROC_UMNTALL:
(void) detail_mountstat();
break;
case MOUNTPROC_EXPORTALL:
if (vers == 3)
break;
/*FALLTHROUGH*/
case MOUNTPROC_EXPORT:
break;
#ifdef MOUNTPROC_PATHCONF
case MOUNTPROC_PATHCONF:
#ifdef notyet
(void) detail_ppathcnf();
#endif
break;
#endif
default:
break;
}
}
static void
char *line;
{
char *str;
status = getxdr_u_long();
if (status == 0)
str = "OK";
str = "";
if (status == 0) {
}
}
static int
{
char *str;
status = getxdr_u_long();
if (status == 0)
str = "OK";
str = "";
return ((int)status);
}
char *
{
int fh;
static char buff[8];
return (buff);
}
static void
{
int pos;
int fh;
pos = getxdr_pos();
}
static char *
{
char *p;
static char buff[64];
buff[0] = '\0';
flavors = getxdr_long();
for (i = 0; i < flavors; i++) {
if (i > 0)
switch (auth = getxdr_u_long()) {
case AUTH_NONE:
break;
case AUTH_UNIX:
break;
case AUTH_SHORT:
break;
case AUTH_DES:
break;
default:
"%d", auth);
break;
}
}
return (buff);
}
static void
char *line;
{
status = getxdr_u_long();
if (status == 0) {
}
}
static void
{
status = getxdr_u_long();
statusmsg3(status));
if (status == 0) {
print_auth());
}
}
char *
{
int len;
int fh;
static char buff[8];
len = getxdr_long();
return (buff);
}
static void
{
int pos;
int i, l, len;
int fh;
len = getxdr_long();
pos = getxdr_pos();
i = 0;
while (i < len) {
(void) showxdr_hex(l, " %s");
i += l;
}
}
static char *
{
int entries = 0;
return (buff);
}
while (getxdr_long()) {
while (getxdr_long()) {
}
entries++;
}
return (buff);
}
static void
{
int entries = 0;
" %d+ entries. (Frame is incomplete)",
entries);
return;
}
while (getxdr_long()) {
entries++;
while (getxdr_long()) {
}
}
}
static char *
{
int entries = 0;
return (buff);
}
while (getxdr_long()) {
entries++;
}
return (buff);
}
static void
{
int entries = 0;
" %d+ entries. (Frame is incomplete)",
entries);
return;
}
while (getxdr_long()) {
entries++;
}
}
char *
{
switch (status) {
case MNT_OK:
return ("OK");
case MNT3ERR_PERM:
return ("Not owner");
case MNT3ERR_NOENT:
return ("No such file or directory");
case MNT3ERR_IO:
return ("I/O error");
case MNT3ERR_ACCES:
return ("Permission denied");
case MNT3ERR_NOTDIR:
return ("Not a directory");
case MNT3ERR_INVAL:
return ("Invalid argument");
case MNT3ERR_NAMETOOLONG:
return ("File name too long");
case MNT3ERR_NOTSUPP:
return ("Operation not supported");
case MNT3ERR_SERVERFAULT:
return ("Server error");
default:
return ("(unknown error)");
}
}