xref: /openbsd/sbin/ipsecctl/pfkey.h (revision 895bd039)
1*895bd039Smarkus /*	$OpenBSD: pfkey.h,v 1.7 2006/09/19 21:29:47 markus Exp $	*/
21edc1b9aShshoexer /*
31edc1b9aShshoexer  * Copyright (c) 2004, 2005 Hans-Joerg Hoexer <hshoexer@openbsd.org>
41edc1b9aShshoexer  *
51edc1b9aShshoexer  * Permission to use, copy, modify, and distribute this software for any
61edc1b9aShshoexer  * purpose with or without fee is hereby granted, provided that the above
71edc1b9aShshoexer  * copyright notice and this permission notice appear in all copies.
81edc1b9aShshoexer  *
91edc1b9aShshoexer  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
101edc1b9aShshoexer  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
111edc1b9aShshoexer  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
121edc1b9aShshoexer  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
131edc1b9aShshoexer  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
141edc1b9aShshoexer  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
151edc1b9aShshoexer  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
161edc1b9aShshoexer  */
171edc1b9aShshoexer 
181edc1b9aShshoexer #ifndef _PFKEY_H_
191edc1b9aShshoexer #define _PFKEY_H_
201edc1b9aShshoexer 
211edc1b9aShshoexer #define PFKEYV2_CHUNK sizeof(u_int64_t)
221edc1b9aShshoexer 
231edc1b9aShshoexer int	pfkey_parse(struct sadb_msg *, struct ipsec_rule *);
243dd59ad2Shshoexer void	pfkey_print_sa(struct sadb_msg *, int);
258a87fca6Smsf void	pfkey_monitor_sa(struct sadb_msg *, int);
268a87fca6Smsf void	pfkey_print_raw(u_int8_t *, ssize_t);
27356121f6Shshoexer int	pfkey_ipsec_establish(int, struct ipsec_rule *);
281edc1b9aShshoexer int	pfkey_ipsec_flush(void);
291edc1b9aShshoexer int	pfkey_init(void);
308a87fca6Smsf int	pfkey_monitor(int);
31*895bd039Smarkus u_int32_t pfkey_get_spi(struct sadb_msg *);
321edc1b9aShshoexer 
331edc1b9aShshoexer #endif	/* _PFKEY_H_ */
34