Wireshark  4.3.0
The Wireshark network protocol analyzer
iax2_analysis_dialog.h
Go to the documentation of this file.
1 
10 #ifndef IAX2_ANALYSIS_DIALOG_H
11 #define IAX2_ANALYSIS_DIALOG_H
12 
13 // The GTK+ UI checks for multiple RTP streams, and if found opens the RTP
14 // stream dialog. That seems to violate the principle of least surprise.
15 // Migrate the code but disable it.
16 // #define IAX2_RTP_STREAM_CHECK
17 
18 #include <config.h>
19 
20 #include <glib.h>
21 
22 #include <epan/address.h>
23 
24 #include "ui/tap-iax2-analysis.h"
25 #include "ui/rtp_stream_id.h"
26 
27 #include <QAbstractButton>
28 #include <QMenu>
29 
30 #include "wireshark_dialog.h"
31 
32 namespace Ui {
33 class Iax2AnalysisDialog;
34 }
35 
36 class QCPGraph;
37 class QTemporaryFile;
38 
39 typedef enum {
40  TAP_IAX2_NO_ERROR,
41  TAP_IAX2_NO_PACKET_SELECTED,
42  TAP_IAX2_WRONG_LENGTH,
43  TAP_IAX2_FILE_IO_ERROR
44 } iax2_error_type_t;
45 
46 
48 {
49  Q_OBJECT
50 
51 public:
52  explicit Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf);
54 
55 signals:
56  void goToPacket(int packet_num);
57 
58 protected slots:
59  virtual void updateWidgets();
60 
61 private slots:
62  void on_actionGoToPacket_triggered();
63  void on_actionNextProblem_triggered();
64  void on_fJitterCheckBox_toggled(bool checked);
65  void on_fDiffCheckBox_toggled(bool checked);
66  void on_rJitterCheckBox_toggled(bool checked);
67  void on_rDiffCheckBox_toggled(bool checked);
68  void on_actionSaveAudio_triggered();
69  void on_actionSaveForwardAudio_triggered();
70  void on_actionSaveReverseAudio_triggered();
71  void on_actionSaveCsv_triggered();
72  void on_actionSaveForwardCsv_triggered();
73  void on_actionSaveReverseCsv_triggered();
74  void on_actionSaveGraph_triggered();
75  void on_buttonBox_helpRequested();
76  void showStreamMenu(QPoint pos);
77  void graphClicked(QMouseEvent *event);
78 
79 private:
80  Ui::Iax2AnalysisDialog *ui;
81  enum StreamDirection { dir_both_, dir_forward_, dir_reverse_ };
82 
83  rtpstream_id_t fwd_id_;
84  rtpstream_id_t rev_id_;
85 
86  tap_iax2_stat_t fwd_statinfo_;
87  tap_iax2_stat_t rev_statinfo_;
88 
89  QTemporaryFile *fwd_tempfile_;
90  QTemporaryFile *rev_tempfile_;
91 
92  // Graph data for QCustomPlot
93  QList<QCPGraph *>graphs_;
94  QVector<double> fwd_time_vals_;
95  QVector<double> fwd_jitter_vals_;
96  QVector<double> fwd_diff_vals_;
97 
98  QVector<double> rev_time_vals_;
99  QVector<double> rev_jitter_vals_;
100  QVector<double> rev_diff_vals_;
101 
102  QString err_str_;
103  iax2_error_type_t save_payload_error_;
104 
105  QMenu stream_ctx_menu_;
106  QMenu graph_ctx_menu_;
107 
108  // Tap callbacks
109  static void tapReset(void *tapinfo_ptr);
110  static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr, tap_flags_t flags);
111  static void tapDraw(void *tapinfo_ptr);
112 
113  void resetStatistics();
114  void addPacket(bool forward, packet_info *pinfo, const struct _iax2_info_t *iax2info);
115  void savePayload(QTemporaryFile *tmpfile, packet_info *pinfo, const struct _iax2_info_t *iax2info);
116  void updateStatistics();
117  void updateGraph();
118 
119  void saveAudio(StreamDirection direction);
120  void saveCsv(StreamDirection direction);
121 
122 #if 0
123  guint32 processNode(proto_node *ptree_node, header_field_info *hfinformation, const gchar* proto_field, bool *ok);
124  guint32 getIntFromProtoTree(proto_tree *protocol_tree, const gchar *proto_name, const gchar *proto_field, bool *ok);
125 #endif
126 
127  bool eventFilter(QObject*, QEvent* event);
128 };
129 
130 #endif // IAX2_ANALYSIS_DIALOG_H
Definition: capture_file.h:23
Definition: iax2_analysis_dialog.h:48
Definition: wireshark_dialog.h:35
Definition: proto.h:762
Definition: packet-iax2.h:229
Definition: packet_info.h:44
Definition: proto.h:897
Definition: rtp_stream_id.h:33
Definition: tap-iax2-analysis.h:44
Definition: epan_dissect.h:28
tap_packet_status
Definition: tap.h:25