/*
* 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 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
#include <setjmp.h>
#include <string.h>
#include <rpc/pmap_prot.h>
#include "snoop.h"
/*
* Number of bytes to display from a string (address, netid, etc.).
*/
extern char *dlc_header;
static void interpret_pmap_2(int, int, int, int, int, char *, int);
static void interpret_pmap_4(int, int, int, int, int, char *, int);
static void stash_callit(ulong_t, int, int, int, int);
void
char *data;
int len;
{
switch (vers) {
break;
/* Version 3 is a subset of version 4 */
case 3:
break;
}
}
void show_pmap();
char *sum_pmaplist();
void show_pmaplist();
static char *procnames_short_2[] = {
"Null", /* 0 */
"SET", /* 1 */
"UNSET", /* 2 */
"GETPORT", /* 3 */
"DUMP", /* 4 */
"CALLIT", /* 5 */
};
static char *procnames_long_2[] = {
"Null procedure", /* 0 */
"Set port", /* 1 */
"Unset port", /* 2 */
"Get port number", /* 3 */
"Dump the mappings", /* 4 */
"Indirect call", /* 5 */
};
void
char *data;
int len;
{
char *line;
extern int pi_frame;
struct cache_struct *x, *find_callit();
int trailer_done = 0;
return;
if (proc == PMAPPROC_CALLIT) {
iprog = getxdr_u_long();
ivers = getxdr_u_long();
iproc = getxdr_u_long();
} else {
x = find_callit(xid);
}
}
return;
}
line = get_sum_line();
switch (proc) {
case PMAPPROC_GETPORT:
iprog = getxdr_u_long();
ivers = getxdr_u_long();
proto = getxdr_u_long();
" prog=%d (%s) vers=%d proto=%s",
break;
case PMAPPROC_CALLIT:
" prog=%s vers=%d proc=%d",
(void) getxdr_u_long(); /* length */
len -= 16;
}
break;
default:
break;
}
} else {
switch (proc) {
case PMAPPROC_GETPORT:
port = getxdr_u_long();
break;
case PMAPPROC_DUMP:
break;
case PMAPPROC_CALLIT:
port = getxdr_u_long();
ilen = getxdr_u_long();
len -= 8;
x->xid_prog,
x->xid_vers,
x->xid_proc,
}
break;
default:
break;
}
}
}
show_space();
return;
}
"Proc = %d (%s)",
switch (proc) {
case PMAPPROC_NULL:
case PMAPPROC_SET:
case PMAPPROC_UNSET:
break;
case PMAPPROC_GETPORT:
iprog = getxdr_u_long();
"Program = %d (%s)",
(void) showxdr_u_long("Version = %d");
proto = getxdr_u_long();
"Protocol = %d (%s)",
break;
case PMAPPROC_DUMP:
break;
case PMAPPROC_CALLIT:
"Program = %d (%s)",
"Version = %d", ivers);
"Proc = %d", iproc);
(void) showxdr_u_long("Callit data = %d bytes");
show_trailer();
trailer_done = 1;
len -= 16;
break;
}
} else {
switch (proc) {
case PMAPPROC_NULL:
case PMAPPROC_SET:
case PMAPPROC_UNSET:
break;
case PMAPPROC_GETPORT:
(void) showxdr_u_long("Port = %d");
break;
case PMAPPROC_DUMP:
break;
case PMAPPROC_CALLIT:
(void) showxdr_u_long("Port = %d");
(void) showxdr_u_long("Length = %d bytes");
show_trailer();
trailer_done = 1;
if (x != NULL) {
x->xid_prog,
x->xid_vers,
x->xid_proc,
}
break;
}
}
if (!trailer_done)
show_trailer();
}
}
char *
{
int maps = 0;
return (buff);
}
while (getxdr_u_long()) {
(void) getxdr_u_long(); /* program */
(void) getxdr_u_long(); /* version */
(void) getxdr_u_long(); /* protocol */
(void) getxdr_u_long(); /* port */
maps++;
}
return (buff);
}
void
{
int maps = 0;
" %d+ maps. (Frame is incomplete)",
maps);
return;
}
while (getxdr_u_long()) {
prog = getxdr_u_long();
vers = getxdr_u_long();
proto = getxdr_u_long();
port = getxdr_u_long();
"%8d%8d%9d%7d %s",
maps++;
}
}
/*
* ******************************************
*/
char *sum_rpcblist();
void show_rpcblist();
char *sum_rpcb_entry_list();
void show_rpcb_entry_list();
static char *procnames_short_4[] = {
/*
* version 3 and 4 procs
*/
"Null", /* 0 */
"SET", /* 1 */
"UNSET", /* 2 */
"GETADDR", /* 3 */
"DUMP", /* 4 */
"BCAST", /* 5 */
"GETTIME", /* 6 */
"UADDR2TADDR", /* 7 */
"TADDR2UADDR", /* 8 */
/*
* version 4 procs only
*/
"GETVERSADDR", /* 9 */
"INDIRECT", /* 10 */
"GETADDRLIST", /* 11 */
"GETSTAT", /* 12 */
};
static char *procnames_long_4[] = {
/*
* version 3 and 4 procs
*/
"Null procedure", /* 0 */
"Set address", /* 1 */
"Unset address", /* 2 */
"Get address", /* 3 */
"Dump the mappings", /* 4 */
"Broadcast call (no error)", /* 5 */
"Get the time", /* 6 */
"Universal to transport address", /* 7 */
"Transport to universal address", /* 8 */
/*
* version 4 procs only
*/
"Get address of specific version", /* 9 */
"Indirect call (return error)", /* 10 */
"Get statistics", /* 12 */
};
#define RPCBPROC_NULL 0
void
char *data;
int len;
{
char *line;
extern int pi_frame;
struct cache_struct *x, *find_callit();
int trailer_done = 0;
return;
iprog = getxdr_u_long();
ivers = getxdr_u_long();
iproc = getxdr_u_long();
} else {
x = find_callit(xid);
}
}
return;
}
line = get_sum_line();
"RPCBIND C %s",
switch (proc) {
case RPCBPROC_SET:
case RPCBPROC_UNSET:
case RPCBPROC_GETADDR:
case RPCBPROC_GETVERSADDR:
case RPCBPROC_GETADDRLIST:
prog = getxdr_u_long();
ver = getxdr_u_long();
" prog=%d (%s) vers=%d",
ver);
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
" prog=%s vers=%d proc=%d",
(void) getxdr_u_long(); /* length */
len -= 16;
}
break;
default:
break;
}
} else {
int pos;
switch (proc) {
case RPCBPROC_GETADDR:
case RPCBPROC_TADDR2UADDR:
case RPCBPROC_GETVERSADDR:
" Uaddr=%s",
buff1);
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
pos = getxdr_pos();
ilen = getxdr_u_long();
x->xid_prog,
x->xid_vers,
x->xid_proc,
}
break;
case RPCBPROC_DUMP:
sum_rpcblist());
break;
case RPCBPROC_GETTIME:
{
"%d-%h-%y %T GMT", tmp);
}
break;
case RPCBPROC_GETADDRLIST:
break;
default:
break;
}
}
}
show_space();
return;
}
"Proc = %d (%s)",
switch (proc) {
case RPCBPROC_NULL:
break;
case RPCBPROC_SET:
case RPCBPROC_UNSET:
case RPCBPROC_GETADDR:
case RPCBPROC_GETVERSADDR:
case RPCBPROC_GETADDRLIST:
(void) showxdr_u_long("Program = %d");
(void) showxdr_u_long("Version = %d");
break;
case RPCBPROC_DUMP:
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
"Program = %d (%s)",
"Version = %d", ivers);
"Proc = %d", iproc);
(void) showxdr_u_long(
"Callit data = %d bytes");
show_trailer();
trailer_done = 1;
len -= 16;
break;
case RPCBPROC_GETTIME:
break;
case RPCBPROC_UADDR2TADDR:
case RPCBPROC_TADDR2UADDR:
break;
}
} else {
switch (proc) {
case RPCBPROC_NULL:
case RPCBPROC_SET:
case RPCBPROC_UNSET:
break;
case RPCBPROC_GETADDR:
case RPCBPROC_TADDR2UADDR:
case RPCBPROC_GETVERSADDR:
break;
case RPCBPROC_DUMP:
break;
case RPCBPROC_BCAST:
case RPCBPROC_INDIRECT:
(void) showxdr_u_long("Length = %d bytes");
show_trailer();
trailer_done = 1;
if (x != NULL) {
x->xid_prog,
x->xid_vers,
x->xid_proc,
}
break;
case RPCBPROC_GETTIME:
{
}
break;
case RPCBPROC_UADDR2TADDR:
break;
case RPCBPROC_GETADDRLIST:
break;
}
}
if (!trailer_done)
show_trailer();
}
}
char *
{
int maps = 0;
return (buff);
}
while (getxdr_u_long()) {
(void) getxdr_u_long(); /* program */
(void) getxdr_u_long(); /* version */
maps++;
}
return (buff);
}
void
{
int maps = 0;
" %d+ maps. (Frame is incomplete)",
maps);
return;
}
show_space();
" Program Vers Netid Uaddr Owner");
while (getxdr_u_long()) {
prog = getxdr_u_long();
vers = getxdr_u_long();
"%8d%5d %-12s %-18s %-10s (%s)",
nameof_prog(prog));
maps++;
}
}
char *
{
int maps = 0;
return (buff);
}
while (getxdr_u_long()) {
(void) getxdr_u_long(); /* nc_semantics */
maps++;
}
return (buff);
}
void
{
unsigned sem;
int maps = 0;
" %d+ maps. (Frame is incomplete)",
maps);
return;
}
show_space();
" Maddr Netid Semantics Protofmly Proto");
while (getxdr_u_long()) {
sem = getxdr_u_long();
"%-12s %-12s %-8s %-8s %-8s",
maps++;
}
}
struct cache_struct *
{
struct cache_struct *x;
return (x);
return (x);
return (NULL);
}
static void
{
struct cache_struct *x;
x = find_callit(xid);
if (x == NULL) {
x = cxcp++;
}
}