forked from CSS-D/Net-Task2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteTable.h
More file actions
42 lines (33 loc) · 810 Bytes
/
Copy pathRouteTable.h
File metadata and controls
42 lines (33 loc) · 810 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
38
39
40
41
42
#ifndef _ROUTETABLE_H_
#define _ROUTETABLE_H_
#include <iostream>
#include <vector>
#include <winsock2.h>
#include <iomanip>
using namespace std;
#define LEN1 20
class RouteTable
{
public:
typedef struct RouteTableEntry
{
long dest_ip_addr;
long next_hop_ip_addr;
int cost;
RouteTableEntry(long _dest_ip_addr, long _next_hop_ip_addr, int _cost)
{
dest_ip_addr = _dest_ip_addr;
next_hop_ip_addr = _next_hop_ip_addr;
cost = _cost;
}
} RouteTableEntry;
void push(long dest_ip_addr, long next_hop_ip_addr, int cost);
int size();
void erase(int index);
RouteTableEntry &operator[](int index);
void print();
void clear();
private:
vector<RouteTableEntry> route_table_;
};
#endif