| 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.32 2005/09/19 00:40:48 mcr Exp $
|
| 15 |
*/
|
| 16 |
|
| 17 |
#ifndef _SERVER_H
|
| 18 |
#define _SERVER_H
|
| 19 |
|
| 20 |
#include <sysqueue.h>
|
| 21 |
|
| 22 |
extern bool no_retransmits;
|
| 23 |
extern bool log_to_stderr_desired;
|
| 24 |
|
| 25 |
extern int ctl_fd; /* file descriptor of control (whack) socket */
|
| 26 |
extern struct sockaddr_un ctl_addr; /* address of control (whack) socket */
|
| 27 |
|
| 28 |
extern int info_fd; /* file descriptor of control (info) socket */
|
| 29 |
extern struct sockaddr_un info_addr; /* address of control (info) socket */
|
| 30 |
|
| 31 |
extern err_t init_ctl_socket(void);
|
| 32 |
extern void delete_ctl_socket(void);
|
| 33 |
|
| 34 |
extern bool listening; /* should we pay attention to IKE messages? */
|
| 35 |
|
| 36 |
|
| 37 |
/* interface: a terminal point for IKE traffic, IPsec transport mode
|
| 38 |
* and IPsec tunnels.
|
| 39 |
* Essentially:
|
| 40 |
* - an IP device (eg. eth1), and
|
| 41 |
* - its partner, an ipsec device (eg. ipsec0), and
|
| 42 |
* - their shared IP address (eg. 10.7.3.2)
|
| 43 |
* Note: the port for IKE is always implicitly UDP/pluto_port.
|
| 44 |
*
|
| 45 |
* The iface is a unique IP address on a system. It may be used
|
| 46 |
* by multiple port numbers. In general, two conns have the same
|
| 47 |
* interface if they have the same iface_port->iface_alias.
|
| 48 |
*/
|
| 49 |
struct iface_dev {
|
| 50 |
LIST_ENTRY(iface_dev) id_entry;
|
| 51 |
int id_count;
|
| 52 |
char *id_vname; /* virtual (ipsec) device name */
|
| 53 |
char *id_rname; /* real device name */
|
| 54 |
};
|
| 55 |
|
| 56 |
struct iface_port {
|
| 57 |
struct iface_dev *ip_dev;
|
| 58 |
u_int16_t port; /* host byte order */
|
| 59 |
ip_address ip_addr; /* interface IP address */
|
| 60 |
int fd; /* file descriptor of socket for IKE UDP messages */
|
| 61 |
struct iface_port *next;
|
| 62 |
bool ike_float;
|
| 63 |
enum { IFN_ADD, IFN_KEEP, IFN_DELETE } change;
|
| 64 |
};
|
| 65 |
|
| 66 |
extern struct iface_port *interfaces; /* public interfaces */
|
| 67 |
|
| 68 |
extern bool use_interface(const char *rifn);
|
| 69 |
extern void find_ifaces(void);
|
| 70 |
extern void show_ifaces_status(void);
|
| 71 |
extern void free_ifaces(void);
|
| 72 |
extern void show_debug_status(void);
|
| 73 |
extern void call_server(void);
|
| 74 |
|
| 75 |
/* in rcv_info.c */
|
| 76 |
extern err_t init_info_socket(void);
|
| 77 |
extern void delete_info_socket(void);
|
| 78 |
|
| 79 |
extern bool pluto_crypt_handle_dead_child(int pid, int status);
|
| 80 |
extern bool adns_reapchild(pid_t pid, int status);
|
| 81 |
|
| 82 |
extern const char *init_pluto_vendorid(void);
|
| 83 |
|
| 84 |
|
| 85 |
#endif /* _SERVER_H */
|