/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include <string.h>
#include <netinet/in_systm.h>
#include <netinet/if_ether.h>
#include "snoop.h"
#include "snoop_ospf.h"
#include "snoop_ospf6.h"
extern char *dlc_header;
static char *sum_line;
extern const struct bits ospf_db_flags_bits[];
extern const struct bits ospf_rla_flag_bits[];
extern const struct bits ospf_option_bits[];
{ OSPF_OPTION_V6, "V6" },
{ OSPF_OPTION_E, "E" },
{ OSPF_OPTION_MC, "MC" },
{ OSPF_OPTION_N, "N" },
{ OSPF_OPTION_R, "R" },
{ OSPF_OPTION_DC, "DC" },
{ 0, NULL }
};
/*
* return a printable string in dotted-decimal notation
* for id.
*/
static char *
{
}
static int
{
int j;
return (-1); /* truncated packet */
}
}
j = 0;
return (-1); /* truncated */
++nbr;
j++;
}
}
show_space();
"Interface ID = %s",
"Hello interval = %d",
"Designated Router = %s",
}
"Backup Designated Router = %s",
}
return (-1); /* truncated */
++nbr;
}
}
return (fraglen);
}
static void
{
return;
switch (ls6_type & LS6_SCOPE_MASK) {
case LS6_SCOPE_LINKLOCAL:
break;
case LS6_SCOPE_AREA:
break;
case LS6_SCOPE_AS:
break;
default:
break;
}
switch (ls6_type & LS_TYPE_MASK) {
case LS_TYPE_ROUTER:
}
break;
case LS_TYPE_NETWORK:
"%s Net DR %s IF %s", scope,
}
break;
case LS_TYPE_INTER_AP:
"%s Inter-area-prefix = %s ABR %s", scope,
}
break;
case LS_TYPE_INTER_AR:
"%s Inter-area-router = %s Router %s", scope,
}
break;
case LS_TYPE_ASE:
"%s ASE = %s ASBR %s", scope,
}
break;
case LS_TYPE_GROUP:
"%s group = %s Router %s", scope,
}
break;
case LS_TYPE_TYPE7:
"%s Type 7 = %s Router %s", scope,
}
break;
case LS_TYPE_LINK:
"%s link = %s Router %s", scope,
}
break;
case LS_TYPE_INTRA_AP:
"%s Inter-area-prefix = %s Router %s", scope,
}
break;
default:
"%s Unknown type = 0x%x", ls6_type);
}
break;
}
}
static int
{
int k;
if (k * 4 > sizeof (struct in6_addr)) {
}
}
}
}
}
}
}
}
}
static void
{
return;
}
lsah->ls6_router);
}
static int
{
int k, j;
return (-1);
case LS_TYPE_ROUTER|LS6_SCOPE_AREA:
return (-1);
(void) ospf_print_bits(ospf_rla_flag_bits,
return (-1);
(void) ospf_print_bits(ospf_option_bits,
return (-1);
return (-1);
}
case RLA_TYPE_VIRTUAL:
}
get_line_remain(), "Virtual Link");
}
/* FALLTHROUGH */
case RLA_TYPE_ROUTER:
}
get_line_remain(), "Neighbor = %s",
"Interface = %s id %s",
}
break;
case RLA_TYPE_TRANSIT:
}
"Designated Router = %s",
"DR Interface = %s id %s",
}
break;
default:
"Unknown link type %d",
}
"Unknown link type %d",
}
}
}
get_line_remain(), " metric = %d",
}
}
rl++;
return (-1); /* truncated */
}
break;
case LS_TYPE_NETWORK | LS6_SCOPE_AREA:
return (-1);
(void) ospf_print_bits(ospf6_option_bits,
}
"Routers:");
}
return (-1); /* truncated */
}
}
++addr;
}
break;
case LS_TYPE_INTER_AP | LS6_SCOPE_AREA:
return (-1);
}
"Metric = %s",
}
return (-1);
return (-1);
}
break;
case LS_TYPE_LINK:
return (-1);
return (-1);
}
"Link Local addr %d", addrstr);
}
return (-1);
}
break;
case LS_TYPE_INTRA_AP | LS6_SCOPE_AREA:
return (-1);
return (-1);
}
}
for (j = 0;
return (-1);
}
break;
default:
}
}
break;
}
return (0);
}
int
{
if ((fraglen < OSPF6_MIN_HEADER_SIZE) ||
return (fraglen); /* incomplete header */
"ospfv2 packet in ipv6 header");
} else {
return (fraglen);
}
}
ospf->ospf6_type);
}
show_space();
}
return (fraglen);
}
sum_line = (char *)get_sum_line();
}
show_space();
}
switch (ospf->ospf6_type) {
case OSPF_TYPE_HELLO:
break;
case OSPF_TYPE_DB:
if (fraglen < OSPF6_MIN_HEADER_SIZE +
break;
}
}
fraglen);
show_space();
"Options = %s", ospf_print_bits(
"Flags = %s", ospf_print_bits(
/* Print all the LS advs */
break;
}
++lsah;
}
}
break;
case OSPF_TYPE_LSR:
if (fraglen < OSPF6_MIN_HEADER_SIZE +
break;
}
fraglen);
show_space();
}
nlsah = 0;
break;
}
nlsah++;
}
++lsr;
}
}
break;
case OSPF_TYPE_LSU:
if (fraglen < OSPF6_MIN_HEADER_SIZE +
break;
}
fraglen);
show_space();
}
break;
}
while (nlsa-- != 0) {
fragend) ||
fragend)) {
break;
}
break;
}
}
break;
case OSPF_TYPE_LSA:
fraglen);
show_space();
}
nlsah = 0;
break;
}
nlsah++;
++lsah;
}
}
break;
default:
/* NOTREACHED */
break;
}
if (trunc) {
"--truncated");
}
return (fraglen);
}