-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.hpp
65 lines (51 loc) · 904 Bytes
/
entry.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
#ifndef ENTRY_HPP
#define ENTRY_HPP
#include <iostream>
#include <string>
using namespace std;
class Entry {
public:
Entry();
Entry(string protocol, string line);
~Entry();
int equal(Entry &e);
void fetchLine(string protocol, string line);
void printLineDebug();
void parseLine();
string printLineFormat();
long getInode();
int getState();
string getProtocol();
int wasPrinted();
void printed();
enum {
TCP_ESTABLISHED = 1,
TCP_SYN_SENT,
TCP_SYN_RECV,
TCP_FIN_WAIT1,
TCP_FIN_WAIT2,
TCP_TIME_WAIT,
TCP_CLOSE,
TCP_CLOSE_WAIT,
TCP_LAST_ACK,
TCP_LISTEN,
TCP_CLOSING,
TCP_MAX_STATES
};
private:
string line;
int fetched;
int parsed;
int sl;
string protocol;
string local_addr;
int local_port;
string remote_addr;
int remote_port;
int state;
long inode;
int print;
void setDefault();
string getStateEnum();
};
#endif