-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNetworkLink.h
More file actions
32 lines (26 loc) · 761 Bytes
/
Copy pathNetworkLink.h
File metadata and controls
32 lines (26 loc) · 761 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_LINK_H__
#define __NETWORK_LINK_H__
#include "CommonDefs.h"
#include "NetworkInterface.h"
#define G_G_DELAY 0.01 // in seconds
#define OTHER_DELAY 0.001 // in seconds
class Node;
class Packet;
class Simulator;
class NetworkLink
{
public:
NetworkLink(); // Construtor
NetworkLink(double delay0, double dataRate0); // Construct with delay and data rate
void SetPeer(NetworkInterface* , NetworkInterface* );
void Send(Packet*); // Send a packet to peer
public:
Simulator* sim;
NetworkInterface* Sender;
NetworkInterface* Receiver;
double delay; // Speed of light delay on this link
double dataRate; // Bits per second on this link
};
#endif