NetSim Source Code Help
Loading...
Searching...
No Matches
OSPF_dijkstra.h
Go to the documentation of this file.
1
/************************************************************************************
2
* Copyright (C) 2021 *
3
* TETCOS, Bangalore. India *
4
* *
5
* Tetcos owns the intellectual property rights in the Product and its content. *
6
* The copying, redistribution, reselling or publication of any or all of the *
7
* Product or its content without express prior written consent of Tetcos is *
8
* prohibited. Ownership and / or any other right relating to the software and all *
9
* intellectual property rights therein shall remain at all times with Tetcos. *
10
* *
11
* This source code is licensed per the NetSim license agreement. *
12
* *
13
* No portion of this source code may be used as the basis for a derivative work, *
14
* or used, for any purpose other than its intended use per the NetSim license *
15
* agreement. *
16
* *
17
* This source code and the algorithms contained within it are confidential trade *
18
* secrets of TETCOS and may not be used as the basis for any other software, *
19
* hardware, product or service. *
20
* *
21
* Author: Ramsaran Giri *
22
* *
23
* ----------------------------------------------------------------------------------*/
24
#ifndef _NETSIM_APP_ROUTING_H_
25
#define _NETSIM_APP_ROUTING_H_
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
30
// A structure to represent a node in adjacency list
31
struct
AdjListNode
32
{
33
int
dest
;
34
int
weight
;
35
int
interfaceId
;
36
struct
AdjListNode
*
next
;
37
};
38
39
// A structure to represent an adjacency list
40
struct
AdjList
41
{
42
struct
AdjListNode
*
head
;
// pointer to head node of list
43
};
44
45
// A structure to represent a graph. A graph is an array of adjacency lists.
46
// Size of array will be V (number of vertices in graph)
47
struct
Graph
48
{
49
int
V
;
50
struct
AdjList
*
array
;
51
};
52
53
//A structure to store the shortest path from source to destination
54
typedef
struct
Path
55
{
56
int
node
;
57
struct
Path
*
next
;
58
}
PATH
, *
ptrPATH
;
59
60
// Structure to represent a min heap node
61
typedef
struct
MinHeapNode
62
{
63
int
v
;
64
int
dist
;
65
}
MINHEAP
, *
ptrMINHEAP
;
66
67
// Structure to represent a min heap
68
struct
MinHeap
69
{
70
int
size
;
// Number of heap nodes present currently
71
int
capacity
;
// Capacity of min heap
72
int
*
pos
;
// This is needed for decreaseKey()
73
struct
MinHeapNode
**
array
;
74
};
75
76
#ifdef __cplusplus
77
}
78
#endif
79
#endif
//_NETSIM_APP_ROUTING_H_
PATH
struct Path PATH
MINHEAP
struct MinHeapNode MINHEAP
ptrMINHEAP
struct MinHeapNode * ptrMINHEAP
ptrPATH
struct Path * ptrPATH
AdjList
Definition:
OSPF_dijkstra.h:41
AdjList::head
struct AdjListNode * head
Definition:
OSPF_dijkstra.h:42
AdjListNode
Definition:
OSPF_dijkstra.h:32
AdjListNode::interfaceId
int interfaceId
Definition:
OSPF_dijkstra.h:35
AdjListNode::dest
int dest
Definition:
OSPF_dijkstra.h:33
AdjListNode::weight
int weight
Definition:
OSPF_dijkstra.h:34
AdjListNode::next
struct AdjListNode * next
Definition:
OSPF_dijkstra.h:36
Graph
Definition:
OSPF_dijkstra.h:48
Graph::V
int V
Definition:
OSPF_dijkstra.h:49
Graph::array
struct AdjList * array
Definition:
OSPF_dijkstra.h:50
MinHeap
Definition:
OSPF_dijkstra.h:69
MinHeap::size
int size
Definition:
OSPF_dijkstra.h:70
MinHeap::array
struct MinHeapNode ** array
Definition:
OSPF_dijkstra.h:73
MinHeap::capacity
int capacity
Definition:
OSPF_dijkstra.h:71
MinHeap::pos
int * pos
Definition:
OSPF_dijkstra.h:72
MinHeapNode
Definition:
OSPF_dijkstra.h:62
MinHeapNode::dist
int dist
Definition:
OSPF_dijkstra.h:64
MinHeapNode::v
int v
Definition:
OSPF_dijkstra.h:63
Path
Definition:
OSPF_dijkstra.h:55
Path::node
int node
Definition:
OSPF_dijkstra.h:56
Path::next
struct Path * next
Definition:
OSPF_dijkstra.h:57
ALL
Component 1
Part 1
OSPF
OSPF_dijkstra.h
Generated on Fri Dec 9 2022 10:22:44 for NetSim Source Code Help by
1.9.5