xref: /openbsd-src/sbin/isakmpd/nat_traversal.h (revision 875f57d023da74b04f74934c340683b6a4039940)
1*875f57d0Shshoexer /*	$OpenBSD: nat_traversal.h,v 1.4 2005/07/25 15:03:47 hshoexer Exp $	*/
2cd6bf844Sho 
3cd6bf844Sho /*
4cd6bf844Sho  * Copyright (c) 2004 H�kan Olsson.  All rights reserved.
5cd6bf844Sho  *
6cd6bf844Sho  * Redistribution and use in source and binary forms, with or without
7cd6bf844Sho  * modification, are permitted provided that the following conditions
8cd6bf844Sho  * are met:
9cd6bf844Sho  * 1. Redistributions of source code must retain the above copyright
10cd6bf844Sho  *    notice, this list of conditions and the following disclaimer.
11cd6bf844Sho  * 2. Redistributions in binary form must reproduce the above copyright
12cd6bf844Sho  *    notice, this list of conditions and the following disclaimer in the
13cd6bf844Sho  *    documentation and/or other materials provided with the distribution.
14cd6bf844Sho  *
15cd6bf844Sho  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16cd6bf844Sho  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17cd6bf844Sho  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18cd6bf844Sho  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19cd6bf844Sho  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20cd6bf844Sho  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21cd6bf844Sho  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22cd6bf844Sho  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23cd6bf844Sho  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24cd6bf844Sho  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25cd6bf844Sho  */
26cd6bf844Sho 
27cd6bf844Sho #ifndef _NAT_TRAVERSAL_H_
28cd6bf844Sho #define _NAT_TRAVERSAL_H_
29cd6bf844Sho 
30*875f57d0Shshoexer #define VID_DRAFT_V2	0
31*875f57d0Shshoexer #define VID_DRAFT_V2_N	1
32*875f57d0Shshoexer #define VID_DRAFT_V3	2
33*875f57d0Shshoexer #define VID_RFC3947	3
34*875f57d0Shshoexer 
35*875f57d0Shshoexer struct nat_t_cap {
36*875f57d0Shshoexer 	int		 id;
37*875f57d0Shshoexer 	u_int32_t	 flags;
38*875f57d0Shshoexer 	const char	*text;
39*875f57d0Shshoexer 	char		*hash;
40*875f57d0Shshoexer 	size_t		 hashsize;
41*875f57d0Shshoexer };
42*875f57d0Shshoexer 
43bfb67d4dScloder /*
44bfb67d4dScloder  * Set if -T is given on the command line to disable NAT-T support.
45bfb67d4dScloder  */
46bfb67d4dScloder extern int	disable_nat_t;
47bfb67d4dScloder 
48cd6bf844Sho void	nat_t_init(void);
49cd6bf844Sho int	nat_t_add_vendor_payloads(struct message *);
50cd6bf844Sho void	nat_t_check_vendor_payload(struct message *, struct payload *);
51cd6bf844Sho int	nat_t_exchange_add_nat_d(struct message *);
52cd6bf844Sho int	nat_t_exchange_check_nat_d(struct message *);
53adfd2491Sho void	nat_t_setup_keepalive(struct sa *);
54cd6bf844Sho 
55cd6bf844Sho #endif /* _NAT_TRAVERSAL_H_ */
56