tagged release 0.3.2
[vpnc.git] / vpnc.h
blob700f0529bedf397560cfa28bdc536c901ad069ad
1 /* IPSec VPN client compatible with Cisco equipment.
2 Copyright (C) 2002, 2003, 2004 Geoffrey Keating and Maurice Massar
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __VPNC_H__
20 #define __VPNC_H__
22 #include <sys/socket.h>
23 #include <net/if.h>
24 #include "sysdep.h"
25 #include "isakmp.h"
27 typedef struct {
28 const char *name;
29 int my_id, ike_sa_id, ipsec_sa_id;
30 int keylen;
31 } supported_algo_t;
33 struct sa_block {
34 int tun_fd;
35 char tun_name[IFNAMSIZ];
36 uint8_t i_cookie[ISAKMP_COOKIE_LENGTH];
37 uint8_t r_cookie[ISAKMP_COOKIE_LENGTH];
38 uint8_t *key; /* ike encryption key */
39 size_t keylen;
40 uint8_t *initial_iv;
41 uint8_t *skeyid_a;
42 uint8_t *skeyid_d;
43 int auth_algo, cry_algo, md_algo;
44 size_t ivlen, md_len;
45 uint8_t current_iv_msgid[4];
46 uint8_t *current_iv;
47 uint8_t our_address[4], our_netmask[4];
48 uint32_t tous_esp_spi, tothem_esp_spi;
49 uint8_t *kill_packet;
50 size_t kill_packet_size;
51 uint16_t peer_udpencap_port;
52 int do_pfs;
55 extern struct sa_block oursa[];
57 extern supported_algo_t supp_dh_group[];
58 extern supported_algo_t supp_hash[];
59 extern supported_algo_t supp_crypt[];
60 extern supported_algo_t supp_auth[];
62 extern const supported_algo_t *get_dh_group_ike(void);
63 extern const supported_algo_t *get_dh_group_ipsec(int server_setting);
65 #endif