summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/esp.h
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
committerume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
commit832f8d224926758a9ae0b23a6b45353e44fbc87a (patch)
treea79fc7ad2b97862c4a404f352f0211ad93a7b5f1 /sys/netinet6/esp.h
parent2693854b01a52b0395a91322aa3edf926bddff38 (diff)
downloadFreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.zip
FreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.tar.gz
Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
Diffstat (limited to 'sys/netinet6/esp.h')
-rw-r--r--sys/netinet6/esp.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/sys/netinet6/esp.h b/sys/netinet6/esp.h
index 95deec3..6f794a8 100644
--- a/sys/netinet6/esp.h
+++ b/sys/netinet6/esp.h
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: esp.h,v 1.8 2000/07/02 13:23:33 itojun Exp $ */
+/* $KAME: esp.h,v 1.16 2000/10/18 21:28:00 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -37,7 +37,9 @@
#ifndef _NETINET6_ESP_H_
#define _NETINET6_ESP_H_
-struct secasvar;
+#if defined(_KERNEL) && !defined(_LKM)
+#include "opt_inet.h"
+#endif
struct esp {
u_int32_t esp_spi; /* ESP */
@@ -67,35 +69,41 @@ struct esptail {
/*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/
};
-struct esp_algorithm_state {
- struct secasvar *sav;
- void* foo; /*per algorithm data - maybe*/
-};
+#ifdef _KERNEL
+struct secasvar;
-/* XXX yet to be defined */
struct esp_algorithm {
size_t padbound; /* pad boundary, in byte */
+ int ivlenval; /* iv length, in byte */
int (*mature) __P((struct secasvar *));
int keymin; /* in bits */
int keymax; /* in bits */
+ int (*schedlen) __P((const struct esp_algorithm *));
const char *name;
- int (*ivlen) __P((struct secasvar *));
+ int (*ivlen) __P((const struct esp_algorithm *, struct secasvar *));
int (*decrypt) __P((struct mbuf *, size_t,
- struct secasvar *, struct esp_algorithm *, int));
+ struct secasvar *, const struct esp_algorithm *, int));
int (*encrypt) __P((struct mbuf *, size_t, size_t,
- struct secasvar *, struct esp_algorithm *, int));
+ struct secasvar *, const struct esp_algorithm *, int));
+ /* not supposed to be called directly */
+ int (*schedule) __P((const struct esp_algorithm *, struct secasvar *));
+ int (*blockdecrypt) __P((const struct esp_algorithm *,
+ struct secasvar *, u_int8_t *, u_int8_t *));
+ int (*blockencrypt) __P((const struct esp_algorithm *,
+ struct secasvar *, u_int8_t *, u_int8_t *));
};
-#ifdef _KERNEL
-extern struct esp_algorithm esp_algorithms[];
+extern const struct esp_algorithm *esp_algorithm_lookup __P((int));
+extern int esp_max_ivlen __P((void));
/* crypt routines */
extern int esp4_output __P((struct mbuf *, struct ipsecrequest *));
extern void esp4_input __P((struct mbuf *, ...));
extern size_t esp_hdrsiz __P((struct ipsecrequest *));
-#endif /*_KERNEL*/
+extern int esp_schedule __P((const struct esp_algorithm *, struct secasvar *));
extern int esp_auth __P((struct mbuf *, size_t, size_t,
struct secasvar *, u_char *));
+#endif /*_KERNEL*/
#endif /*_NETINET6_ESP_H_*/
OpenPOWER on IntegriCloud