1 /* lte_mac_statistics_dialog.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef __LTE_MAC_STATISTICS_DIALOG_H__
11 #define __LTE_MAC_STATISTICS_DIALOG_H__
12 
13 #include "tap_parameter_dialog.h"
14 
15 #include <QLabel>
16 #include <QCheckBox>
17 
18 #include <ui/qt/models/percent_bar_delegate.h>
19 
20 // Common channel stats
21 typedef struct mac_lte_common_stats {
22     guint32 all_frames;
23     guint32 mib_frames;
24     guint32 sib_frames;
25     guint32 sib_bytes;
26     guint32 pch_frames;
27     guint32 pch_bytes;
28     guint32 pch_paging_ids;
29     guint32 rar_frames;
30     guint32 rar_entries;
31 
32     guint16  max_ul_ues_in_tti;
33     guint16  max_dl_ues_in_tti;
34 } mac_lte_common_stats;
35 
36 
37 class LteMacStatisticsDialog : public TapParameterDialog
38 {
39     Q_OBJECT
40 
41 public:
42     LteMacStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter);
43     ~LteMacStatisticsDialog();
44 
45 protected:
46     void captureFileClosing();
47 
48 private:
49     // Extra controls needed for this dialog.
50     QLabel *commonStatsLabel_;
51     QCheckBox *showSRFilterCheckBox_;
52     QCheckBox *showRACHFilterCheckBox_;
53     PercentBarDelegate *ul_delegate_, *dl_delegate_;
54     QString   displayFilter_;
55 
56     // Callbacks for register_tap_listener
57     static void tapReset(void *ws_dlg_ptr);
58     static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr);
59     static void tapDraw(void *ws_dlg_ptr);
60 
61     virtual const QString filterExpression();
62 
63     // Common stats.
64     mac_lte_common_stats commonStats_;
65     bool commonStatsCurrent_;          // Set when changes have not yet been drawn
66     void updateCommonStats(const struct mac_lte_tap_info *mlt_info);
67     void drawCommonStats();
68     void clearCommonStats();
69 
70     unsigned  getFrameCount();
71 
72     QList<QVariant> treeItemData(QTreeWidgetItem *item) const;
73 
74 private slots:
75     virtual void fillTree();
76     void updateHeaderLabels();
77     void filterUpdated(QString filter);
78 };
79 
80 #endif // __LTE_MAC_STATISTICS_DIALOG_H__
81