X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drl%2Fpeer_comm.h;h=0e28386092924904a90cb39d21a25b0301c350f2;hb=8675c0b77ad3e361f4255ce61881a79061c5238d;hp=c8fd2e15fe46e9e30e7aa3ed1765b3f1332aba16;hpb=0be9704d6b24d09ebd55beedec52758cb88c570b;p=distributedratelimiting.git diff --git a/drl/peer_comm.h b/drl/peer_comm.h index c8fd2e1..0e28386 100644 --- a/drl/peer_comm.h +++ b/drl/peer_comm.h @@ -3,18 +3,36 @@ #ifndef _PEER_COMM_H_ #define _PEER_COMM_H_ +#define NULL_PEER (-2) +#define MESH_REMOTE_AWOL_THRESHOLD (5) +#define GOSSIP_REMOTE_AWOL_THRESHOLD (5) + +static const uint32_t MAGIC_MSG = 0x123123; +static const uint32_t MAGIC_HELLO = 0x456456; +static const uint16_t MSG = 1; +static const uint16_t ACK = 2; + void limiter_receive(); -#if 0 -void *limiter_accept_thread(void *limiter); +void message_to_hbo(message_t *msg); -void *ident_receive_thread(void *limiter); -#endif +void message_to_nbo(message_t *msg); int send_udp_mesh(comm_t *comm, uint32_t id, int sock); +int recv_mesh(comm_t *comm, uint32_t id, int sock, remote_limiter_t *remote, message_t *msg); + int send_udp_gossip(comm_t *comm, uint32_t id, int sock); +int recv_gossip(comm_t *comm, uint32_t id, int sock, remote_limiter_t *remote, message_t *msg); + +int find_gossip_target(comm_t *comm); + +int send_ack(uint32_t id, remote_limiter_t *remote, uint32_t seqno, uint16_t type, int32_t view); #if 0 +void *limiter_accept_thread(void *limiter); + +void *ident_receive_thread(void *limiter); + int send_tcp_gossip(comm_ident_t *ident, FILE *logfile, int unused); #endif