ipsec6.h revision 180636
1281348Scy/* $FreeBSD: head/sys/netipsec/ipsec6.h 180636 2008-07-20 17:51:58Z trhodes $ */ 2281348Scy/* $KAME: ipsec.h,v 1.44 2001/03/23 08:08:47 itojun Exp $ */ 3281348Scy 4281348Scy/*- 5281348Scy * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6281348Scy * All rights reserved. 7281348Scy * 8281348Scy * Redistribution and use in source and binary forms, with or without 9281348Scy * modification, are permitted provided that the following conditions 10281348Scy * are met: 11281348Scy * 1. Redistributions of source code must retain the above copyright 12281348Scy * notice, this list of conditions and the following disclaimer. 13310419Sdelphij * 2. Redistributions in binary form must reproduce the above copyright 14281348Scy * notice, this list of conditions and the following disclaimer in the 15310419Sdelphij * documentation and/or other materials provided with the distribution. 16281348Scy * 3. Neither the name of the project nor the names of its contributors 17310419Sdelphij * may be used to endorse or promote products derived from this software 18281348Scy * without specific prior written permission. 19281348Scy * 20281348Scy * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 21281348Scy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22281348Scy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23281348Scy * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 24281348Scy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25281348Scy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26281348Scy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27281348Scy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28281348Scy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29281348Scy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30281348Scy * SUCH DAMAGE. 31281348Scy */ 32281348Scy 33281348Scy/* 34281348Scy * IPsec controller part. 35281348Scy */ 36281348Scy 37281348Scy#ifndef _NETIPSEC_IPSEC6_H_ 38281348Scy#define _NETIPSEC_IPSEC6_H_ 39281348Scy 40281348Scy#include <net/pfkeyv2.h> 41281348Scy#include <netipsec/keydb.h> 42281348Scy 43281348Scy#ifdef _KERNEL 44290000Sglebiusextern struct ipsecstat ipsec6stat; 45281348Scyextern int ip6_esp_trans_deflev; 46281348Scyextern int ip6_esp_net_deflev; 47281348Scyextern int ip6_ah_trans_deflev; 48281348Scyextern int ip6_ah_net_deflev; 49281348Scyextern int ip6_ipsec_ecn; 50281348Scy 51281348Scystruct inpcb; 52281348Scy 53281348Scyextern int ipsec6_delete_pcbpolicy __P((struct inpcb *)); 54281348Scyextern int ipsec6_set_policy __P((struct inpcb *inp, int optname, 55281348Scy caddr_t request, size_t len, struct ucred *cred)); 56281348Scyextern int ipsec6_get_policy 57281348Scy __P((struct inpcb *inp, caddr_t request, size_t len, struct mbuf **mp)); 58281348Scyextern int ipsec6_in_reject __P((struct mbuf *, struct inpcb *)); 59281348Scy 60281348Scystruct tcp6cb; 61281348Scy 62281348Scyextern size_t ipsec6_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); 63281348Scy 64281348Scystruct ip6_hdr; 65281348Scyextern const char *ipsec6_logpacketstr __P((struct ip6_hdr *, u_int32_t)); 66281348Scy 67281348Scystruct m_tag; 68281348Scyextern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto); 69281348Scyextern int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, 70281348Scy int skip, int protoff, struct m_tag *mt); 71281348Scyextern void esp6_ctlinput(int, struct sockaddr *, void *); 72281348Scy 73281348Scystruct ipsec_output_state; 74281348Scyextern int ipsec6_output_trans __P((struct ipsec_output_state *, u_char *, 75281348Scy struct mbuf *, struct secpolicy *, int, int *)); 76281348Scyextern int ipsec6_output_tunnel __P((struct ipsec_output_state *, 77281348Scy struct secpolicy *, int)); 78281348Scy#endif /*_KERNEL*/ 79281348Scy 80281348Scy#endif /*_NETIPSEC_IPSEC6_H_*/ 81281348Scy