#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include <pthread.h>#include <netdb.h>#include <netinet/in.h>#include "chimera.h"#include "host.h"#include "message.h"#include "route.h"#include "semaphore.h"#include "key.h"#include "log.h"#include "dtime.h"#include "network.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GRACEPERIOD is the time that has to be elapsed before a node can be accepted to the network again after last send to it failed |
|
|
interval that members of leafset are checked to see if they are alive or not |
|
|
chimera_check_leafset: runs as a separate thread. it should send a PING message to each member of the leafset frequently and sends the leafset to other members of its leafset periodically. pinging frequecy is LEAFSET_CHECK_PERIOD. |
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
chimera_deliver: Set the chimera deliver upcall to func. This handler will be called every time a message is delivered to the current node |
|
||||||||||||||||||||
|
|
|
||||||||||||
|
chimera_forward: Set the chimera forward upcall to func. This handler will be called every time a message is routed to a key through the current node. The host argument is upsupported, but will allow the programmer to choose the next hop |
|
|
chimera_init: Initializes Chimera on port port and returns the ChimeraState * which contains global state of different chimera modules. |
|
||||||||||||
|
chimera_join: Join the network that the bootstrap host is a part of |
|
||||||||||||
|
chimera_join_acknowledge: called when the current host is joining the network and has just revieced its leaf set. This function sends an update message to all nodes in its new leaf set to announce its arrival. |
|
||||||||||||
|
chimera_join_complete: internal function that is called at the destination of a JOIN message. This call encodes the leaf set of the current host and sends it to the joiner. |
|
||||||||||||
|
chimera_join_denied internal function that is called when the sender of a JOIN message receives the JOIN_NACK message type which is join denial from the current key root in the network. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
chimera_ping: sends a PING message to the host. The message is acknowledged in network layer. |
|
||||||||||||
|
|
|
||||||||||||||||
|
chimera_register: register an integer message type to be routed by the chimera routing layer ack is the argument that defines wether this message type should be acked or not ack ==1 means message will be acknowledged, ack=2 means no acknowledge is necessary for this type of message. |
|
||||||||||||||||||||
|
chimera_route: routes a message one step closer to its destination key. Delivers the message to its destination if it is the current host through the deliver upcall, otherwise it makes the route upcall |
|
||||||||||||||||||||||||
|
chimera_send: Route a message of type to key containing size bytes of data. This will send data through the Chimera system and deliver it to the host closest to the key. |
|
||||||||||||
|
|
|
||||||||||||
|
chimera_setkey: Manually sets the key for the current node |
|
||||||||||||
|
chimera_update: Set the chimera update upcall to func. This handler will be called every time a host leaves or joins your neighbor set. The final integer is a 1 if the host joins and a 0 if the host leaves |
|
||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
|
|
1.4.5