Beispiel #1
0
void PacketList::selectionChanged (const QItemSelection & selected, const QItemSelection & deselected) {
    QTreeView::selectionChanged(selected, deselected);

    if (!cap_file_) return;

    int row = selected.first().top();
    cf_select_packet(cap_file_, row);
    related_packet_delegate_.clear();

    if (!cap_file_->edt) return;

    if (proto_tree_ && cap_file_->edt->tree) {
        proto_tree_->fillProtocolTree(cap_file_->edt->tree);
        packet_info *pi = &cap_file_->edt->pi;
        conversation_t *conv = find_conversation(pi->fd->num, &pi->src, &pi->dst, pi->ptype,
                                                pi->srcport, pi->destport, 0);
        if (conv) {
            related_packet_delegate_.setConversationSpan(conv->setup_frame, conv->last_frame);
        }
        viewport()->update();
    }

    if (byte_view_tab_) {
        GSList *src_le;
        struct data_source *source;

        byte_view_tab_->clear();

        for (src_le = cap_file_->edt->pi.data_src; src_le != NULL; src_le = src_le->next) {
            source = (struct data_source *)src_le->data;
            byte_view_tab_->addTab(get_data_source_name(source), get_data_source_tvb(source), cap_file_->edt->tree, proto_tree_, (packet_char_enc)cap_file_->current_frame->flags.encoding);
        }
        byte_view_tab_->setCurrentIndex(0);
    }
}
Beispiel #2
0
void PacketList::selectionChanged (const QItemSelection & selected, const QItemSelection & deselected) {
    QTreeView::selectionChanged(selected, deselected);

    if (!cap_file_) return;

    if (proto_tree_) {
        int row = selected.first().top();
        cf_select_packet(cap_file_, row);

        if (!cap_file_->edt && !cap_file_->edt->tree) {
            return;
        }

        proto_tree_->fillProtocolTree(cap_file_->edt->tree);
    }

    if (byte_view_tab_ && cap_file_->edt) {
        GSList *src_le;
        struct data_source *source;

        byte_view_tab_->clear();

        for (src_le = cap_file_->edt->pi.data_src; src_le != NULL; src_le = src_le->next) {
            source = (struct data_source *)src_le->data;
            byte_view_tab_->addTab(get_data_source_name(source), get_data_source_tvb(source), cap_file_->edt->tree, proto_tree_, (packet_char_enc)cap_file_->current_frame->flags.encoding);
        }
        byte_view_tab_->setCurrentIndex(0);
    }
}