snoop_apple.c revision 2e3b64671f0fdac42d7fb21a8fa7e3ce9fce3359
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <at.h>
#include <snoop.h>
struct socktable {
int pt_num;
char *pt_short;
};
{1, "RTMP"},
{2, "NIS"},
{4, "Echoer"},
{6, "ZIS"},
{0, NULL},
};
static struct socktable pt_ddp_types[] = {
{1, "RTMP Resp"},
{2, "NBP"},
{3, "ATP"},
{4, "AEP"},
{5, "RTMP Req"},
{6, "ZIP"},
{7, "ADSP"},
{0, NULL},
};
static char *
{
for (; p->pt_num != 0; p++) {
return (p->pt_short);
}
return (NULL);
}
/*
* return the short at p, regardless of alignment
*/
{
return (p[0] << 8 | p[1]);
}
/*
* return the long at p, regardless of alignment
*/
{
return (p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]);
}
/*
* format a MAC address
*/
char *
{
static char buf[128];
char *p = buf;
while (len-- != 0) {
}
return (buf);
}
/* ARGSUSED */
void
{
int ddplen;
char *pname;
char buff [32];
static char src_buf[16];
static char dst_buf[16];
return; /* unknown AppleTalk proto */
dst_name = "(broadcast)";
else
"DDP S=%u.%u:%u D=%u.%u:%u LEN=%d",
}
show_space();
pname = "";
} else {
}
"Source = %s, Socket = %u %s",
pname = "";
} else {
}
"Destination = %s, Socket = %u %s",
"Hop count = %d",
"Length = %d",
"Checksum = %04x %s",
"DDP type = %d (%s)",
show_space();
}
/* go to the next protocol layer */
case DDP_TYPE_NBP:
break;
case DDP_TYPE_AEP:
break;
case DDP_TYPE_ATP:
break;
case DDP_TYPE_ZIP:
break;
case DDP_TYPE_ADSP:
break;
case DDP_TYPE_RTMPRQ:
case DDP_TYPE_RTMPRESP:
break;
}
}