author | Markus Bröker <mbroeker@largo.homelinux.org> |
Sat, 03 Jan 2009 01:28:28 +0100 | |
changeset 4 | fdf04a93faeb |
parent 3 | 724e07a9f155 |
permissions | -rw-r--r-- |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
1 |
/* |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
2 |
* $Id: PacketParser.h 2 2007-12-22 14:15:30Z mbroeker $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
3 |
* $URL: http://localhost/svn/cpp/qMonitor/trunk/include/PacketParser.h $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
4 |
*/ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
5 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
6 |
#ifndef PACKET_PARSER |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
7 |
#define PACKET_PARSER |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
8 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
9 |
#include <PacketReader.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
10 |
#include <sstream> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
11 |
#include <iomanip> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
12 |
#include <tools.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
13 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
14 |
extern "C" { |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
15 |
#include <arpa/inet.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
16 |
#include <netdb.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
17 |
#include <netinet/tcp.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
18 |
#include <netinet/udp.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
19 |
#include <netinet/ip_icmp.h> |
4
fdf04a93faeb
Codebase indented by me and gnu-indent
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
3
diff
changeset
|
20 |
}; |
fdf04a93faeb
Codebase indented by me and gnu-indent
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
3
diff
changeset
|
21 |
|
fdf04a93faeb
Codebase indented by me and gnu-indent
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
3
diff
changeset
|
22 |
class PacketParser:public PacketReader { |
3
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
23 |
public: |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
24 |
PacketParser (int tm = 500); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
25 |
PacketParser (std::string); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
26 |
~PacketParser (); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
27 |
std::string read (); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
28 |
std::string getPacket (); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
29 |
void setPort (unsigned short); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
30 |
void setProtocol (int); |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
31 |
std::string getProtocol (int); |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
32 |
|
3
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
33 |
private: |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
34 |
std::string str; |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
35 |
int protocol; |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
36 |
unsigned short port; |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
37 |
|
3
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
38 |
std::string shost; |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
39 |
std::string dhost; |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
40 |
unsigned short sport, dport; |
724e07a9f155
PacketWriter.cpp: cstdlib header added
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
0
diff
changeset
|
41 |
struct protoent *proto; |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
42 |
}; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
43 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
44 |
#endif |