Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In get_foo_message_len(...) - What value is passed into offset?

/* determine PDU length of protocol foo / static guint get_foo_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { / TODO: change this to your needs / return (guint)tvb_get_ntohl(tvb, offset+4); / e.g. length is at offset 4 */ }

/* The main dissecting routine */ static int dissect_foo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN, get_foo_message_len, dissect_foo_message, data); return tvb_captured_length(tvb); }

click to hide/show revision 2
None

In get_foo_message_len(...) - What value is passed into offset?

/* determine PDU length of protocol foo /
*/
static guint
get_foo_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
{
    / /* TODO: change this to your needs /
*/
    return (guint)tvb_get_ntohl(tvb, offset+4); / /* e.g. length is at offset 4 */
}

}

/* The main dissecting routine */ static int dissect_foo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN, get_foo_message_len, dissect_foo_message, data); return tvb_captured_length(tvb); }

}