11.11.  Adding information to the dissection tree

11.11.1. TreeItem

TreeItems represent information in the packet-details pane. A root TreeItem is passed to dissectors as the third argument.

11.11.1.1. treeitem:add_packet_field()

Adds an child item to a given item, returning the child. tree_item:add_packet_field([proto_field], [tvbrange], [encoding], ...)

11.11.1.2. treeitem:add()

Adds an child item to a given item, returning the child. tree_item:add([proto_field | proto], [tvbrange], [label], ...) if the proto_field represents a numeric value (int, uint or float) is to be treated as a Big Endian (network order) Value.

11.11.1.2.1. Returns

The child item

11.11.1.3. treeitem:add_le()

Adds (and returns) an child item to a given item, returning the child. tree_item:add([proto_field | proto], [tvbrange], [label], ...) if the proto_field represents a numeric value (int, uint or float) is to be treated as a Little Endian Value.

11.11.1.3.1. Returns

The child item

11.11.1.4. treeitem:set_text(text)

Sets the text of the label

11.11.1.4.1. Arguments
text

The text to be used.

11.11.1.5. treeitem:append_text(text)

Appends text to the label

11.11.1.5.1. Arguments
text

The text to be appended.

11.11.1.6. treeitem:set_expert_flags([group], [severity])

Sets the expert flags of the item.

11.11.1.6.1. Arguments
group (optional)

One of PI_CHECKSUM, PI_SEQUENCE, PI_RESPONSE_CODE, PI_REQUEST_CODE, PI_UNDECODED, PI_REASSEMBLE, PI_MALFORMED or PI_DEBUG

severity (optional)

One of PI_CHAT, PI_NOTE, PI_WARN, PI_ERROR

11.11.1.7. treeitem:add_expert_info([group], [severity], [text])

Sets the expert flags of the item and adds expert info to the packet.

11.11.1.7.1. Arguments
group (optional)

One of PI_CHECKSUM, PI_SEQUENCE, PI_RESPONSE_CODE, PI_REQUEST_CODE, PI_UNDECODED, PI_REASSEMBLE, PI_MALFORMED or PI_DEBUG

severity (optional)

One of PI_CHAT, PI_NOTE, PI_WARN, PI_ERROR

text (optional)

The text for the expert info

11.11.1.8. treeitem:set_generated()

Marks the TreeItem as a generated field (with data infered but not contained in the packet).

11.11.1.9. treeitem:set_hidden()

Should not be used

11.11.1.10. treeitem:set_len(len)

Set TreeItem's length inside tvb, after it has already been created.

11.11.1.10.1. Arguments
len

The length to be used.