Skip to content

Commit

Permalink
Finished more of the route api.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Samith Bysani committed Jan 18, 2009
1 parent 6c3cda8 commit d83ba9d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/base/bang-module-api.c
Expand Up @@ -39,6 +39,17 @@ static void get_uuid_from_id(uuid_t uuid, int id, BANG_module_info *info) {
* Note: This is no longer what out app is about, I added another layer of indirection.
*/
void BANG_debug_on_all_peers(BANG_module_info *info, char *message) {
/* The first slot will be us, so skip that. */
fprintf(stderr,"%s",message);
int i = 1;
uuid_t route;

for (; i < info->peers_info->peer_number; ++i) {
get_uuid_from_id(route,i,info);
if (!uuid_is_null(route)) {
BANG_route_send_message(route,message);
}
}
}

void BANG_get_me_peers(BANG_module_info *info) {
Expand Down
27 changes: 27 additions & 0 deletions src/base/bang-routing.h
Expand Up @@ -50,6 +50,33 @@ void BANG_route_request_job(uuid_t uuid);
*/
void BANG_route_assertion_of_authority(uuid_t authority, uuid_t peer);

/**
* \param uuid Route to send debug message.
* \param message The message that will be printed out on the remote end.
*
* \brief Sends a message to along the route.
*/
void BANG_route_send_message(uuid_t uuid, char *message);

/**
* \param uuid The route to a peer.
*
* \return A peer id of the route if valid. Otherwise -1.
*
* \brief Gets the peer id from the route.
*/
int BANG_route_get_peer_id(uuid_t uuid);

/**
* \param uuids The routes to peers.
*
* \return NULL terminated array of peer ids.
*
* \brief Returns peer_ids not on the list.
* memory: You must take care of it.
*/
int** BANG_not_route_get_peer_id(uuid_t *uuids);

/**
* \param module The module to register with the uuid.
*
Expand Down

0 comments on commit d83ba9d

Please sign in to comment.