-
Notifications
You must be signed in to change notification settings - Fork 3
/
L2.cpp
45 lines (37 loc) · 806 Bytes
/
L2.cpp
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
43
44
45
#include "L2.h"
#include "NIC.h"
using namespace std;
/**
* Implemented for you
*/
L2::L2(bool debug) : debug(debug){ }
/**
* Implemented for you
*/
void L2::setUpperInterface(L3* upperInterface){ this->upperInterface = upperInterface; }
/**
* Implemented for you
*/
void L2::setNIC(NIC* nic){ this->nic = nic; }
/**
* Implemented for you
*/
NIC* L2::getNIC(){ return nic; }
/**
* Implemented for you
*/
std::string L2::getLowestInterface(){ return nic->getLowestInterface(); }
int L2::recvFromL2(byte *recvData, size_t recvDataLen)
{
/* ADD YOUR IMPLEMENTATION HERE*/
return 0;
}
int L2::sendToL2(byte *sendData, size_t sendDataLen, uint16_t family, string spec_mac, uint16_t spec_type, string dst_addr)
{
/* ADD YOUR IMPLEMENTATION HERE*/
return 0;
}
/**
* Implemented for you
*/
L2::~L2() {}