2 protocol.h -- header for protocol.c
3 Copyright (C) 1999-2001 Ivo Timmermans <itimmermans@bigfoot.com>,
4 2000,2001 Guus Sliepen <guus@sliepen.warande.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 $Id: protocol.h,v 1.5.4.21 2001/05/24 21:30:36 guus Exp $
23 #ifndef __TINC_PROTOCOL_H__
24 #define __TINC_PROTOCOL_H__
29 /* Protocol version. Different versions are incompatible,
30 incompatible version have different protocols.
33 #define PROT_CURRENT 10
38 ALL = -1, /* Guardian for allow_request */
39 ID = 0, METAKEY, CHALLENGE, CHAL_REPLY,
40 STATUS, ERROR, TERMREQ,
43 ADD_SUBNET, DEL_SUBNET,
44 KEY_CHANGED, REQ_KEY, ANS_KEY,
46 LAST /* Guardian for the highest request number */
49 /* Maximum size of strings in a request */
51 #define MAX_STRING_SIZE 1024
52 #define MAX_STRING "%1024s"
54 extern int (*request_handlers[])(connection_t*);
56 extern int send_id(connection_t*);
57 extern int send_challenge(connection_t*);
58 extern int send_chal_reply(connection_t*);
59 extern int send_metakey(connection_t*);
60 extern int send_status(connection_t*, int, char*);
61 extern int send_error(connection_t*, int, char*);
62 extern int send_termreq(connection_t*);
63 extern int send_ping(connection_t*);
64 extern int send_pong(connection_t*);
65 extern int send_add_host(connection_t*, connection_t*);
66 extern int send_del_host(connection_t*, connection_t*);
67 extern int send_add_subnet(connection_t*, subnet_t*);
68 extern int send_del_subnet(connection_t*, subnet_t*);
69 extern int send_key_changed(connection_t*, connection_t*);
70 extern int send_req_key(connection_t*, connection_t*);
71 extern int send_ans_key(connection_t*, connection_t*, char*);
72 extern int send_tcppacket(connection_t *, vpn_packet_t *);
76 extern int notify_others(connection_t *, connection_t *, int (*function)(connection_t*, connection_t*));
77 extern int receive_request(connection_t *);
78 extern int check_id(char *);
80 #endif /* __TINC_PROTOCOL_H__ */