Distributed Hash Table File System for Linux








vulcano.h File Reference

#include "magma_setup.h"

Data Structures

struct  magma_node_t
struct  magma_network_t

Defines

#define lock_node(N)
#define unlock_node(N)
#define lock_me()
#define unlock_me()
#define magma_create_node_empty()   magma_create_node(NULL,NULL,NULL,0,0,0)
#define magma_add_node_to_ring(n)   magma_add_node_to_ring_near(n,lava->last_node)
#define explain_join_error(error)
#define LOAD_SAVE_SIZE   1024

Functions

magma_network_tmagma_create_network_ring ()
magma_node_tmagma_create_node (char *node_name, char *fqdn_name, char *ipaddr, int ipport, int bandwidth, int storage)
magma_node_tmagma_fill_node (magma_node_t *node, char *node_name, char *fqdn_name, char *ipaddr, int ipport, int bandwidth, int storage)
magma_node_tmagma_config_myself (char *node_name, char *fqdn_name, char *ipaddr, int ipport, int bandwidth, int storage)
int magma_destroy_node (magma_node_t *node)
int magma_add_node_to_ring_near (magma_node_t *newnode, magma_node_t *sibling)
int magma_remove_node_from_ring (magma_node_t *newnode)
void magma_parse_node_line (char *buf, magma_node_t *node)
int magma_load_node_from_dht (magma_node_t *node)
int magma_check_keyspace_continuity ()
magma_node_tmagma_get_next_node ()
magma_node_tmagma_get_previous_node ()
int save_node_profile ()
uint8_t magma_node_exists (magma_node_t *node)
void write_profile (int fd)
void cat_profile (char *profile_buf)
void save_status ()
void load_status ()

Variables

char * mypath
magma_node_t myself
magma_network_tlava

Define Documentation

#define explain_join_error ( error   ) 

Value:

{\
        if (error == MAGMA_NODE_NAME_COLLISION) {\
                dbg(LOG_ERR, DEBUG_ERR, "Another node with same nick name exists in lava ring");\
        } if (error == MAGMA_FQDN_NAME_COLLISION) {\
                dbg(LOG_ERR, DEBUG_ERR, "Another node with same FQDN name exists in lava ring");\
        } else {\
                dbg(LOG_ERR, DEBUG_ERR, "Unknow error from");\
        }\
}

#define LOAD_SAVE_SIZE   1024

 
#define lock_me (  ) 

Value:

{\
        dbg(LOG_INFO, DEBUG_MUTEX, " [+] Locking myself at %s:%d", __FILE__, __LINE__);\
        pthread_mutex_lock(myself.mutex);\
        dbg(LOG_INFO, DEBUG_MUTEX, " [+] Locked!");\
}
locks this node

#define lock_node (  ) 

Value:

{\
        if (N != NULL) {\
                dbg(LOG_INFO, DEBUG_MUTEX, "[N+] Lock on \"%s\" @ %s:%d", N->node_name, __FILE__, __LINE__);\
                pthread_mutex_lock(N->mutex);\
                dbg(LOG_INFO, DEBUG_MUTEX, "[N+] Locked!");\
        }\
}
lock node N mutex

Parameters:
N the node

#define magma_add_node_to_ring (  )     magma_add_node_to_ring_near(n,lava->last_node)

 
#define magma_create_node_empty (  )     magma_create_node(NULL,NULL,NULL,0,0,0)

 
#define unlock_me (  ) 

Value:

{\
        pthread_mutex_unlock(myself.mutex);\
        dbg(LOG_INFO, DEBUG_MUTEX, " [-] Unlocking myself at %s:%d", __FILE__, __LINE__);\
}
unlocks this node

#define unlock_node (  ) 

Value:

{\
        if (N != NULL) {\
                pthread_mutex_unlock(N->mutex);\
                dbg(LOG_INFO, DEBUG_MUTEX, "[N-] Lock on \"%s\" @ %s:%d", N->node_name, __FILE__, __LINE__);\
        }\
}
unlock node N mutex

Parameters:
N the node


Function Documentation

void cat_profile ( char *  profile_buf  ) 

void load_status (  ) 

int magma_add_node_to_ring_near ( magma_node_t newnode,
magma_node_t sibling 
)

int magma_check_keyspace_continuity (  ) 

magma_node_t* magma_config_myself ( char *  node_name,
char *  fqdn_name,
char *  ipaddr,
int  ipport,
int  bandwidth,
int  storage 
)

magma_network_t* magma_create_network_ring (  ) 

setup network ring structures

create a new lava ring structure

Returns:
new lava ring structure pointer

magma_node_t* magma_create_node ( char *  node_name,
char *  fqdn_name,
char *  ipaddr,
int  ipport,
int  bandwidth,
int  storage 
)

allocate a new node structure

Parameters:
node_name short name of this node
fqdn_name fully qualified domain name of this node
ipaddr string rappresenting node IP address
ipport node IP port
bandwidth declared bandwidth available
storage declare storage available
Returns:
new node structure pointer

int magma_destroy_node ( magma_node_t node  ) 

magma_node_t* magma_fill_node ( magma_node_t node,
char *  node_name,
char *  fqdn_name,
char *  ipaddr,
int  ipport,
int  bandwidth,
int  storage 
)

magma_node_t* magma_get_next_node (  ) 

magma_node_t* magma_get_previous_node (  ) 

int magma_load_node_from_dht ( magma_node_t node  ) 

uint8_t magma_node_exists ( magma_node_t node  ) 

void magma_parse_node_line ( char *  buf,
magma_node_t node 
)

int magma_remove_node_from_ring ( magma_node_t newnode  ) 

int save_node_profile (  ) 

void save_status (  ) 

void write_profile ( int  fd  ) 


Variable Documentation

this is the lava ring pointer that will be used by all routing functions and internode operations (load balancing, key exchange, ...)

structure hosting the lava ring

char* mypath

magma_node_t structure holding information related to this node

structure describing this node

This file last modified Wednesday, 09-Jan-2008 20:02:25 CET