/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <sys/sysmacros.h>
#include <netinet/in_systm.h>
#include <netinet/if_ether.h>
#include <inet/ipsecesp.h>
#include "snoop.h"
/* ARGSUSED */
int
{
/* LINTED: alignment */
char *line;
return (fraglen); /* incomplete header */
aligned_esph = &storage;
} else {
aligned_esph = esph;
}
line = (char *)get_sum_line();
/*
* sprintf() is safe because line guarantees us 80 columns,
* and SPI and replay certainly won't exceed that.
*/
}
sizeof (esph_t));
show_space();
/*
* sprintf() is safe because get_line guarantees us 80 columns,
* and SPI and replay certainly won't exceed that.
*/
4), " ....ENCRYPTED DATA....");
}
return (sizeof (esph_t));
}
int
{
/* LINTED: alignment */
int new_iplen;
return (fraglen); /* incomplete header */
} else {
aligned_ah = ah;
}
/*
* "+ 8" is for the "constant" part that's not included in the AH
* length.
*
* The AH RFC specifies the length field in "length in 4-byte units,
* not counting the first 8 bytes". So if an AH is 24 bytes long,
* the length field will contain "4". (4 * 4 + 8 == 24).
*/
if (fraglen < 0)
line = (char *)get_sum_line();
}
show_space();
2), "<Reserved field = 0x%x>",
/*
* 2 for two hex digits per auth_data byte
* plus one byte for trailing null byte.
*/
int i;
for (i = 0; i < auth_data_len; i++)
}
auth_data_len), "ICV = %s",
/* malloc(3c) says I can call free even if buff == NULL */
show_space();
}
/*
* Print IPv6 Extension Headers, or skip them in the summary case.
*/
&fraglen);
}
if (fraglen > 0)
switch (proto) {
case IPPROTO_ENCAP:
/* LINTED: alignment */
break;
case IPPROTO_IPV6:
break;
case IPPROTO_ICMP:
(void) interpret_icmp(flags,
/* LINTED: alignment */
break;
case IPPROTO_ICMPV6:
/* LINTED: alignment */
break;
case IPPROTO_TCP:
(void) interpret_tcp(flags,
break;
case IPPROTO_ESP:
fraglen);
break;
case IPPROTO_AH:
fraglen);
break;
case IPPROTO_UDP:
(void) interpret_udp(flags,
break;
/* default case is to not print anything else */
}
return (ahlen);
}