+/* $FreeBSD: src/sys/netinet6/ah.h,v 1.3.2.2 2001/07/03 11:01:49 ume Exp $ */
+/* $KAME: ah.h,v 1.13 2000/10/18 21:28:00 itojun Exp $ */
+
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
#ifndef _NETINET6_AH_H_
#define _NETINET6_AH_H_
-
-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__)
-#if defined(_KERNEL) && !defined(_LKM)
-#include "opt_inet.h"
-#endif
-#endif
-
-#include <netkey/keydb.h> /* for struct secasvar */
+#include <sys/appleapiopts.h>
struct ah {
u_int8_t ah_nxt; /* Next Header */
/* variable size, 32bit bound*/ /* Authentication data */
};
+#ifdef KERNEL_PRIVATE
+struct secasvar;
+
struct ah_algorithm_state {
struct secasvar *sav;
void* foo; /*per algorithm data - maybe*/
};
struct ah_algorithm {
- int (*sumsiz) __P((struct secasvar *));
- int (*mature) __P((struct secasvar *));
+ int (*sumsiz)(struct secasvar *);
+ int (*mature)(struct secasvar *);
int keymin; /* in bits */
int keymax; /* in bits */
- void (*init) __P((struct ah_algorithm_state *, struct secasvar *));
- void (*update) __P((struct ah_algorithm_state *, caddr_t, size_t));
- void (*result) __P((struct ah_algorithm_state *, caddr_t));
+ const char *name;
+ int (*init)(struct ah_algorithm_state *, struct secasvar *);
+ void (*update)(struct ah_algorithm_state *, caddr_t, size_t);
+ void (*result)(struct ah_algorithm_state *, caddr_t);
};
#define AH_MAXSUMSIZE 16
-#ifdef KERNEL
-extern struct ah_algorithm ah_algorithms[];
-
-struct inpcb;
-#if INET6
-struct in6pcb;
-#endif
+extern const struct ah_algorithm *ah_algorithm_lookup(int);
/* cksum routines */
-extern int ah_hdrlen __P((struct secasvar *));
-
-extern size_t ah_hdrsiz __P((struct ipsecrequest *));
-extern void ah4_input __P((struct mbuf *, int));
-extern int ah4_output __P((struct mbuf *, struct ipsecrequest *));
-extern int ah4_calccksum __P((struct mbuf *, caddr_t,
- struct ah_algorithm *, struct secasvar *));
-
-#if INET6
-extern int ah6_input __P((struct mbuf **, int *, int));
-extern int ah6_output __P((struct mbuf *, u_char *, struct mbuf *,
- struct ipsecrequest *));
-extern int ah6_calccksum __P((struct mbuf *, caddr_t,
- struct ah_algorithm *, struct secasvar *));
-#endif /* INET6 */
+extern int ah_hdrlen(struct secasvar *);
-#endif /*KERNEL*/
+extern size_t ah_hdrsiz(struct ipsecrequest *);
+extern void ah4_input(struct mbuf *, int);
+extern int ah4_output(struct mbuf *, struct ipsecrequest *);
+extern int ah4_calccksum(struct mbuf *, caddr_t, size_t,
+ const struct ah_algorithm *, struct secasvar *);
+#endif KERNEL_PRIVATE
-#endif /*_NETINET6_AH_H_*/
+#endif _NETINET6_AH_H_