-
Notifications
You must be signed in to change notification settings - Fork 0
/
CovertSwitch.h
41 lines (37 loc) · 918 Bytes
/
CovertSwitch.h
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
//
// Created by Elliott on 7/7/2015.
//
#ifndef CATCHER_COVERTSWITCH_H
#define CATCHER_COVERTSWITCH_H
#include <winsock2.h>
#include <cstdio>
#include <string>
#include "CovertSecret.h"
#include <map>
#include "CovertUtils.h"
#include <vector>
using namespace std;
#define ARPAGE 300
#include "CovertSecret.h"
class CovertSwitch {
public:
bool init_network();
void run();
CovertSwitch();
private:
bool init_winsock();
map<string, pair<SOCKADDR_IN, long> > arp;
string stripe_dst(char buf[]);
string stripe_src(char buf[]);
void updateARP(string &srcmac, SOCKADDR_IN &addr);
void handleBoardcast(char buf[],int len);
void handleUnicast(char buf[],int len, string &dstmac);
bool lookupARP(string &dstmac);
void loadSetting();
SOCKADDR_IN localServ;
SOCKET sock;
CovertSecret secret;
int localport;
WSAData wsad;
};
#endif //CATCHER_COVERTSWITCH_H