-
Notifications
You must be signed in to change notification settings - Fork 0
/
C_Net.hpp
105 lines (72 loc) · 2.49 KB
/
C_Net.hpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//////////////////////////////////////////////////////////////////////////////////
// [ Net_Class_Header ]
//////////////////////////////////////////////////////////////////////////////////
//
// Net
//
// [::Last modi: 17.03.21 L.ey (µ~)::]
//
//
#ifndef _C_NET_H_
#define _C_NET_H_
#include <cstdint>
#include <iostream>
#include <list>
using namespace std;
#include <sigc++/sigc++.h>
#include <glibmm/dispatcher.h>
#include "Net_Protokoll_Header.hpp"
#include "C_Net_Interface.hpp"
#include "C_Net_Raw.hpp"
#include "C_Net_Raw_Arp.hpp"
//////////////////////////////////////////////////////////////////////////////////
// CONSTANT
//////////////////////////////////////////////////////////////////////////////////
const int C_NET_ERROR = 0x00;
const int C_NET_READY = 0x01;
const int C_NET_ID = 0xFFAA;
const int C_NET_BUFFER = 0x1400;
//////////////////////////////////////////////////////////////////////////////////
// STRUCT
//////////////////////////////////////////////////////////////////////////////////
struct S_host_Result {
UCHAR MAC[SIZE_MAC];
UCHAR IP[SIZE_IP];
};
//////////////////////////////////////////////////////////////////////////////////
// CLASS
//////////////////////////////////////////////////////////////////////////////////
class C_Net : public sigc::trackable {
public:
C_Net(){};
~C_Net(){};
int init();
int start(const S_Net_Interface* pSInterface, int cPackets, int cSleep);
int stop();
///////////////////////////////////////////////////////////////
list<S_host_Result> CDA_Result;
////////////////////////////////
C_Net_Interface CNInterface;
////////////////////////////////
Glib::Dispatcher sig_packet;
Glib::Dispatcher sig_finish;
private:
C_Net_Raw CNRaw;
C_Net_Raw_Arp CNArp;
// Recive Signal
void on_raw_data(int id, int cData);
UCHAR pBuffer[C_NET_BUFFER];
S_host_Result SResult;
bool bscann = {false};
/////////////////////////////////
UCHAR pData[5000];
DWORD cData = 0;
UCHAR IP_REQUEST[SIZE_IP];
UCHAR IP_SOURCE[SIZE_IP];
UCHAR MAC_REQUEST[SIZE_MAC];
UCHAR MAC_SOURCE[SIZE_MAC];
UCHAR MAC_ETH_D[SIZE_MAC];
UCHAR MAC_ETH_S[SIZE_MAC];
S_ArpPacket sArp;
};
#endif // _C_NET_H_