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_; }
63 decode_dcerpc_bind_values_t*
selectorDCERPC()
const {
return selectorDCERPC_; }
107 void init(
const char *table_name,
const void *selector = NULL);
109 const char* tableName_;
110 const char* tableUIName_;
115 QString selectorString_;
118 decode_dcerpc_bind_values_t* selectorDCERPC_;
121 QString default_dissector_;
122 QString current_dissector_;
123 dissector_handle_t dissector_handle_;
174 UIntEntry(
const char* t, uint32_t k,
const char* pref_suffix) :
195 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
201 QVariant data(
const QModelIndex &index,
int role)
const override;
208 QVariant headerData(
int section, Qt::Orientation orientation,
209 int role = Qt::DisplayRole)
const override;
214 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
219 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
227 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
238 void setDissectorHandle(
const QModelIndex &index, dissector_handle_t
dissector_handle);
246 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex())
override;
253 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex())
override;
264 bool copyRow(
int dst_row,
int src_row);
270 bool copyFromProfile(QString filename,
const char **err);
276 static QString entryString(
const char *table_name,
const void *value);
290 static void buildChangedList(
const char *table_name,
ftenum_t selector_type,
291 void *key,
void *value,
void *user_data);
296 static void buildDceRpcChangedList(
void *data,
void *user_data);
304 static void gatherChangedEntries(
const char *table_name,
ftenum_t selector_type,
305 void *key,
void *value,
void *user_data);
313 void *user_data,
bool);
317 QList<DecodeAsItem *> decode_as_items_;
318 QList<UIntEntry> changed_uint_entries_;
319 QList<QPair<const char *, const char *> > changed_string_entries_;
struct _capture_file capture_file
Represents a capture file and its associated metadata.
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
DecodeAsItem(const char *table_name=NULL, const void *selector=NULL)
Construct a DecodeAsItem from a raw table name and selector.
Definition decode_as_model.cpp:32
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
DecodeAsModel(QObject *parent, capture_file *cf=NULL)
Construct a DecodeAsModel.
Definition decode_as_model.cpp:170
DecodeAsColumn
Column indices for the Decode As table.
Definition decode_as_model.h:182
@ colProtocol
Definition decode_as_model.h:187
@ colDefault
Definition decode_as_model.h:186
@ colTable
Definition decode_as_model.h:183
@ colType
Definition decode_as_model.h:185
@ colDecodeAsMax
Definition decode_as_model.h:188
@ colSelector
Definition decode_as_model.h:184
struct decode_as_s decode_as_t
struct _dissector_info_t dissector_info_t
Bundles identifying metadata and a handle for a single registered dissector.
enum ftenum ftenum_t
Convenience typedef for ftenum.
Definition ftypes.h:190
struct _guid_key guid_key
Lookup key for GUID-indexed dissector tables, combining a GUID with an optional version field.
prefs_set_pref_e
Result of setting a preference.
Definition prefs.h:1268
Bundles identifying metadata and a handle for a single registered dissector.
Definition decode_as_model.h:129
QString proto_name
Definition decode_as_model.h:130
guid_key dcerpc_uuid
Definition decode_as_model.h:131
dissector_handle_t dissector_handle
Definition decode_as_model.h:132
UIntEntry(const char *t, uint32_t k, const char *pref_suffix)
Construct a UIntEntry.
Definition decode_as_model.h:174
QByteArray table
Definition decode_as_model.h:165
QByteArray pref_name
Definition decode_as_model.h:167
uint32_t key
Definition decode_as_model.h:166