summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoritojun <itojun>2000-10-06 11:32:17 +0000
committeritojun <itojun>2000-10-06 11:32:17 +0000
commitb0385536d7d62f061e2080ea873dea90f8cf8bc6 (patch)
treef6ad7fc1c89c3be66ef2a6835f28c34db1449f64
parent90a3f90f3ee256c0489fee5595b8622f83bad124 (diff)
downloadtcpdump-b0385536d7d62f061e2080ea873dea90f8cf8bc6.tar.gz
move ah/esp struct declratiaon into separate header (ah.h and esp.h).
they are from KAME. use ah.h and esp.h where necessary.
-rw-r--r--FILES2
-rw-r--r--ah.h57
-rw-r--r--esp.h68
-rw-r--r--print-ah.c20
-rw-r--r--print-esp.c26
-rw-r--r--print-icmp6.c5
6 files changed, 133 insertions, 45 deletions
diff --git a/FILES b/FILES
index 20f4f7a3..9a63b24a 100644
--- a/FILES
+++ b/FILES
@@ -9,6 +9,7 @@ acconfig.h
aclocal.m4
addrtoname.c
addrtoname.h
+ah.h
appletalk.h
atime.awk
bootp.h
@@ -21,6 +22,7 @@ configure.in
decnet.h
dhcp6.h
dhcp6opt.h
+esp.h
ether.h
ethertype.h
extract.h
diff --git a/ah.h b/ah.h
new file mode 100644
index 00000000..c22806af
--- /dev/null
+++ b/ah.h
@@ -0,0 +1,57 @@
+/* $NetBSD: ah.h,v 1.12 2000/07/23 05:23:04 itojun Exp $ */
+/* $KAME: ah.h,v 1.12 2000/07/20 17:41:01 itojun Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * RFC1826/2402 authentication header.
+ */
+
+#ifndef _NETINET6_AH_H_
+#define _NETINET6_AH_H_
+
+struct ah {
+ u_int8_t ah_nxt; /* Next Header */
+ u_int8_t ah_len; /* Length of data, in 32bit */
+ u_int16_t ah_reserve; /* Reserved for future use */
+ u_int32_t ah_spi; /* Security parameter index */
+ /* variable size, 32bit bound*/ /* Authentication data */
+};
+
+struct newah {
+ u_int8_t ah_nxt; /* Next Header */
+ u_int8_t ah_len; /* Length of data + 1, in 32bit */
+ u_int16_t ah_reserve; /* Reserved for future use */
+ u_int32_t ah_spi; /* Security parameter index */
+ u_int32_t ah_seq; /* Sequence number field */
+ /* variable size, 32bit bound*/ /* Authentication data */
+};
+
+#endif /*_NETINET6_AH_H_*/
diff --git a/esp.h b/esp.h
new file mode 100644
index 00000000..56cdada0
--- /dev/null
+++ b/esp.h
@@ -0,0 +1,68 @@
+/* $NetBSD: esp.h,v 1.13 2000/09/26 08:37:38 itojun Exp $ */
+/* $KAME: esp.h,v 1.15 2000/09/20 18:15:22 itojun Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * RFC1827/2406 Encapsulated Security Payload.
+ */
+
+#ifndef _NETINET6_ESP_H_
+#define _NETINET6_ESP_H_
+
+struct esp {
+ u_int32_t esp_spi; /* ESP */
+ /*variable size, 32bit bound*/ /* Initialization Vector */
+ /*variable size*/ /* Payload data */
+ /*variable size*/ /* padding */
+ /*8bit*/ /* pad size */
+ /*8bit*/ /* next header */
+ /*8bit*/ /* next header */
+ /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */
+};
+
+struct newesp {
+ u_int32_t esp_spi; /* ESP */
+ u_int32_t esp_seq; /* Sequence number */
+ /*variable size*/ /* (IV and) Payload data */
+ /*variable size*/ /* padding */
+ /*8bit*/ /* pad size */
+ /*8bit*/ /* next header */
+ /*8bit*/ /* next header */
+ /*variable size, 32bit bound*/ /* Authentication data */
+};
+
+struct esptail {
+ u_int8_t esp_padlen; /* pad length */
+ u_int8_t esp_nxt; /* Next header */
+ /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/
+};
+
+#endif /*_NETINET6_ESP_H_*/
diff --git a/print-ah.c b/print-ah.c
index 173132eb..be1e67ce 100644
--- a/print-ah.c
+++ b/print-ah.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.12 2000-10-06 04:23:10 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.13 2000-10-06 11:32:18 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -39,23 +39,7 @@ static const char rcsid[] =
#include <stdio.h>
-/* there's no standard definition so we are on our own */
-struct ah {
- u_int8_t ah_nxt; /* Next Header */
- u_int8_t ah_len; /* Length of data, in 32bit */
- u_int16_t ah_reserve; /* Reserved for future use */
- u_int32_t ah_spi; /* Security parameter index */
- /* variable size, 32bit bound*/ /* Authentication data */
-};
-
-struct newah {
- u_int8_t ah_nxt; /* Next Header */
- u_int8_t ah_len; /* Length of data + 1, in 32bit */
- u_int16_t ah_reserve; /* Reserved for future use */
- u_int32_t ah_spi; /* Security parameter index */
- u_int32_t ah_seq; /* Sequence number field */
- /* variable size, 32bit bound*/ /* Authentication data */
-};
+#include "ah.h"
#include "interface.h"
#include "addrtoname.h"
diff --git a/print-esp.c b/print-esp.c
index 9090ffca..1a64fe75 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.14 2000-10-06 04:23:11 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.15 2000-10-06 11:32:19 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -56,29 +56,7 @@ static const char rcsid[] =
#endif
#include "ip.h"
-
-/* there's no standard definition so we are on our own */
-struct esp {
- u_int32_t esp_spi; /* ESP */
- /*variable size, 32bit bound*/ /* Initialization Vector */
- /*variable size*/ /* Payload data */
- /*variable size*/ /* padding */
- /*8bit*/ /* pad size */
- /*8bit*/ /* next header */
- /*8bit*/ /* next header */
- /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */
-};
-
-struct newesp {
- u_int32_t esp_spi; /* ESP */
- u_int32_t esp_seq; /* Sequence number */
- /*variable size*/ /* (IV and) Payload data */
- /*variable size*/ /* padding */
- /*8bit*/ /* pad size */
- /*8bit*/ /* next header */
- /*8bit*/ /* next header */
- /*variable size, 32bit bound*/ /* Authentication data */
-};
+#include "esp.h"
#include "interface.h"
#include "addrtoname.h"
diff --git a/print-icmp6.c b/print-icmp6.c
index 9f746a9d..2bcd4325 100644
--- a/print-icmp6.c
+++ b/print-icmp6.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.32 2000-10-06 06:18:35 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.33 2000-10-06 11:32:19 itojun Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -40,8 +40,6 @@ static const char rcsid[] =
#include <netinet/in.h>
-#include <netinet6/ah.h>
-
#include <arpa/inet.h>
#include <stdio.h>
@@ -53,6 +51,7 @@ static const char rcsid[] =
#include "addrtoname.h"
#include "udp.h"
+#include "ah.h"
void icmp6_opt_print(const u_char *, int);
void mld6_print(const u_char *);