133841545SHajimu UMEMOTO /* $KAME: libpfkey.h,v 1.6 2001/03/05 18:22:17 thorpej Exp $ */ 23c62e87aSJun-ichiro itojun Hagino 3*8a16b7a1SPedro F. Giffuni /*- 4*8a16b7a1SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 5*8a16b7a1SPedro F. Giffuni * 63c62e87aSJun-ichiro itojun Hagino * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 73c62e87aSJun-ichiro itojun Hagino * All rights reserved. 83c62e87aSJun-ichiro itojun Hagino * 93c62e87aSJun-ichiro itojun Hagino * Redistribution and use in source and binary forms, with or without 103c62e87aSJun-ichiro itojun Hagino * modification, are permitted provided that the following conditions 113c62e87aSJun-ichiro itojun Hagino * are met: 123c62e87aSJun-ichiro itojun Hagino * 1. Redistributions of source code must retain the above copyright 133c62e87aSJun-ichiro itojun Hagino * notice, this list of conditions and the following disclaimer. 143c62e87aSJun-ichiro itojun Hagino * 2. Redistributions in binary form must reproduce the above copyright 153c62e87aSJun-ichiro itojun Hagino * notice, this list of conditions and the following disclaimer in the 163c62e87aSJun-ichiro itojun Hagino * documentation and/or other materials provided with the distribution. 173c62e87aSJun-ichiro itojun Hagino * 3. Neither the name of the project nor the names of its contributors 183c62e87aSJun-ichiro itojun Hagino * may be used to endorse or promote products derived from this software 193c62e87aSJun-ichiro itojun Hagino * without specific prior written permission. 203c62e87aSJun-ichiro itojun Hagino * 213c62e87aSJun-ichiro itojun Hagino * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 223c62e87aSJun-ichiro itojun Hagino * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 233c62e87aSJun-ichiro itojun Hagino * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 243c62e87aSJun-ichiro itojun Hagino * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 253c62e87aSJun-ichiro itojun Hagino * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 263c62e87aSJun-ichiro itojun Hagino * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 273c62e87aSJun-ichiro itojun Hagino * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 283c62e87aSJun-ichiro itojun Hagino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 293c62e87aSJun-ichiro itojun Hagino * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 303c62e87aSJun-ichiro itojun Hagino * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 313c62e87aSJun-ichiro itojun Hagino * SUCH DAMAGE. 323c62e87aSJun-ichiro itojun Hagino */ 333c62e87aSJun-ichiro itojun Hagino 3433841545SHajimu UMEMOTO struct sadb_msg; 3569160b1eSDavid E. O'Brien extern void pfkey_sadump(struct sadb_msg *); 3669160b1eSDavid E. O'Brien extern void pfkey_spdump(struct sadb_msg *); 373c62e87aSJun-ichiro itojun Hagino 383c62e87aSJun-ichiro itojun Hagino struct sockaddr; 3933841545SHajimu UMEMOTO struct sadb_alg; 4069160b1eSDavid E. O'Brien int ipsec_check_keylen(u_int, u_int, u_int); 4169160b1eSDavid E. O'Brien int ipsec_check_keylen2(u_int, u_int, u_int); 4269160b1eSDavid E. O'Brien int ipsec_get_keylen(u_int, u_int, struct sadb_alg *); 4369160b1eSDavid E. O'Brien u_int pfkey_set_softrate(u_int, u_int); 4469160b1eSDavid E. O'Brien u_int pfkey_get_softrate(u_int); 451372519bSDavid E. O'Brien int pfkey_send_getspi(int, u_int, u_int, struct sockaddr *, struct sockaddr *, 461372519bSDavid E. O'Brien u_int32_t, u_int32_t, u_int32_t, u_int32_t); 471372519bSDavid E. O'Brien int pfkey_send_update(int, u_int, u_int, struct sockaddr *, struct sockaddr *, 481372519bSDavid E. O'Brien u_int32_t, u_int32_t, u_int, caddr_t, u_int, u_int, u_int, u_int, 491372519bSDavid E. O'Brien u_int, u_int32_t, u_int64_t, u_int64_t, u_int64_t, u_int32_t); 501372519bSDavid E. O'Brien int pfkey_send_add(int, u_int, u_int, struct sockaddr *, struct sockaddr *, 511372519bSDavid E. O'Brien u_int32_t, u_int32_t, u_int, caddr_t, u_int, u_int, u_int, u_int, 521372519bSDavid E. O'Brien u_int, u_int32_t, u_int64_t, u_int64_t, u_int64_t, u_int32_t); 531372519bSDavid E. O'Brien int pfkey_send_delete(int, u_int, u_int, struct sockaddr *, struct sockaddr *, 541372519bSDavid E. O'Brien u_int32_t); 551372519bSDavid E. O'Brien int pfkey_send_delete_all(int, u_int, u_int, struct sockaddr *, 561372519bSDavid E. O'Brien struct sockaddr *); 571372519bSDavid E. O'Brien int pfkey_send_get(int, u_int, u_int, struct sockaddr *, struct sockaddr *, 581372519bSDavid E. O'Brien u_int32_t); 5969160b1eSDavid E. O'Brien int pfkey_send_register(int, u_int); 6069160b1eSDavid E. O'Brien int pfkey_recv_register(int); 6169160b1eSDavid E. O'Brien int pfkey_set_supported(struct sadb_msg *, int); 6269160b1eSDavid E. O'Brien int pfkey_send_flush(int, u_int); 6369160b1eSDavid E. O'Brien int pfkey_send_dump(int, u_int); 6469160b1eSDavid E. O'Brien int pfkey_send_promisc_toggle(int, int); 651372519bSDavid E. O'Brien int pfkey_send_spdadd(int, struct sockaddr *, u_int, struct sockaddr *, u_int, 661372519bSDavid E. O'Brien u_int, caddr_t, int, u_int32_t); 671372519bSDavid E. O'Brien int pfkey_send_spdadd2(int, struct sockaddr *, u_int, struct sockaddr *, u_int, 681372519bSDavid E. O'Brien u_int, u_int64_t, u_int64_t, caddr_t, int, u_int32_t); 691372519bSDavid E. O'Brien int pfkey_send_spdupdate(int, struct sockaddr *, u_int, struct sockaddr *, 701372519bSDavid E. O'Brien u_int, u_int, caddr_t, int, u_int32_t); 711372519bSDavid E. O'Brien int pfkey_send_spdupdate2(int, struct sockaddr *, u_int, struct sockaddr *, 721372519bSDavid E. O'Brien u_int, u_int, u_int64_t, u_int64_t, caddr_t, int, u_int32_t); 731372519bSDavid E. O'Brien int pfkey_send_spddelete(int, struct sockaddr *, u_int, struct sockaddr *, 741372519bSDavid E. O'Brien u_int, u_int, caddr_t, int, u_int32_t); 7569160b1eSDavid E. O'Brien int pfkey_send_spddelete2(int, u_int32_t); 7669160b1eSDavid E. O'Brien int pfkey_send_spdget(int, u_int32_t); 771372519bSDavid E. O'Brien int pfkey_send_spdsetidx(int, struct sockaddr *, u_int, struct sockaddr *, 781372519bSDavid E. O'Brien u_int, u_int, caddr_t, int, u_int32_t); 7969160b1eSDavid E. O'Brien int pfkey_send_spdflush(int); 8069160b1eSDavid E. O'Brien int pfkey_send_spddump(int); 813c62e87aSJun-ichiro itojun Hagino 8269160b1eSDavid E. O'Brien int pfkey_open(void); 8369160b1eSDavid E. O'Brien void pfkey_close(int); 8469160b1eSDavid E. O'Brien struct sadb_msg *pfkey_recv(int); 8569160b1eSDavid E. O'Brien int pfkey_send(int, struct sadb_msg *, int); 8669160b1eSDavid E. O'Brien int pfkey_align(struct sadb_msg *, caddr_t *); 8769160b1eSDavid E. O'Brien int pfkey_check(caddr_t *); 88