/*
* 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) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <at.h>
#include <snoop.h>
char *print_macaddr(uint8_t *, int);
static char *zip_flags(char);
static char *zip_flags_long(char);
void
{
int cnt;
uint8_t *p;
goto out;
case ZIP_QUERY:
break;
case ZIP_REPLY:
case ZIP_EXT_REPLY:
break;
case ZIP_GET_NET_INFO:
goto out;
"ZIP GNI Zone = \"%.*s\"", p[6], &p[7]);
break;
case ZIP_GET_NET_INFO_REPLY:
gniflags = p[1];
"ZIP GNI Rep Flags 0x%x (%s)",
break;
default:
break;
}
}
show_space();
"Length = %d", len);
goto out;
case ZIP_QUERY:
while (cnt--) {
if (p+2 > tail)
goto out;
p += 2;
}
break;
case ZIP_REPLY:
case ZIP_EXT_REPLY:
"Reply, Network count = %d", cnt);
while (cnt--) {
if (p+2 > tail)
goto out;
p += 2;
goto out;
"Network = %d, Zone = \"%.*s\"",
net, p[0], &p[1]);
p += p[0] + 1;
}
break;
case ZIP_GET_NET_INFO:
goto out;
"GetNetInfo Zone = \"%.*s\"", p[0], &p[1]);
break;
case ZIP_GET_NET_INFO_REPLY:
if (p+5 > tail)
goto out;
gniflags = p[1];
goto out;
"%.*s", p[6], &p[7]);
p = &p[7] + p[6];
if ((gniflags & ZIP_FLG_USEBRC) == 0) {
goto out;
"Multicast address = %s",
print_macaddr(&p[1], p[0]));
}
if (gniflags & ZIP_FLG_ZINV) {
p = &p[1] + p[0];
goto out;
"Default Zone = \"%.*s\"",
p[0], &p[1]);
}
"GetNetInfo Reply, Flags 0x%x (%s)",
"Zone = \"%s\"", zone);
if (mcast[0])
"%s", mcast);
if (defzone[0])
"%s", defzone);
break;
case ZIP_NOTIFY:
if (p+5 > tail)
goto out;
gniflags = p[1];
goto out;
"%.*s", p[6], &p[7]);
p = &p[7] + p[6];
if ((gniflags & ZIP_FLG_USEBRC) == 0) {
goto out;
"New Multicast address = %s",
print_macaddr(&p[1], p[0]));
}
goto out;
p = &p[1] + p[0];
goto out;
"New Default Zone = \"%.*s\"",
p[0], &p[1]);
"Notify, Flags 0x%x (%s)",
"Old Zone = \"%s\"", zone);
if (mcast[0])
if (defzone[0])
break;
default:
break;
}
}
return;
out:
"ZIP (short packet)");
"ZIP (short packet)");
}
static char *
{
char *p = buf;
buf[0] = '\0';
if (flags & ZIP_FLG_ZINV)
if (flags & ZIP_FLG_USEBRC)
if (flags & ZIP_FLG_ONEZ)
return (buf);
}
static char *
{
char *p = buf;
buf[0] = '\0';
if (flags & ZIP_FLG_ZINV)
if (flags & ZIP_FLG_USEBRC)
if (flags & ZIP_FLG_ONEZ)
return (buf);
}
void
{
int cnt;
if (len < 0) {
"ZIP (short packet)");
return;
}
case ATP_TREQ:
case ZIP_ATP_GETMYZONE:
"ZIP GetMyZone");
break;
case ZIP_ATP_GETZONELIST:
"ZIP GetZoneList");
break;
case ZIP_ATP_GETLOCALZONES:
"ZIP GetLocalZones");
break;
}
break;
case ATP_TRESP:
break;
}
}
show_space();
if (len < 0) {
"ZIP (short packet)");
return;
}
case ATP_TREQ:
case ZIP_ATP_GETMYZONE:
"GetMyZone, Start Index = %d",
break;
case ZIP_ATP_GETZONELIST:
"GetZoneList, Start Index = %d",
break;
case ZIP_ATP_GETLOCALZONES:
"GetLocalZones, Start Index = %d",
break;
}
break;
case ATP_TRESP:
"ZoneReply, Number of Zones = %d, Length = %d",
while (cnt--) {
"ZoneReply (short packet)");
return;
}
}
break;
}
}
}