First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

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

  • retag add tags
/* 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);
}
Kim's avatar
1
Kim
asked 2019-09-24 19:09:22 +0000
Jaap's avatar
13.7k
Jaap
updated 2019-09-24 19:13:31 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

The offset into the PDU at which the PDU for which the length is to be extracted begins.

Guy Harris's avatar
19.9k
Guy Harris
answered 2019-09-24 19:15:18 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

The offset into the tvb where the next PDU begins.

Jaap's avatar
13.7k
Jaap
answered 2019-09-24 19:16:48 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer