12#ifndef DECODE_AS_MODEL_H
13#define DECODE_AS_MODEL_H
17#include <QAbstractItemModel>
24#include <epan/dissectors/packet-dcerpc.h>
35 DecodeAsItem(
const char *table_name = NULL,
const void *selector = NULL);
47 const char*
tableName()
const {
return tableName_; }
107 void init(
const char *table_name,
const void *selector = NULL);
109 const char* tableName_;
110 const char* tableUIName_;
115 QString selectorString_;
121 QString default_dissector_;
122 QString current_dissector_;
171 UIntEntry(
const char* t, uint32_t k,
const char* pref_suffix) :
172 table(t), key(k), pref_name(t) { pref_name.append(pref_suffix); }
192 Qt::ItemFlags flags(
const QModelIndex &index)
const;
198 QVariant data(
const QModelIndex &index,
int role)
const;
205 QVariant headerData(
int section, Qt::Orientation orientation,
206 int role = Qt::DisplayRole)
const;
211 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
216 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
224 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
243 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
250 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
261 bool copyRow(
int dst_row,
int src_row);
267 bool copyFromProfile(QString filename,
const char **err);
273 static QString entryString(
const char *table_name,
const void *value);
287 static void buildChangedList(
const char *table_name,
ftenum_t selector_type,
288 void *key,
void *value,
void *user_data);
293 static void buildDceRpcChangedList(
void *data,
void *user_data);
301 static void gatherChangedEntries(
const char *table_name,
ftenum_t selector_type,
302 void *key,
void *value,
void *user_data);
310 void *user_data,
bool);
314 QList<DecodeAsItem *> decode_as_items_;
315 QList<UIntEntry> changed_uint_entries_;
316 QList<QPair<const char *, const char *> > changed_string_entries_;
Represents a single "Decode As" mapping entry in the UI.
Definition decode_as_model.h:30
const guid_key * selectorUUID() const
Return the selector as a UUID key.
Definition decode_as_model.h:67
virtual ~DecodeAsItem()
Destroy the DecodeAsItem.
Definition decode_as_model.cpp:64
dissector_handle_t dissectorHandle() const
Return the handle of the currently selected dissector.
Definition decode_as_model.h:79
QString selectorString() const
Return the selector as a string.
Definition decode_as_model.h:59
void setUUID(const guid_key &key)
Set the UUID selector key.
Definition decode_as_model.cpp:147
decode_dcerpc_bind_values_t * selectorDCERPC() const
Return the selector as a DCE/RPC bind value.
Definition decode_as_model.h:63
void setTable(const decode_as_t *entry)
Set the dissector table from a decode_as_t entry.
Definition decode_as_model.cpp:108
const char * tableName() const
Return the dissector table name.
Definition decode_as_model.h:47
void setSelector(const QString &value)
Set the selector value from a string.
Definition decode_as_model.cpp:124
uint selectorUint() const
Return the selector as an unsigned integer.
Definition decode_as_model.h:55
void updateHandles()
Refresh the default and current dissector name strings from the current dissector handle.
Definition decode_as_model.cpp:153
QString currentDissector() const
Return the name of the currently selected dissector.
Definition decode_as_model.h:75
void setDissectorHandle(dissector_handle_t handle)
Set the dissector handle.
Definition decode_as_model.cpp:137
QString defaultDissector() const
Return the name of the default dissector for this entry.
Definition decode_as_model.h:71
const char * tableUIName() const
Return the dissector table name for display in the UI.
Definition decode_as_model.h:51
Table model backing the Decode As dialog.
Definition decode_as_model.h:142
DecodeAsColumn
Column indices for the Decode As table.
Definition decode_as_model.h:179
@ colProtocol
Definition decode_as_model.h:184
@ colDefault
Definition decode_as_model.h:183
@ colType
Definition decode_as_model.h:182
@ colSelector
Definition decode_as_model.h:181
enum ftenum ftenum_t
Convenience typedef for ftenum.
Definition ftypes.h:190
prefs_set_pref_e
Result of setting a preference.
Definition prefs.h:1271
Represents a capture file and its associated metadata.
Definition cfile.h:84
Definition decode_as_model.h:126
Lookup key for GUID-indexed dissector tables, combining a GUID with an optional version field.
Definition packet.h:558
A pending change to a uint-keyed dissector table entry.
Definition decode_as_model.h:161
UIntEntry(const char *t, uint32_t k, const char *pref_suffix)
Construct a UIntEntry.
Definition decode_as_model.h:171
QByteArray table
Definition decode_as_model.h:162
QByteArray pref_name
Definition decode_as_model.h:164
uint32_t key
Definition decode_as_model.h:163
Definition decode_as.h:73
Definition packet-dcerpc.h:471