1/* $Id: vpn_control_var.h,v 1.7 2004/12/30 00:08:30 manubsd Exp $ */
2
3/*
4 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
5 *
6 * @APPLE_LICENSE_HEADER_START@
7 *
8 * The contents of this file constitute Original Code as defined in and
9 * are subject to the Apple Public Source License Version 1.1 (the
10 * "License").  You may not use this file except in compliance with the
11 * License.  Please obtain a copy of the License at
12 * http://www.apple.com/publicsource and read it before using this file.
13 *
14 * This Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25/*
26 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 * 1. Redistributions of source code must retain the above copyright
33 *    notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright
35 *    notice, this list of conditions and the following disclaimer in the
36 *    documentation and/or other materials provided with the distribution.
37 * 3. Neither the name of the project nor the names of its contributors
38 *    may be used to endorse or promote products derived from this software
39 *    without specific prior written permission.
40 *
41 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 */
53
54#ifndef _VPN_CONTROL_VAR_H
55#define _VPN_CONTROL_VAR_H
56
57#include "vpn_control.h"
58#include <dispatch/dispatch.h>
59#include "localconf.h"
60
61enum {
62	VPN_STARTED_BY_API = 1,
63	VPN_STARTED_BY_ADMIN,
64	VPN_RESTARTED_BY_API,
65};
66
67extern void vpncontrol_handler (void *);
68extern void vpncontrol_comm_handler (struct vpnctl_socket_elem *);
69extern int vpncontrol_notify_ike_failed (u_int16_t, u_int16_t, u_int32_t, u_int16_t, u_int8_t*);
70extern int vpncontrol_notify_phase_change (int, u_int16_t, phase1_handle_t*, phase2_handle_t*);
71extern int vpncontrol_init (void);
72extern void vpncontrol_close (void);
73extern int vpn_control_connected (void);
74extern int vpn_connect (struct bound_addr *, int);
75extern int vpn_disconnect (struct bound_addr *, const char *);
76extern void vpncontrol_disconnect_all (struct vpnctl_socket_elem *, const char *);
77extern int vpn_start_ph2 (struct bound_addr *, struct vpnctl_cmd_start_ph2 *);
78extern int vpncontrol_notify_need_authinfo (phase1_handle_t *, void*, size_t);
79extern int vpncontrol_notify_peer_resp_ph1 (u_int16_t, phase1_handle_t*);
80extern int vpncontrol_notify_peer_resp_ph2 (u_int16_t, phase2_handle_t*);
81extern int vpn_assert (struct sockaddr_storage *, struct sockaddr_storage *);
82
83#endif /* _VPN_CONTROL_VAR_H */
84