]> git.saurik.com Git - apple/ipsec.git/blame - ipsec-tools/racoon/isakmp_var.h
ipsec-146.3.tar.gz
[apple/ipsec.git] / ipsec-tools / racoon / isakmp_var.h
CommitLineData
52b7d2ce
A
1/* $Id: isakmp_var.h,v 1.9.2.1 2005/05/07 17:26:06 manubsd Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
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.
18 *
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
29 * SUCH DAMAGE.
30 */
31
32#ifndef _ISAKMP_VAR_H
33#define _ISAKMP_VAR_H
34
35#include "vmbuf.h"
36
37#define PORT_ISAKMP 500
38#define PORT_ISAKMP_NATT 4500
39
40#define DEFAULT_NONCE_SIZE 16
41
42typedef u_char cookie_t[8];
43typedef u_char msgid_t[4];
44
45typedef struct { /* i_cookie + r_cookie */
46 cookie_t i_ck;
47 cookie_t r_ck;
48} isakmp_index;
49
50struct isakmp_gen;
51struct sched;
52
53struct sockaddr;
54struct ph1handle;
55struct ph2handle;
56struct remoteconf;
57struct isakmp_gen;
58struct ipsecdoi_pl_id; /* XXX */
59struct isakmp_pl_ke; /* XXX */
60struct isakmp_pl_nonce; /* XXX */
61
62extern int isakmp_handler __P((int));
63extern int isakmp_ph1begin_i __P((struct remoteconf *, struct sockaddr *,
d1e348cf 64 struct sockaddr *, int));
52b7d2ce
A
65
66extern vchar_t *isakmp_parsewoh __P((int, struct isakmp_gen *, int));
67extern vchar_t *isakmp_parse __P((vchar_t *));
68
e8d9021d 69extern int isakmp_init __P((int, int *));
52b7d2ce
A
70extern void isakmp_cleanup __P((void));
71
72extern const char *isakmp_pindex __P((const isakmp_index *, const u_int32_t));
e8d9021d 73extern int isakmp_open __P((int *));
52b7d2ce 74extern void isakmp_close __P((void));
52b7d2ce
A
75extern void isakmp_close_sockets __P((void));
76extern void isakmp_close_unused __P((void));
52b7d2ce
A
77extern int isakmp_send __P((struct ph1handle *, vchar_t *));
78
79extern void isakmp_ph1resend_stub __P((void *));
80extern int isakmp_ph1resend __P((struct ph1handle *));
81extern void isakmp_ph2resend_stub __P((void *));
82extern int isakmp_ph2resend __P((struct ph2handle *));
83extern void isakmp_ph1expire_stub __P((void *));
84extern void isakmp_ph1expire __P((struct ph1handle *));
d1e348cf 85extern void isakmp_ph1rekeyexpire_stub __P((void *));
fce29cd9 86extern void isakmp_ph1rekeyexpire __P((struct ph1handle *, int));
d1e348cf 87extern int isakmp_ph1rekeyretry __P((struct ph1handle *));
52b7d2ce
A
88extern void isakmp_ph1delete_stub __P((void *));
89extern void isakmp_ph1delete __P((struct ph1handle *));
90extern void isakmp_ph2expire_stub __P((void *));
91extern void isakmp_ph2expire __P((struct ph2handle *));
92extern void isakmp_ph2delete_stub __P((void *));
93extern void isakmp_ph2delete __P((struct ph2handle *));
94
95extern int isakmp_post_acquire __P((struct ph2handle *));
96extern int isakmp_post_getspi __P((struct ph2handle *));
97extern void isakmp_chkph1there_stub __P((void *));
98extern void isakmp_chkph1there __P((struct ph2handle *));
99
100extern caddr_t isakmp_set_attr_v __P((caddr_t, int, caddr_t, int));
101extern caddr_t isakmp_set_attr_l __P((caddr_t, int, u_int32_t));
102extern vchar_t *isakmp_add_attr_v __P((vchar_t *, int, caddr_t, int));
103extern vchar_t *isakmp_add_attr_l __P((vchar_t *, int, u_int32_t));
104
105extern int isakmp_newcookie __P((caddr_t, struct sockaddr *, struct sockaddr *));
106
107extern int isakmp_p2ph __P((vchar_t **, struct isakmp_gen *));
108
109extern u_int32_t isakmp_newmsgid2 __P((struct ph1handle *));
110extern caddr_t set_isakmp_header1 __P((vchar_t *, struct ph1handle *, int));
111extern caddr_t set_isakmp_header2 __P((vchar_t *, struct ph2handle *, int));
112extern caddr_t set_isakmp_payload __P((caddr_t, vchar_t *, int));
113
114extern struct payload_list *isakmp_plist_append __P((struct payload_list *plist,
115 vchar_t *payload, int payload_type));
116extern vchar_t *isakmp_plist_set_all __P((struct payload_list **plist,
117 struct ph1handle *iph1));
b8c37798 118extern vchar_t *isakmp_plist_append_initial_contact __P((struct ph1handle *,
e8d9021d 119 struct payload_list *));
52b7d2ce
A
120
121#ifdef HAVE_PRINT_ISAKMP_C
122extern void isakmp_printpacket __P((vchar_t *, struct sockaddr *,
123 struct sockaddr *, int));
124#endif
125
126extern int copy_ph1addresses __P(( struct ph1handle *,
127 struct remoteconf *, struct sockaddr *, struct sockaddr *));
128extern void log_ph1established __P((const struct ph1handle *));
129
130extern void script_hook __P((struct ph1handle *, int));
131extern int script_env_append __P((char ***, int *, char *, char *));
d1e348cf 132extern int script_exec __P((char *, int, char * const *));
52b7d2ce
A
133
134void purge_remote __P((struct ph1handle *));
135void delete_spd __P((struct ph2handle *));
136#ifdef INET6
137u_int32_t setscopeid __P((struct sockaddr *, struct sockaddr *));
d1e348cf 138#endif
52b7d2ce 139#endif /* _ISAKMP_VAR_H */