-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patharp_utils.h
More file actions
20 lines (15 loc) · 957 Bytes
/
Copy patharp_utils.h
File metadata and controls
20 lines (15 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* arp_utils.h */
#include "utils.h"
// uses arpScanOutput(), parses all ipv4 and MAC address's , returns all in a vector of pairs <mac, ip>.
std::vector<std::pair<std::string, std::string>> parsedArpOutput();
// parses a single line of arp-scan output
std::pair<std::string, std::string> parseArpOutputLine(std::string line);
bool checkIPv4Status(std::string destIP, std::vector<std::string> arpOut, std::string& destMAC);
// checks if destMAC is found in arpOut, if so, parses IPv4 address from the string into destIP,
// then returns true. returns false if MAC couldnt be found.
bool checkStatus(std::string destMAC, std::vector<std::string> arpOut, std::string &destIP);
// uses popen() to get arp-scan output, and saves each
// line to a vector EXCEPT for the first two lines (the header)
// and last three lines (the trailer).
std::vector<std::string> arpScanOutput();
void PrintOut(std::vector<std::pair<std::string, std::string>> parsedout);