xref: /openbsd-src/sbin/isakmpd/pf_key_v2.h (revision c691c669cc4cf3bfc4f239aef58e1da3727bdfa1)
1*c691c669Smarkus /* $OpenBSD: pf_key_v2.h,v 1.13 2006/05/29 10:17:59 markus Exp $	 */
2b2e70f0cSniklas /* $EOM: pf_key_v2.h,v 1.4 2000/12/04 04:46:35 angelos Exp $	 */
31136595aSniklas 
41136595aSniklas /*
51136595aSniklas  * Copyright (c) 1999 Niklas Hallqvist.  All rights reserved.
61136595aSniklas  *
71136595aSniklas  * Redistribution and use in source and binary forms, with or without
81136595aSniklas  * modification, are permitted provided that the following conditions
91136595aSniklas  * are met:
101136595aSniklas  * 1. Redistributions of source code must retain the above copyright
111136595aSniklas  *    notice, this list of conditions and the following disclaimer.
121136595aSniklas  * 2. Redistributions in binary form must reproduce the above copyright
131136595aSniklas  *    notice, this list of conditions and the following disclaimer in the
141136595aSniklas  *    documentation and/or other materials provided with the distribution.
151136595aSniklas  *
161136595aSniklas  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
171136595aSniklas  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
181136595aSniklas  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
191136595aSniklas  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
201136595aSniklas  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
211136595aSniklas  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
221136595aSniklas  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
231136595aSniklas  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
241136595aSniklas  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
251136595aSniklas  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
261136595aSniklas  */
271136595aSniklas 
281136595aSniklas /*
291136595aSniklas  * This code was written under funding by Ericsson Radio Systems.
301136595aSniklas  */
311136595aSniklas 
321136595aSniklas #ifndef _PF_KEY_V2_H_
331136595aSniklas #define _PF_KEY_V2_H_
341136595aSniklas 
351136595aSniklas #include <sys/types.h>
361136595aSniklas #include <sys/queue.h>
371136595aSniklas 
381136595aSniklas struct proto;
391136595aSniklas struct sa;
401136595aSniklas struct sockaddr;
41e0d722f1Sho struct kernel_sa;
421136595aSniklas 
431ec19420Shshoexer extern int	pf_key_v2_socket;
441ec19420Shshoexer 
45b393bef8Sniklas extern void     pf_key_v2_connection_check(char *);
461136595aSniklas extern int      pf_key_v2_delete_spi(struct sa *, struct proto *, int);
47b2e70f0cSniklas extern int      pf_key_v2_enable_sa(struct sa *, struct sa *);
48*c691c669Smarkus extern int	pf_key_v2_disable_sa(struct sa *, int);
4912f43dabShshoexer extern int	pf_key_v2_enable_spi(in_addr_t, in_addr_t, in_addr_t,
5012f43dabShshoexer     in_addr_t, u_int8_t *, u_int8_t, in_addr_t);
51e0d722f1Sho extern struct sa_kinfo *pf_key_v2_get_kernel_sa(u_int8_t *, size_t, u_int8_t,
52e0d722f1Sho     struct sockaddr *);
5312f43dabShshoexer extern u_int8_t *pf_key_v2_get_spi(size_t *, u_int8_t, struct sockaddr *,
54977e1bd9Sho     struct sockaddr *, u_int32_t);
5512f43dabShshoexer extern int	pf_key_v2_group_spis(struct sa *, struct proto *,
5612f43dabShshoexer     struct proto *, int);
571136595aSniklas extern void     pf_key_v2_handler(int);
581136595aSniklas extern int      pf_key_v2_open(void);
59e0d722f1Sho extern int      pf_key_v2_set_spi(struct sa *, struct proto *, int,
60e0d722f1Sho     struct sa *);
611136595aSniklas 
621136595aSniklas #endif				/* _PF_KEY_V2_H_ */
63