# HG changeset patch # User Markus Bröker # Date 1229179668 -3600 # Node ID 724e07a9f155aa82422adad3f339bc1d385a48f1 # Parent 62ddf5dd4db0b47114e3108a7ba4d3fec5f5175a PacketWriter.cpp: cstdlib header added Source Base indented with GNU indent diff --git a/PacketWriter.cpp b/PacketWriter.cpp --- a/PacketWriter.cpp +++ b/PacketWriter.cpp @@ -4,6 +4,7 @@ */ #include +#include extern "C" { #include diff --git a/include/PacketParser.h b/include/PacketParser.h --- a/include/PacketParser.h +++ b/include/PacketParser.h @@ -17,30 +17,26 @@ #include #include #include -} +} class PacketParser:public PacketReader { + public: + PacketParser (int tm = 500); + PacketParser (std::string); + ~PacketParser (); + std::string read (); + std::string getPacket (); + void setPort (unsigned short); + void setProtocol (int); + std::string getProtocol (int); -class PacketParser : public PacketReader -{ - public: - PacketParser ( int tm=500 ); - PacketParser ( std::string ); - ~PacketParser (); - std::string read(); - std::string getPacket(); - void setPort(unsigned short); - void setProtocol(int); - std::string getProtocol(int); + private: + std::string str; + int protocol; + unsigned short port; - private: - std::string str; - int protocol; - unsigned short port; - - std::string shost; - std::string dhost; - unsigned short sport, dport; - struct protoent *proto; + std::string shost; + std::string dhost; + unsigned short sport, dport; + struct protoent *proto; }; #endif - diff --git a/include/PacketReader.h b/include/PacketReader.h --- a/include/PacketReader.h +++ b/include/PacketReader.h @@ -11,27 +11,27 @@ #include extern "C" { - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include }; class PacketReader { -protected: - int p_socket; - private: - int timeout; -public: - PacketReader ( int tm = 500 ); - PacketReader ( std::string ); - ~PacketReader(); - std::string read(); - bool ready(); - bool dataAvailable(); + protected: + int p_socket; + private: + int timeout; + public: + PacketReader (int tm = 500); + PacketReader (std::string); + ~PacketReader (); + std::string read (); + bool ready (); + bool dataAvailable (); }; #endif diff --git a/include/PacketWriter.h b/include/PacketWriter.h --- a/include/PacketWriter.h +++ b/include/PacketWriter.h @@ -12,17 +12,16 @@ #include #include -class PacketWriter : PacketReader { -private: - struct sockaddr_in ca; +class PacketWriter:PacketReader { + private: + struct sockaddr_in ca; -public: - PacketWriter(char *, int); - ~PacketWriter(); + public: + PacketWriter (char *, int); + ~PacketWriter (); - void write(char *s, int); - bool ready(); + void write (char *s, int); + bool ready (); }; #endif - diff --git a/include/monitor.h b/include/monitor.h --- a/include/monitor.h +++ b/include/monitor.h @@ -12,26 +12,22 @@ class readerThread; -class Monitor : public QWidget, private Ui::qMonitor -{ - Q_OBJECT - - public: - Monitor(QWidget *parent = 0); - virtual ~Monitor(); - int getPort(); - int getProtocol(); +class Monitor:public QWidget, private Ui::qMonitor { + Q_OBJECT public: + Monitor (QWidget * parent = 0); + virtual ~ Monitor (); + int getPort (); + int getProtocol (); - protected: - virtual void customEvent( QEvent* ); - std::map Protocol; + protected: + virtual void customEvent (QEvent *); + std::map < QString, int >Protocol; - private: - readerThread *reader; + private: + readerThread * reader; - public slots: - virtual void startCapture(); - virtual void stopCapture(); + public slots:virtual void startCapture (); + virtual void stopCapture (); }; diff --git a/include/readerthread.h b/include/readerthread.h --- a/include/readerthread.h +++ b/include/readerthread.h @@ -15,26 +15,26 @@ class Monitor; -class DataChangeEvent : public QEvent { - public: - DataChangeEvent(QString msg_) - : QEvent((QEvent::Type)MSG_EVENT) - { - msg = msg_; +class DataChangeEvent:public QEvent { + public: + DataChangeEvent (QString msg_) + :QEvent ((QEvent::Type) MSG_EVENT) { + msg = msg_; - } - - QString Text() const { return msg; } - private: - QString msg; + } + QString Text () const { + return msg; + } + private: + QString msg; }; -class readerThread : public QThread { - public: - readerThread(Monitor*); - virtual void run(); - private: - Monitor *handle; +class readerThread:public QThread { + public: + readerThread (Monitor *); + virtual void run (); + private: + Monitor * handle; }; #endif diff --git a/include/tools.h b/include/tools.h --- a/include/tools.h +++ b/include/tools.h @@ -8,6 +8,6 @@ #include -std::string itoa(const int& i); +std::string itoa (const int &i); #endif diff --git a/include/version.h b/include/version.h --- a/include/version.h +++ b/include/version.h @@ -8,4 +8,3 @@ #define VERSION_STRING "qMonitor Revision 0.90" #endif -