X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol.h;h=6e71f810e5b82f5573d2b7f79b3178acee435332;hp=a021f4fe2c109f9a1aad1d170af78ac4583ffb5a;hb=1401faf608e1c8af0d0754e545b0ec79d2bd5d93;hpb=82ebfc923ddb050c88bdf5d65ac943a15ca8748a diff --git a/src/protocol.h b/src/protocol.h index a021f4fe..6e71f810 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol.h,v 1.5.4.33 2002/09/04 13:48:52 guus Exp $ + $Id: protocol.h,v 1.5.4.38 2003/07/06 23:16:28 guus Exp $ */ #ifndef __TINC_PROTOCOL_H__ @@ -37,21 +37,20 @@ /* Request numbers */ enum { - ALL = -1, /* Guardian for allow_request */ - ID = 0, METAKEY, CHALLENGE, CHAL_REPLY, ACK, - STATUS, ERROR, TERMREQ, - PING, PONG, -// ADD_NODE, DEL_NODE, - ADD_SUBNET, DEL_SUBNET, - ADD_EDGE, DEL_EDGE, - KEY_CHANGED, REQ_KEY, ANS_KEY, - PACKET, - LAST /* Guardian for the highest request number */ + ALL = -1, /* Guardian for allow_request */ + ID = 0, METAKEY, CHALLENGE, CHAL_REPLY, ACK, + STATUS, ERROR, TERMREQ, + PING, PONG, + ADD_SUBNET, DEL_SUBNET, + ADD_EDGE, DEL_EDGE, + KEY_CHANGED, REQ_KEY, ANS_KEY, + PACKET, + LAST /* Guardian for the highest request number */ }; typedef struct past_request_t { - char *request; - time_t firstseen; + char *request; + time_t firstseen; } past_request_t; /* Maximum size of strings in a request */ @@ -61,7 +60,8 @@ typedef struct past_request_t { /* Basic functions */ -extern int send_request(connection_t*, const char*, ...); +extern int send_request(connection_t *, const char *, ...) __attribute__ ((format(printf, 2, 3))); +extern int forward_request(connection_t *); extern int receive_request(connection_t *); extern int check_id(char *); @@ -82,8 +82,6 @@ extern int send_error(connection_t *, int, char *); extern int send_termreq(connection_t *); extern int send_ping(connection_t *); extern int send_pong(connection_t *); -// extern int send_add_node(connection_t *, node_t *); -// extern int send_del_node(connection_t *, node_t *); extern int send_add_subnet(connection_t *, subnet_t *); extern int send_del_subnet(connection_t *, subnet_t *); extern int send_add_edge(connection_t *, edge_t *); @@ -95,8 +93,6 @@ extern int send_tcppacket(connection_t *, vpn_packet_t *); /* Request handlers */ -extern int (*request_handlers[])(connection_t *); - extern int id_h(connection_t *); extern int metakey_h(connection_t *); extern int challenge_h(connection_t *); @@ -107,8 +103,6 @@ extern int error_h(connection_t *); extern int termreq_h(connection_t *); extern int ping_h(connection_t *); extern int pong_h(connection_t *); -// extern int add_node_h(connection_t *); -// extern int del_node_h(connection_t *); extern int add_subnet_h(connection_t *); extern int del_subnet_h(connection_t *); extern int add_edge_h(connection_t *); @@ -118,4 +112,4 @@ extern int req_key_h(connection_t *); extern int ans_key_h(connection_t *); extern int tcppacket_h(connection_t *); -#endif /* __TINC_PROTOCOL_H__ */ +#endif /* __TINC_PROTOCOL_H__ */