]> The Tcpdump Group git mirrors - tcpdump/commitdiff
move ah/esp struct declratiaon into separate header (ah.h and esp.h).
authoritojun <itojun>
Fri, 6 Oct 2000 11:32:17 +0000 (11:32 +0000)
committeritojun <itojun>
Fri, 6 Oct 2000 11:32:17 +0000 (11:32 +0000)
they are from KAME.

use ah.h and esp.h where necessary.

FILES
ah.h [new file with mode: 0644]
esp.h [new file with mode: 0644]
print-ah.c
print-esp.c
print-icmp6.c

diff --git a/FILES b/FILES
index 20f4f7a322e8af9b1b5d695838efd1cc914de23e..9a63b24aaa87b7f05066713d53d28d4c78f2878e 100644 (file)
--- 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 (file)
index 0000000..c22806a
--- /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 (file)
index 0000000..56cdada
--- /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_*/
index 173132eb42106ca0c7abae6d91c1269d43708e07..be1e67ce8ea0f2d60943fd49b4b56aeb750d7ea1 100644 (file)
@@ -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"
index 9090ffca3a73128af171e81f16ae24f454477637..1a64fe75d4c9ceeddb469a27fd416bafe6d243c9 100644 (file)
@@ -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"
index 9f746a9deb8258c6df36d7c0094b6746e73f3dec..2bcd432514a2efc3e76bac751b2e2d34e55c077f 100644 (file)
@@ -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 *);