My Project
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QtGui>
6 #include <iostream>
7 #include <fstream>
8 #include <QComboBox>
9 #include <QMenuBar>
10 #include <QLabel>
11 #include <QTableWidget>
12 #include <QCheckBox>
13 #include <QLineEdit>
14 #include <QFileDialog>
15 #include <QMessageBox>
16 #include <QApplication>
17 #include "packet.h"
18 
19 using namespace std;
20 
21 namespace Ui {
22 class MainWindow;
23 }
24 
38 bool ReadFile(string, vector<Packet> &) ;
39 
55 bool SaveFile(string, vector<Packet>) ;
56 
66 void FilterBySrcAddr(vector<Packet> &, string );
67 
77 void FilterByDstAddr(vector<Packet> &, string );
78 
88 void FilterBySrcPort(vector<Packet> &, int) ;
89 
99 void FilterByDstPort(vector<Packet> &, int) ;
100 
110 void SortBySrcAddr(vector<Packet> &) ;
111 
121 void SortByDstAddr(vector<Packet> &) ;
122 
132 void SortBySrcPort(vector<Packet> &) ;
133 
143 void SortByDstPort(vector<Packet> &) ;
144 
145 class MainWindow : public QMainWindow
146 {
147  Q_OBJECT
148 private:
149  int numPackets, numOctects;
150  int filterMethod;
151  vector< Packet > netdata; // Used to store the data from the network file
152  QTableWidgetItem *item; //This pointer is used to create table entries and add them to the table
153 
154 public:
155 
161  explicit MainWindow(QWidget *parent = 0);
162 
168  ~MainWindow();
169 
170 private slots:
171 
177  void on_Filter_Box_currentIndexChanged(int index); //
178 
184  void on_actionLoad_Network_Data_triggered(); //
185 
191  void on_actionAbout_triggered(); //
192 
198  void on_actionExit_triggered();
199 
205  void FillTable();
206 
212  void on_runFilter_clicked();
213 
219  void on_sortButton_clicked();
220 
226  void on_openFile_clicked();
227 
233  void on_saveFile_clicked();
234 
240  void on_clearButton_clicked();
241 
242 private:
243  Ui::MainWindow *ui;
244 };
245 
246 #endif // MAINWINDOW_H
Definition: mainwindow.h:21
void FilterBySrcPort(vector< Packet > &netdata, int port)
Definition: Filter.cpp:49
bool SaveFile(string fname, vector< Packet > netdata)
Funcion que guarda un archivo en la computadora. Devuelve cierto cuando el archivo se guardo con exit...
Definition: File.cpp:62
void FilterByDstPort(vector< Packet > &netdata, int port)
Definition: Filter.cpp:65
void SortBySrcAddr(vector< Packet > &netdata)
Function que ordena por direccion fuente los paquetes en el archivo de netflows usando el algoritmo d...
Definition: Sort.cpp:17
void FilterByDstAddr(vector< Packet > &netdata, string address)
Definition: Filter.cpp:33
bool ReadFile(string fname, vector< Packet > &netdata)
Funcion que lee un archivo y devuelve un booleano que determina si el archivo abrio y se leyo con exi...
Definition: File.cpp:23
void FilterBySrcAddr(vector< Packet > &netdata, string address)
Definition: Filter.cpp:15
void SortByDstPort(vector< Packet > &netdata)
Function que ordena por puerto destino los paquetes en el archivo de netflows usando el algoritmo de ...
Definition: Sort.cpp:105
void SortByDstAddr(vector< Packet > &netdata)
Function que ordena por direccion destino los paquetes en el archivo de netflows usando el algoritmo ...
Definition: Sort.cpp:48
void SortBySrcPort(vector< Packet > &netdata)
Function que ordena por puerto fuente los paquetes en el archivo de netflows usando el algoritmo de S...
Definition: Sort.cpp:77
Definition: mainwindow.h:145