]>
git.saurik.com Git - apple/ipsec.git/blob - ipsec-tools/racoon/isakmp_var.h
8a4993dd9391639a49215a6bdbb36fe98518b2f6
1 /* $Id: isakmp_var.h,v 1.9.2.1 2005/05/07 17:26:06 manubsd Exp $ */
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #include "racoon_types.h"
38 #include <network/nat64.h>
40 #define PORT_ISAKMP 500
41 #define PORT_ISAKMP_NATT 4500
43 #define DEFAULT_NONCE_SIZE 16
45 typedef u_char cookie_t
[8];
46 typedef u_char msgid_t
[4];
48 typedef struct { /* i_cookie + r_cookie */
57 struct sockaddr_storage
;
60 struct ipsecdoi_pl_id
; /* XXX */
61 struct isakmp_pl_ke
; /* XXX */
62 struct isakmp_pl_nonce
; /* XXX */
64 extern void isakmp_handler (int);
65 extern int ikev1_ph1begin_i (ike_session_t
*session
, struct remoteconf
*, struct sockaddr_storage
*,
66 struct sockaddr_storage
*, int, nw_nat64_prefix_t
*);
67 extern int get_sainfo_r (phase2_handle_t
*);
68 extern int get_proposal_r (phase2_handle_t
*);
70 extern vchar_t
*isakmp_parsewoh (int, struct isakmp_gen
*, int);
71 extern vchar_t
*isakmp_parse (vchar_t
*);
73 extern int isakmp_init (void);
74 extern void isakmp_cleanup (void);
76 extern const char *isakmp_pindex (const isakmp_index
*, const u_int32_t
);
77 extern int isakmp_open (void);
78 extern void isakmp_suspend_sockets(void);
79 extern void isakmp_close (void);
80 extern void isakmp_close_sockets (void);
81 extern void isakmp_close_unused (void);
82 extern int isakmp_send (phase1_handle_t
*, vchar_t
*);
84 extern void isakmp_ph1resend_stub (void *);
85 extern int isakmp_ph1resend (phase1_handle_t
*);
86 extern void isakmp_ph2resend_stub (void *);
87 extern int isakmp_ph2resend (phase2_handle_t
*);
89 extern void isakmp_ph1expire_stub (void *);
90 extern void isakmp_ph1expire (phase1_handle_t
*);
91 extern void isakmp_ph1rekeyexpire_stub (void *);
92 extern void isakmp_ph1rekeyexpire (phase1_handle_t
*, int);
93 extern int isakmp_ph1rekeyretry (phase1_handle_t
*);
94 extern void isakmp_ph1delete_stub (void *);
95 extern void isakmp_ph1delete (phase1_handle_t
*);
96 extern void isakmp_ph2expire_stub (void *);
97 extern void isakmp_ph2expire (phase2_handle_t
*);
98 extern void isakmp_ph2delete_stub (void *);
99 extern void isakmp_ph2delete (phase2_handle_t
*);
100 extern int ikev1_phase1_established(phase1_handle_t
*);
102 extern int isakmp_post_acquire (phase2_handle_t
*);
103 extern int isakmp_post_getspi (phase2_handle_t
*);
104 extern void isakmp_chkph1there_stub (void *);
105 extern void isakmp_chkph1there (phase2_handle_t
*);
107 extern caddr_t
isakmp_set_attr_v (caddr_t
, int, caddr_t
, int);
108 extern caddr_t
isakmp_set_attr_l (caddr_t
, int, u_int32_t
);
109 extern vchar_t
*isakmp_add_attr_v (vchar_t
*, int, caddr_t
, int);
110 extern vchar_t
*isakmp_add_attr_l (vchar_t
*, int, u_int32_t
);
112 extern int isakmp_newcookie (caddr_t
, struct sockaddr_storage
*, struct sockaddr_storage
*);
114 extern int isakmp_p2ph (vchar_t
**, struct isakmp_gen
*);
116 extern u_int32_t
isakmp_newmsgid2 (phase1_handle_t
*);
117 extern caddr_t
set_isakmp_header1 (vchar_t
*, phase1_handle_t
*, int);
118 extern caddr_t
set_isakmp_header2 (vchar_t
*, phase2_handle_t
*, int);
119 extern caddr_t
set_isakmp_payload (caddr_t
, vchar_t
*, int);
121 extern struct payload_list
*isakmp_plist_append (struct payload_list
*plist
,
122 vchar_t
*payload
, int payload_type
);
123 extern vchar_t
*isakmp_plist_set_all (struct payload_list
**plist
,
124 phase1_handle_t
*iph1
);
125 extern vchar_t
*isakmp_plist_append_initial_contact (phase1_handle_t
*, struct payload_list
*);
127 #ifdef HAVE_PRINT_ISAKMP_C
128 extern void isakmp_printpacket (vchar_t
*, struct sockaddr_storage
*,
129 struct sockaddr_storage
*, int);
132 extern int copy_ph1addresses (phase1_handle_t
*,
133 struct remoteconf
*, struct sockaddr_storage
*, struct sockaddr_storage
*);
134 extern void log_ph1established (const phase1_handle_t
*);
136 extern void script_hook (phase1_handle_t
*, int);
137 extern int script_env_append (char ***, int *, char *, char *);
138 extern int script_exec (char *, int, char * const *);
140 void purge_remote (phase1_handle_t
*);
141 void delete_spd (phase2_handle_t
*);
143 u_int32_t
setscopeid (struct sockaddr_storage
*, struct sockaddr_storage
*);
145 #endif /* _ISAKMP_VAR_H */