summaryrefslogtreecommitdiff
path: root/keyexchange/isakmpd-20041012/sysdep/openbsd/sysdep-os.h
blob: 05200c619f220efee3ce2ef4bc2f9af942a8ee85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*	$OpenBSD: sysdep-os.h,v 1.6 2003/06/03 14:53:11 ho Exp $	*/
/*	$EOM: sysdep-os.h,v 1.3 1999/07/08 16:48:40 niklas Exp $	*/

/*
 * Copyright (c) 1998, 1999 Niklas Hallqvist.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This code was written under funding by Ericsson Radio Systems.
 */

#ifndef _SYSDEP_OS_H_
#define _SYSDEP_OS_H_

/*
 * OpenBSD has at various times had non-conformant PF_KEYv2 definitions.
 * Here we transform them into being conformant.
 */

#ifdef SADB_EXT_X_SRC_MASK
#define SADB_X_EXT_SRC_MASK		SADB_EXT_X_SRC_MASK
#define SADB_X_EXT_DST_MASK		SADB_EXT_X_DST_MASK
#define SADB_X_EXT_PROTOCOL		SADB_EXT_X_PROTOCOL
#define SADB_X_EXT_SA2			SADB_EXT_X_SA2
#define SADB_X_EXT_SRC_FLOW		SADB_EXT_X_SRC_FLOW
#define SADB_X_EXT_DST_FLOW		SADB_EXT_X_DST_FLOW
#define SADB_X_EXT_DST2			SADB_EXT_X_DST2

#define SADB_X_SATYPE_AH_OLD		SADB_SATYPE_X_AH_OLD
#define SADB_X_SATYPE_ESP_OLD		SADB_SATYPE_X_ESP_OLD
#define SADB_X_SATYPE_IPIP		SADB_SATYPE_X_IPIP

#define SADB_X_AALG_RIPEMD160HMAC96	SADB_AALG_X_RIPEMD160HMAC96
#define SADB_X_AALG_MD5			SADB_AALG_X_MD5
#define SADB_X_AALG_SHA1		SADB_AALG_X_SHA1

#define SADB_X_EALG_BLF			SADB_EALG_X_BLF
#define SADB_X_EALG_CAST		SADB_EALG_X_CAST
#define SADB_X_EALG_SKIPJACK		SADB_EALG_X_SKIPJACK

#define SADB_X_SAFLAGS_HALFIV    	SADB_SAFLAGS_X_HALFIV
#define SADB_X_SAFLAGS_TUNNEL	 	SADB_SAFLAGS_X_TUNNEL
#define SADB_X_SAFLAGS_CHAINDEL  	SADB_SAFLAGS_X_CHAINDEL
#define SADB_X_SAFLAGS_LOCALFLOW 	SADB_SAFLAGS_X_LOCALFLOW
#define SADB_X_SAFLAGS_REPLACEFLOW	SADB_SAFLAGS_X_REPLACEFLOW

#endif	/* SADB_EXT_X_SRC_MASK */

#if defined (SADB_IDENTTYPE_MBOX) && !defined (SADB_IDENTTYPE_USERFQDN)
#define SADB_IDENTTYPE_USERFQDN SADB_IDENTTYPE_MBOX
#endif

#ifdef FLOW_X_TYPE_USE
#define SADB_X_FLOW_TYPE_USE		FLOW_X_TYPE_USE
#define SADB_X_FLOW_TYPE_ACQUIRE	FLOW_X_TYPE_ACQUIRE
#define SADB_X_FLOW_TYPE_REQUIRE	FLOW_X_TYPE_REQUIRE
#define SADB_X_FLOW_TYPE_BYPASS		FLOW_X_TYPE_BYPASS
#define SADB_X_FLOW_TYPE_DENY		FLOW_X_TYPE_DENY
#define SADB_X_FLOW_TYPE_DONTACQ	FLOW_X_TYPE_DONTACQ
#endif

#if OPENBSD_IPSEC_API_VERSION == 1
#define sadb_x_policy		sadb_policy
#define sadb_x_policy_len	sadb_policy_len
#define sadb_x_policy_exttype	sadb_policy_exttype
#define sadb_x_policy_seq	sadb_policy_seq
#endif

#endif /* _SYSDEP_OS_H_ */