#include #include #include #include #include "../common/constants.h" #include "../topology/topology.h" #include "dvtable.h" //This function creates a dvtable(distance vector table) dynamically. //A distance vector table contains the n+1 entries, where n is the number of the neighbors of this node, and the rest one is for this node itself. //Each entry in distance vector table is a dv_t structure which contains a source node ID and an array of N dv_entry_t structures where N is the number of all the nodes in the overlay. //Each dv_entry_t contains a destination node address the the cost from the source node to this destination node. //The dvtable is initialized in this function. //The link costs from this node to its neighbors are initialized using direct link cost retrived from topology.dat. //Other link costs are initialized to INFINITE_COST. //The dynamically created dvtable is returned. dv_t* dvtable_create() { return 0; } //This function destroys a dvtable. //It frees all the dynamically allocated memory for the dvtable. void dvtable_destroy(dv_t* dvtable) { return; } //This function sets the link cost between two nodes in dvtable. //If those two nodes are found in the table and the link cost is set, return 1. //Otherwise, return -1. int dvtable_setcost(dv_t* dvtable,int fromNodeID,int toNodeID, unsigned int cost) { return 0; } //This function returns the link cost between two nodes in dvtable //If those two nodes are found in dvtable, return the link cost. //otherwise, return INFINITE_COST. unsigned int dvtable_getcost(dv_t* dvtable, int fromNodeID, int toNodeID) { return 0; } //This function prints out the contents of a dvtable. void dvtable_print(dv_t* dvtable) { return; }