]>
The Tcpdump Group git mirrors - tcpdump/blob - print-esp.c
97ab366e2a80ba73e39a86f0595623685a3076ca
1 /* $NetBSD: print-ah.c,v 1.4 1996/05/20 00:41:16 fvdl Exp $ */
4 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that: (1) source code distributions
9 * retain the above copyright notice and this paragraph in its entirety, (2)
10 * distributions including binary code include the above copyright notice and
11 * this paragraph in its entirety in the documentation or other materials
12 * provided with the distribution, and (3) all advertising materials mentioning
13 * features or use of this software display the following acknowledgement:
14 * ``This product includes software developed by the University of California,
15 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 * the University nor the names of its contributors may be used to endorse
17 * or promote products derived from this software without specific prior
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26 "@(#) Header: print-ah.c,v 1.37 94/06/10 17:01:42 mccanne Exp (LBL)";
29 #include <sys/param.h>
31 #include <sys/types.h>
32 #include <sys/socket.h>
34 #include <netinet/in.h>
35 #include <netinet/in_systm.h>
36 #include <netinet/ip.h>
37 #include <netinet/ip_var.h>
38 #include <netinet/udp.h>
39 #include <netinet/udp_var.h>
41 #undef NOERROR /* Solaris sucks */
42 #include <arpa/nameser.h>
43 #include <arpa/tftp.h>
53 #include "interface.h"
54 #include "addrtoname.h"
55 #include "appletalk.h"
60 extern int packettype
;
64 esp_print(register const u_char
*bp
, int length
, register const u_char
*bp2
)
66 register const struct ip
*ip
;
67 register const u_char
*cp
, *nh
;
68 u_short ahlen
, authlen
;
71 ip
= (struct ip
*)bp2
;
73 (void)printf("ESP %s > %s\n\t\t",
74 ipaddr_string(&ip
->ip_src
),
75 ipaddr_string(&ip
->ip_dst
));
78 (void)printf(" [|esp] truncated-esp %d", length
);
82 spi
= ntohl(*((u_long
*)(bp
)));
83 seqno
= ntohl(*((u_long
*)(bp
+4)));
87 (void)printf("spi:%08x seqno:%d ciphertext: ", spi
, seqno
);
88 (void)default_print_unaligned(bp
+8, length
-8);
90 /* XXX it would be nice to decrypt! */