Updates to autotools for library detection
[distributedratelimiting.git] / drl / peer_comm.h
1 /* See the DRL-LICENSE file for this file's software license. */
2
3 #ifndef _PEER_COMM_H_
4 #define _PEER_COMM_H_
5
6 #define NULL_PEER (-2)
7 #define MESH_REMOTE_AWOL_THRESHOLD (5)
8 #define GOSSIP_REMOTE_AWOL_THRESHOLD (5)
9
10 static const uint32_t MAGIC_MSG = 0x123123;
11 static const uint32_t MAGIC_HELLO = 0x456456;
12 static const uint16_t MSG = 1;
13 static const uint16_t ACK = 2;
14
15 void limiter_receive();
16
17 void message_to_hbo(message_t *msg);
18
19 void message_to_nbo(message_t *msg);
20
21 int send_udp_mesh(comm_t *comm, uint32_t id, int sock);
22 int recv_mesh(comm_t *comm, uint32_t id, int sock, remote_limiter_t *remote, message_t *msg);
23
24 int send_udp_gossip(comm_t *comm, uint32_t id, int sock);
25 int recv_gossip(comm_t *comm, uint32_t id, int sock, remote_limiter_t *remote, message_t *msg);
26
27 int find_gossip_target(comm_t *comm);
28
29 int send_ack(uint32_t id, remote_limiter_t *remote, uint32_t seqno, uint16_t type, int32_t view);
30
31 #if 0
32 void *limiter_accept_thread(void *limiter);
33
34 void *ident_receive_thread(void *limiter);
35
36 int send_tcp_gossip(comm_ident_t *ident, FILE *logfile, int unused);
37 #endif
38
39 #endif