#include "host.h"
#include "key.h"
#include "log.h"
#include <pthread.h>
#include "message.h"
#include "semaphore.h"
Go to the source code of this file.
Classes | |
struct | ChimeraGlobal |
Typedefs | |
typedef void(* | chimera_forward_upcall_t )(Key **, Message **, ChimeraHost **) |
typedef void(* | chimera_deliver_upcall_t )(Key *, Message *) |
typedef void(* | chimera_update_upcall_t )(Key *, ChimeraHost *, int) |
Functions | |
ChimeraState * | chimera_init (int port) |
void | chimera_join (ChimeraState *state, ChimeraHost *bootstrap) |
void | chimera_route (ChimeraState *state, Key *key, Message *msg, ChimeraHost *hint) |
void | chimera_forward (ChimeraState *state, chimera_forward_upcall_t func) |
void | chimera_deliver (ChimeraState *state, chimera_deliver_upcall_t func) |
void | chimera_update (ChimeraState *state, chimera_update_upcall_t func) |
void | chimera_setkey (ChimeraState *state, Key key) |
void | chimera_register (ChimeraState *state, int type, int ack) |
void | chimera_send (ChimeraState *state, Key key, int type, int len, char *data) |
int | chimera_ping (ChimeraState *state, ChimeraHost *host) |
|
|
|
|
|
|
|
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_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 |