OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / pluto / server.h
1 /* get-next-event loop
2  * Copyright (C) 1998-2001  D. Hugh Redelmeier.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * for more details.
13  *
14  * RCSID $Id: server.h,v 1.20 2002/03/09 01:26:27 dhr Exp $
15  */
16
17 extern int ctl_fd;      /* file descriptor of control (whack) socket */
18 extern struct sockaddr_un ctl_addr;     /* address of control (whack) socket */
19 extern err_t init_ctl_socket(void);
20 extern void delete_ctl_socket(void);
21
22 extern bool listening;  /* should we pay attention to IKE messages? */
23
24
25 /* interface: a terminal point for IKE traffic, IPsec transport mode
26  * and IPsec tunnels.
27  * Essentially:
28  * - an IP device (eg. eth1), and
29  * - its partner, an ipsec device (eg. ipsec0), and
30  * - their shared IP address (eg. 10.7.3.2)
31  * Note: the port for IKE is always implicitly UDP/pluto_port.
32  */
33 struct iface {
34     char *vname;        /* virtual (ipsec) device name */
35     char *rname;        /* real device name */
36     ip_address addr;    /* interface IP address */
37     int fd;     /* file descriptor of socket for IKE UDP messages */
38     struct iface *next;
39 #ifdef NAT_TRAVERSAL
40     bool ike_float;
41 #endif
42     enum { IFN_ADD, IFN_KEEP, IFN_DELETE } change;
43 };
44
45 extern struct iface *interfaces;        /* public interfaces */
46
47 extern bool use_interface(const char *rifn);
48 extern void find_ifaces(void);
49 extern void show_ifaces_status(void);
50 extern void free_ifaces(void);
51 extern void call_server(void);