-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
37 lines (34 loc) · 930 Bytes
/
Copy pathGraph.h
File metadata and controls
37 lines (34 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef GRAPH_H_
#define GRAPH_H_
#include <iostream>
#include <list>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string.h>
#include "Helper.h"
typedef struct RouteEntry{
IP_Address destination;
IP_Address nextHop;
int cost;
unsigned short TTL;
}RouteEntry;
extern map<string,RouteEntry> RoutingTable;
extern map<string,HostAddr> labels;
extern list<IP_Address> nodesList;
extern int numberOfNodes;
extern list<IP_Address> neighbors;
extern IP_Address hostName;
extern int **costMatrix;
extern void DisplayRoutingTable(void);
void createGraph(char *file);
void lostNode(IP_Address host);
void printGraph(void);
void initializeSingleSourceGraph();
int findIndex(IP_Address host);
int updateNode(AdversisementEntry tempNode,IP_Address host);
void sendAdvertisements(void);
void constructRoutingTable(void);
void updateRoutingTable(int);
void whoAmI(void);
#endif /* GRAPH_H_ */