NetSim Source Code Help
v14.4
All 13 Components
Loading...
Searching...
No Matches
OSPF_dijkstra.h
1
/************************************************************************************
2
* Copyright (C) 2023 *
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_
AdjList
Definition
OSPF_dijkstra.h:41
AdjListNode
Definition
OSPF_dijkstra.h:32
Graph
Definition
OSPF_dijkstra.h:48
MinHeap
Definition
OSPF_dijkstra.h:69
MinHeapNode
Definition
OSPF_dijkstra.h:62
Path
Definition
OSPF_dijkstra.h:55
ALL
Component 1
Part 1
OSPF
OSPF_dijkstra.h
Generated by
1.13.2