forked from shahpoojan/NetSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkInterface.h
More file actions
35 lines (26 loc) · 876 Bytes
/
Copy pathNetworkInterface.h
File metadata and controls
35 lines (26 loc) · 876 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
// Definition of NetworkInterface class
// ECE8893, Final Project, Fall 2012
#ifndef __NETWORK_INTERFACE_H__
#define __NETWORK_INTERFACE_H__
#include "CommonDefs.h"
#include "Handler.h"
class NetworkLink;
class Packet;
class Queue;
class NetworkInterface : public Handler
{
public:
NetworkInterface(); // Constructor
NetworkInterface(double); //Constructor with data rate as argument (makes the implementation flexible)
void AddP2PLink(NetworkLink*, NetworkInterface*, double link_delay);
void Send(Packet*); // Send specified packet to p2p peer
void Handle(Event*, Time_t); // Handle event
public:
NetworkLink* link;
Queue* queue; // Associated node
Node* node; // Associated node
bool busy; // true if busy sending a packet
//added by apkarande
double interface_data_rate; //data rate for each interface
};
#endif