Skip to content

Commit

Permalink
Added the bang module registry header file.
Browse files Browse the repository at this point in the history
git-svn-id: https://subversion.cs.uiuc.edu/svn/bang/eoh2009@154 69d76c3e-0761-0410-948c-9895a8bb34fc
  • Loading branch information
nbysani2 committed Mar 12, 2009
1 parent fa12e98 commit ebf7f57
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/bang-module-api.c
Expand Up @@ -84,11 +84,12 @@ void BANG_get_me_peers(BANG_module_info *info) {

BANG_linked_list *peers_to_bug = BANG_not_route_get_peer_id(valid_routes);
int *cur;
BANG_request *req;

BANG_request *req = new_BANG_request(BANG_MODULE_PEER_REQUEST,NULL,0);
/* TODO: Put the module info inside the data... */

while ((cur = BANG_linked_list_pop(peers_to_bug)) != NULL) {
req = new_BANG_request(BANG_MODULE_PEER_REQUEST,NULL,0);
BANG_request_peer_id(*cur,req);
free(cur);
}
Expand Down
49 changes: 49 additions & 0 deletions src/base/bang-module-registry.h
@@ -0,0 +1,49 @@
/**
* \file bang-module-registry.h
* \author Nikhil Bysani
* \date March 11, 2009
*
* \brief Keeps track of all running modules.
*/

#ifndef __BANG_MODULE_REGISTRY_H
#define __BANG_MODULE_REGISTRY_H

/**
* \param path The file system path to the module.
* \param module_name The function puts the name of the module here.
* \param module_version The function puts the version of the module here.
*
* \brief Creates a new module in the registry, and tells you its name and version.
*/
void BANG_new_module(char *path, char **module_name, unsigned char **module_version);

/**
* \param module_name The name of the module you are trying to get.
* \param module_version The version of the module you are trying to get.
*
* \brief Gets you the internal representation of a module.
*
* \return A BANG_module with the matching name and version.
*/
BANG_module* BANG_get_module(char *module_name, unsigned char *module_version);

/**
* \param module_name The name of the module to start.
* \param module_version The version of the module to start.
*
* \brief Starts a module of the given name and version.
*
* \return Returns 0 on success, something else on error.
*/
int BANG_start_module(char *module_name, unsigned char *module_version);

/**
* \param module_name The name of the module that is running.
* \param module_version The version of the module that is running.
* \param new_peer The new peer of the module.
*
* \brief If the given module is running, tells it about the new peer.
*/
void BANG_module_inform_new_peer(char *module_name, unsigned char *module_version, uuid_t new_peer);
#endif

0 comments on commit ebf7f57

Please sign in to comment.