forked from osmocom/wireshark
Sequence / flow diagram updates.
Plumb some controls. Adjust dialog layout. Make sure sequence information is allocated and freed correctly. Remove a debugging statement. svn path=/trunk/; revision=53260
This commit is contained in:
parent
a33c6a8ced
commit
66bb75dd4e
|
@ -138,7 +138,7 @@ toggle_select_srcdst(GtkWidget *widget _U_, gpointer user_data _U_)
|
|||
{
|
||||
/* is the button now active? */
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(src_dst_rb))) {
|
||||
graph_analysis->any_addr = FALSE;
|
||||
graph_analysis->any_addr = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ flow_graph_dlg_create(void)
|
|||
("Nodes in the diagram are identified with source and destination addresses"));
|
||||
g_signal_connect(src_dst_rb, "toggled", G_CALLBACK(toggle_select_srcdst), NULL);
|
||||
ws_gtk_grid_attach(GTK_GRID(node_addr_grid), src_dst_rb, 0, 0, 1, 1);
|
||||
if (!graph_analysis->any_addr) {
|
||||
if (graph_analysis->any_addr) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(src_dst_rb),TRUE);
|
||||
}
|
||||
gtk_widget_show(src_dst_rb);
|
||||
|
@ -312,7 +312,7 @@ flow_graph_dlg_create(void)
|
|||
("Nodes in the diagram are identified with network source and destination addresses"));
|
||||
g_signal_connect(net_src_dst_rb, "toggled", G_CALLBACK(toggle_select_netsrcdst), NULL);
|
||||
ws_gtk_grid_attach(GTK_GRID(node_addr_grid), net_src_dst_rb, 0, 1, 1, 1);
|
||||
if (graph_analysis->any_addr) {
|
||||
if (!graph_analysis->any_addr) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(net_src_dst_rb),TRUE);
|
||||
}
|
||||
gtk_widget_show(net_src_dst_rb);
|
||||
|
|
|
@ -799,7 +799,6 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data)
|
|||
}
|
||||
pango_layout_set_text(layout, label_string, -1);
|
||||
#endif
|
||||
g_warning("= layout width: %d: %s", pango_layout_get_width(layout), pango_layout_get_text(layout));
|
||||
pango_layout_get_pixel_size(layout, &label_width, &label_height);
|
||||
|
||||
if ((int)left_x_border > ((int)label_x-(int)label_width/2))
|
||||
|
|
|
@ -56,6 +56,7 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *
|
|||
key_axis_(keyAxis),
|
||||
value_axis_(valueAxis),
|
||||
comment_axis_(commentAxis),
|
||||
data_(NULL),
|
||||
sainfo_(NULL)
|
||||
{
|
||||
data_ = new WSCPSeqDataMap();
|
||||
|
|
|
@ -34,11 +34,8 @@
|
|||
#include <QDebug>
|
||||
|
||||
// To do:
|
||||
// - Implement controls
|
||||
// - Make reset button "apply"?
|
||||
// - Save as
|
||||
// - Add UTF8 to text dump
|
||||
// - Fix scroll bar ranges
|
||||
// - Context menu
|
||||
// - Selection highlighting
|
||||
// - Keyboard shortcuts
|
||||
|
@ -76,15 +73,27 @@ SequenceDialog::SequenceDialog(QWidget *parent, capture_file *cf, SequenceType t
|
|||
connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange)));
|
||||
|
||||
memset (&seq_analysis_, 0, sizeof(seq_analysis_));
|
||||
|
||||
ui->showComboBox->setCurrentIndex(0);
|
||||
ui->addressComboBox->setCurrentIndex(0);
|
||||
|
||||
QComboBox *fcb = ui->flowComboBox;
|
||||
fcb->addItem(ui->actionFlowAny->text(), SEQ_ANALYSIS_ANY);
|
||||
fcb->addItem(ui->actionFlowTcp->text(), SEQ_ANALYSIS_TCP);
|
||||
|
||||
switch (type) {
|
||||
case any:
|
||||
seq_analysis_.type = SEQ_ANALYSIS_ANY;
|
||||
ui->flowComboBox->setCurrentIndex(SEQ_ANALYSIS_ANY);
|
||||
break;
|
||||
case tcp:
|
||||
seq_analysis_.type = SEQ_ANALYSIS_TCP;
|
||||
ui->flowComboBox->setCurrentIndex(SEQ_ANALYSIS_TCP);
|
||||
break;
|
||||
case voip:
|
||||
seq_analysis_.type = SEQ_ANALYSIS_VOIP;
|
||||
ui->flowComboBox->hide();
|
||||
ui->flowLabel->hide();
|
||||
break;
|
||||
}
|
||||
seq_analysis_.all_packets = TRUE;
|
||||
|
@ -291,3 +300,33 @@ void SequenceDialog::on_actionGoToPacket_triggered()
|
|||
emit goToPacket(packet_num_);
|
||||
}
|
||||
}
|
||||
|
||||
void SequenceDialog::on_showComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
seq_analysis_.all_packets = TRUE;
|
||||
} else {
|
||||
seq_analysis_.all_packets = FALSE;
|
||||
}
|
||||
|
||||
if (isVisible()) fillDiagram();
|
||||
}
|
||||
|
||||
void SequenceDialog::on_flowComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) return;
|
||||
seq_analysis_.type = static_cast<seq_analysis_type>(ui->flowComboBox->itemData(index).toInt());
|
||||
|
||||
if (isVisible()) fillDiagram();
|
||||
}
|
||||
|
||||
void SequenceDialog::on_addressComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
seq_analysis_.any_addr = TRUE;
|
||||
} else {
|
||||
seq_analysis_.any_addr = FALSE;
|
||||
}
|
||||
|
||||
if (isVisible()) fillDiagram();
|
||||
}
|
||||
|
|
|
@ -73,6 +73,12 @@ private slots:
|
|||
void on_resetButton_clicked();
|
||||
void on_actionGoToPacket_triggered();
|
||||
|
||||
void on_showComboBox_currentIndexChanged(int index);
|
||||
|
||||
void on_flowComboBox_currentIndexChanged(int index);
|
||||
|
||||
void on_addressComboBox_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
Ui::SequenceDialog *ui;
|
||||
SequenceDiagram *seq_diagram_;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="controlHorizontalLayout">
|
||||
<layout class="QHBoxLayout" name="controlHorizontalLayout" stretch="0,0,0,0,0,0,0,0,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
@ -62,7 +62,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="packetComboBox">
|
||||
<widget class="QComboBox" name="showComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>All packets</string>
|
||||
|
@ -89,25 +89,14 @@
|
|||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="flowLabel">
|
||||
<property name="text">
|
||||
<string>Flow type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="flowComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>General</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>TCP</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="flowComboBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
|
@ -143,6 +132,19 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -191,6 +193,28 @@
|
|||
<string>G</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFlowAny">
|
||||
<property name="text">
|
||||
<string>All Flows</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show flows for all packets</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFlowTcp">
|
||||
<property name="text">
|
||||
<string>TCP Flows</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show only TCP flow information</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -60,36 +60,31 @@ seq_analysis_frame_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U
|
|||
|
||||
if ((sainfo->all_packets)||(pinfo->fd->flags.passed_dfilter==1)){
|
||||
int i;
|
||||
gchar *protocol;
|
||||
gchar *colinfo;
|
||||
seq_analysis_item_t *sai;
|
||||
|
||||
protocol = NULL;
|
||||
colinfo = NULL;
|
||||
gchar *protocol = NULL;
|
||||
gchar *colinfo = NULL;
|
||||
seq_analysis_item_t *sai = NULL;
|
||||
|
||||
if (sainfo->any_addr) {
|
||||
if (pinfo->net_src.type!=AT_NONE && pinfo->net_dst.type!=AT_NONE) {
|
||||
sai = (seq_analysis_item_t *)g_malloc(sizeof(seq_analysis_item_t));
|
||||
sai = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
|
||||
COPY_ADDRESS(&(sai->src_addr),&(pinfo->net_src));
|
||||
COPY_ADDRESS(&(sai->dst_addr),&(pinfo->net_dst));
|
||||
}
|
||||
else return FALSE;
|
||||
|
||||
} else {
|
||||
if (pinfo->src.type!=AT_NONE && pinfo->dst.type!=AT_NONE) {
|
||||
sai = (seq_analysis_item_t *)g_malloc(sizeof(seq_analysis_item_t));
|
||||
sai = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
|
||||
COPY_ADDRESS(&(sai->src_addr),&(pinfo->src));
|
||||
COPY_ADDRESS(&(sai->dst_addr),&(pinfo->dst));
|
||||
}
|
||||
else return FALSE;
|
||||
}
|
||||
|
||||
if (!sai) return FALSE;
|
||||
|
||||
sai->fd = pinfo->fd;
|
||||
|
||||
sai->port_src=pinfo->srcport;
|
||||
sai->port_dst=pinfo->destport;
|
||||
sai->comment=NULL;
|
||||
sai->frame_label=NULL;
|
||||
|
||||
if(pinfo->cinfo) {
|
||||
if (pinfo->cinfo->col_first[COL_INFO]>=0){
|
||||
|
@ -159,7 +154,7 @@ seq_analysis_tcp_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt
|
|||
gchar flags[64];
|
||||
seq_analysis_item_t *sai;
|
||||
|
||||
sai = (seq_analysis_item_t *)g_malloc(sizeof(seq_analysis_item_t));
|
||||
sai = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
|
||||
sai->fd = pinfo->fd;
|
||||
if (sainfo->any_addr) {
|
||||
COPY_ADDRESS(&(sai->src_addr),&(pinfo->net_src));
|
||||
|
@ -259,6 +254,7 @@ void
|
|||
sequence_analysis_list_free(seq_analysis_info_t *sainfo)
|
||||
{
|
||||
GList *list;
|
||||
int i;
|
||||
|
||||
if (!sainfo) return;
|
||||
|
||||
|
@ -274,8 +270,16 @@ sequence_analysis_list_free(seq_analysis_info_t *sainfo)
|
|||
list = g_list_next(list);
|
||||
}
|
||||
g_list_free(sainfo->list);
|
||||
sainfo->nconv = 0;
|
||||
sainfo->list = NULL;
|
||||
sainfo->nconv = 0;
|
||||
|
||||
for (i=0; i<MAX_NUM_NODES; i++) {
|
||||
sainfo->nodes[i].type = AT_NONE;
|
||||
sainfo->nodes[i].len = 0;
|
||||
g_free((void *)sainfo->nodes[i].data);
|
||||
sainfo->nodes[i].data = NULL;
|
||||
}
|
||||
sainfo->num_nodes = 0;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue