forked from osmocom/wireshark
Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
This commit is contained in:
parent
9bbc337306
commit
ceb8d954d2
|
@ -1073,7 +1073,7 @@ dissect_c1222_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
* \returns length of entire C12.22 message
|
||||
*/
|
||||
static guint
|
||||
get_c1222_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
|
||||
get_c1222_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
int orig_offset;
|
||||
guint length;
|
||||
|
|
|
@ -190,7 +190,8 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
|
|||
return offset;
|
||||
}
|
||||
|
||||
static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 plen;
|
||||
|
||||
|
|
|
@ -229,7 +229,8 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
|
|||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 len;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ static gint ett_ilp = -1;
|
|||
|
||||
|
||||
static guint
|
||||
get_ilp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ilp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* PDU length = Message length */
|
||||
return tvb_get_ntohs(tvb,offset);
|
||||
|
|
|
@ -2170,7 +2170,7 @@ kerberos_rm_to_reclen(guint krb_rm)
|
|||
}
|
||||
|
||||
guint
|
||||
get_krb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_krb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint krb_rm;
|
||||
gint pdulen;
|
||||
|
|
|
@ -1619,7 +1619,8 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
|
|||
|
||||
|
||||
static guint
|
||||
get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* sasl encapsulated ldap is 4 bytes plus the length in size */
|
||||
return tvb_get_ntohl(tvb, offset)+4;
|
||||
|
@ -1633,7 +1634,8 @@ dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 len;
|
||||
gboolean ind;
|
||||
|
|
|
@ -167,7 +167,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_sabp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_sabp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 type_length;
|
||||
int bit_offset;
|
||||
|
|
|
@ -72,7 +72,7 @@ static gint ett_ulp = -1;
|
|||
|
||||
|
||||
static guint
|
||||
get_ulp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ulp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* PDU length = Message length */
|
||||
return tvb_get_ntohs(tvb,offset);
|
||||
|
|
|
@ -2922,19 +2922,20 @@ The arguments to tcp_dissect_pdus are:
|
|||
|
||||
a routine that takes as arguments a packet_info pointer, a tvbuff
|
||||
pointer and an offset value representing the offset into the tvbuff
|
||||
at which a PDU begins and should return - *without* throwing an
|
||||
exception (it is guaranteed that the number of bytes specified by the
|
||||
previous argument to tcp_dissect_pdus is available, but more data
|
||||
might not be available, so don't refer to any data past that) - the
|
||||
total length of the PDU, in bytes;
|
||||
at which a PDU begins, and a void pointer for user data, and should
|
||||
return - *without* throwing an exception (it is guaranteed that the
|
||||
number of bytes specified by the previous argument to
|
||||
tcp_dissect_pdus is available, but more data might not be available,
|
||||
so don't refer to any data past that) - the total length of the PDU,
|
||||
in bytes;
|
||||
|
||||
a new_dissector_t routine to dissect the pdu that's passed a tvbuff
|
||||
pointer, packet_info pointer, proto_tree pointer and a void pointer for
|
||||
user data, with the tvbuff containing a possibly-reassembled PDU. (The
|
||||
"reported_length" of the tvbuff will be the length of the PDU).
|
||||
|
||||
a void pointer to user data that is passed to the dissector routine
|
||||
referenced in the previous parameter.
|
||||
a void pointer to user data that is passed to the length-determining
|
||||
routine, and the dissector routine referenced in the previous parameter.
|
||||
|
||||
2.7.2 Modifying the pinfo struct.
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ dissect_PROTOABBREV_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
|
||||
/* For tcp_dissect_pdus() */
|
||||
static guint
|
||||
get_PROTOABBREV_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_PROTOABBREV_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return (guint) tvb_get_ntohs(tvb, offset+3);
|
||||
}
|
||||
|
|
|
@ -2153,12 +2153,13 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
|
|||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
static guint get_9P_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_9P_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return (guint) tvb_get_letohl(tvb, offset);
|
||||
}
|
||||
|
||||
static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
||||
static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||
{
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4,
|
||||
get_9P_message_len, dissect_9P_message, data);
|
||||
|
|
|
@ -309,7 +309,8 @@ dissect_UDPOut(tvbuff_t *tvb, proto_tree *adwin_tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_adwin_TCPUpdate_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_adwin_TCPUpdate_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/*
|
||||
* Return the length of the packet. (Doesn't include the length field itself)
|
||||
|
|
|
@ -761,7 +761,7 @@ dissect_rem_caps_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint
|
|||
|
||||
|
||||
static guint
|
||||
get_agentx_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_agentx_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint8 flags;
|
||||
guint32 plen;
|
||||
|
|
|
@ -1368,7 +1368,7 @@ dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo, int offset,
|
|||
}
|
||||
|
||||
static guint
|
||||
get_aim_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_aim_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
|
|
|
@ -833,7 +833,7 @@ dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
* packet length. see comments in packet-tcp.c:tcp_dissect_pdus().
|
||||
*/
|
||||
static guint
|
||||
get_ajp13_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ajp13_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/*guint16 magic;*/
|
||||
guint16 plen;
|
||||
|
|
|
@ -397,7 +397,7 @@ static void
|
|||
check_amqp_version(tvbuff_t *tvb, amqp_conv *conn);
|
||||
|
||||
static guint
|
||||
get_amqp_1_0_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
|
||||
get_amqp_1_0_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void* data);
|
||||
|
||||
static guint
|
||||
dissect_amqp_1_0_list(tvbuff_t *tvb,
|
||||
|
@ -431,10 +431,10 @@ dissect_amqp_1_0_array(tvbuff_t *tvb,
|
|||
const char *name);
|
||||
|
||||
static guint
|
||||
get_amqp_0_10_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
|
||||
get_amqp_0_10_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void* data);
|
||||
|
||||
static guint
|
||||
get_amqp_0_9_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
|
||||
get_amqp_0_9_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void* data);
|
||||
|
||||
static void
|
||||
dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guint length, proto_item *item);
|
||||
|
@ -2758,7 +2758,7 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
conversation_t *conv;
|
||||
amqp_conv *conn;
|
||||
guint fixed_length;
|
||||
guint (*length_getter)(packet_info *, tvbuff_t *, int);
|
||||
guint (*length_getter)(packet_info *, tvbuff_t *, int, void*);
|
||||
new_dissector_t dissector;
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMQP");
|
||||
|
@ -2859,7 +2859,8 @@ check_amqp_version(tvbuff_t *tvb, amqp_conv *conn)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_amqp_1_0_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_amqp_1_0_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* Heuristic - protocol initialisation frame starts with 'AMQP' */
|
||||
if (tvb_memeql(tvb, offset, "AMQP", 4) == 0)
|
||||
|
@ -2868,7 +2869,8 @@ get_amqp_1_0_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* Heuristic - protocol initialisation frame starts with 'AMQP' */
|
||||
if (tvb_memeql(tvb, offset, "AMQP", 4) == 0)
|
||||
|
@ -2878,7 +2880,8 @@ get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_amqp_0_9_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_amqp_0_9_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 length;
|
||||
|
||||
|
|
|
@ -636,7 +636,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ancp_msg_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ancp_msg_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return (guint)tvb_get_ntohs(tvb, offset + 2) + 4; /* 2B len + 4B hdr */
|
||||
}
|
||||
|
|
|
@ -195,7 +195,9 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse
|
|||
/**
|
||||
* Get the length of a particular PDU (+6 bytes for the frame)
|
||||
*/
|
||||
static guint get_aol_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) {
|
||||
static guint get_aol_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
/* Get the PDU length */
|
||||
|
|
|
@ -6770,7 +6770,7 @@ dissect_r3_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
}
|
||||
|
||||
static guint
|
||||
get_r3_message_len (packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_r3_message_len (packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return (guint) tvb_get_guint8 (tvb, offset + 3) + 1;
|
||||
}
|
||||
|
|
|
@ -385,7 +385,8 @@ static expert_field ei_bitcoin_command_unknown = EI_INIT;
|
|||
static gboolean bitcoin_desegment = TRUE;
|
||||
|
||||
static guint
|
||||
get_bitcoin_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_bitcoin_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 length;
|
||||
length = BITCOIN_HEADER_LENGTH;
|
||||
|
|
|
@ -257,7 +257,8 @@ static struct client_information peer_id[] = {
|
|||
};
|
||||
|
||||
static guint
|
||||
get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint8 type;
|
||||
guint32 length;
|
||||
|
|
|
@ -1595,7 +1595,7 @@ dissect_c1222_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
* \returns length of entire C12.22 message
|
||||
*/
|
||||
static guint
|
||||
get_c1222_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
|
||||
get_c1222_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
int orig_offset;
|
||||
guint length;
|
||||
|
|
|
@ -1001,7 +1001,7 @@ dissect_cast_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
|
|||
|
||||
/* Get the length of a single CAST PDU */
|
||||
static guint
|
||||
get_cast_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_cast_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 hdr_data_length;
|
||||
|
||||
|
|
|
@ -1604,7 +1604,8 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
|
|||
return offset;
|
||||
}
|
||||
|
||||
static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 plen;
|
||||
|
||||
|
|
|
@ -623,7 +623,7 @@ dissect_cmpp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
|
|||
|
||||
/* Get the CMPP PDU Length */
|
||||
static guint
|
||||
get_cmpp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset)
|
||||
get_cmpp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohl(tvb, offset);
|
||||
}
|
||||
|
|
|
@ -906,7 +906,7 @@ static int cops_tag_cls2syntax ( guint tag, guint cls ) {
|
|||
}
|
||||
|
||||
static guint
|
||||
get_cops_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_cops_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/*
|
||||
* Get the length of the COPS message.
|
||||
|
|
|
@ -522,7 +522,8 @@ static gboolean couchbase_desegment_body = TRUE;
|
|||
|
||||
|
||||
static guint
|
||||
get_couchbase_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_couchbase_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 bodylen;
|
||||
|
||||
|
|
|
@ -138,7 +138,8 @@ dissect_db_lsp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
}
|
||||
|
||||
static guint
|
||||
get_db_lsp_pdu_len (packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_db_lsp_pdu_len (packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
if (tvb_get_ntohs (tvb, offset + 1) != 0x0301) {
|
||||
/* Unknown data, eat remaining data for this frame */
|
||||
|
|
|
@ -588,7 +588,8 @@ dissect_dbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
#define DBUS_HEADER_LEN 16
|
||||
|
||||
static guint
|
||||
get_dbus_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dbus_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 (*get_guint32)(tvbuff_t *, const gint);
|
||||
|
||||
|
|
|
@ -5094,11 +5094,13 @@ dissect_dcerpc_cn_bs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dcerpc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
|
||||
get_dcerpc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset _U_, void *data _U_)
|
||||
{
|
||||
guint8 drep[4];
|
||||
guint16 frag_len;
|
||||
|
||||
/* XXX: why does htis not take offset into account? */
|
||||
tvb_memcpy(tvb, (guint8 *)drep, 4, sizeof(drep));
|
||||
frag_len = dcerpc_tvb_get_ntohs(tvb, 8, drep);
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ static const value_string serverflag_vals[] =
|
|||
|
||||
/* Code to actually dissect the packets */
|
||||
static guint
|
||||
get_dhcpfo_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dhcpfo_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/*
|
||||
* Return the length of the DHCP failover packet.
|
||||
|
|
|
@ -1997,7 +1997,8 @@ dissect_dhcpv6_upstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
|
||||
static guint
|
||||
get_dhcpv6_bulk_leasequery_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dhcpv6_bulk_leasequery_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return (tvb_get_ntohs(tvb, offset)+2);
|
||||
}
|
||||
|
|
|
@ -1302,7 +1302,8 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
}
|
||||
|
||||
static guint
|
||||
get_diameter_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_diameter_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* Get the length of the Diameter packet. */
|
||||
return tvb_get_ntoh24(tvb, offset + 1);
|
||||
|
|
|
@ -267,7 +267,7 @@ test_djiuav(tvbuff_t *tvb)
|
|||
|
||||
/* Get the length of the full pdu */
|
||||
static guint
|
||||
get_djiuav_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_djiuav_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_guint8(tvb, offset + 2);
|
||||
}
|
||||
|
|
|
@ -511,7 +511,7 @@ dissect_dlsw_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dlsw_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dlsw_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint hlen, mlen;
|
||||
|
||||
|
|
|
@ -3469,7 +3469,8 @@ check_dnp3_header(tvbuff_t *tvb)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dnp3_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dnp3_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint16 message_len; /* need 16 bits as total can exceed 255 */
|
||||
guint16 data_crc; /* No. of user data CRC bytes */
|
||||
|
|
|
@ -3973,7 +3973,7 @@ dissect_llmnr_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
|
|
|
@ -780,7 +780,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
|
|||
}
|
||||
|
||||
static guint
|
||||
get_drda_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_drda_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
if (tvb_length_remaining(tvb, offset) >= 10)
|
||||
{
|
||||
|
|
|
@ -325,7 +325,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 plen;
|
||||
guint8 dsi_flags,dsi_command;
|
||||
|
|
|
@ -1704,7 +1704,8 @@ evaluate_sdnv_64(tvbuff_t *tvb, int offset, int *bytecount)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dtn_contact_header_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dtn_contact_header_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
int len, bytecount;
|
||||
|
||||
|
@ -1763,7 +1764,7 @@ dissect_dtn_contact_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
}
|
||||
|
||||
static guint
|
||||
get_tcpcl_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_tcpcl_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
int len, bytecount;
|
||||
guint8 conv_hdr = tvb_get_guint8(tvb, offset);
|
||||
|
|
|
@ -2912,7 +2912,8 @@ static int dissect_kademlia_udp_compressed_message(guint8 msg_type,
|
|||
}
|
||||
|
||||
|
||||
static guint get_edonkey_tcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_edonkey_tcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 msg_len;
|
||||
|
||||
|
|
|
@ -471,7 +471,8 @@ static int elasticsearch_dissect_valid_binary_packet(tvbuff_t *tvb, packet_info
|
|||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
static guint elasticsearch_get_binary_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint elasticsearch_get_binary_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* length is two bytes into the packet, also the length doesn't include the starting 6 bytes */
|
||||
return (guint)tvb_get_ntohl(tvb, offset+ELASTICSEARCH_MESSAGE_LENGTH_OFFSET) + ELASTICSEARCH_HEADER_LENGTH;
|
||||
|
|
|
@ -2159,7 +2159,7 @@ classify_packet(packet_info *pinfo)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_enip_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_enip_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
|
|
|
@ -523,7 +523,9 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
|
|||
}
|
||||
|
||||
/*--- get_erldp_pdu_len -------------------------------------------------*/
|
||||
static guint get_erldp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) {
|
||||
static guint get_erldp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
if (is_handshake(tvb, offset))
|
||||
return(2 + tvb_get_ntohs(tvb, offset));
|
||||
|
||||
|
|
|
@ -760,7 +760,8 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
* determine PDU length of protocol etch
|
||||
*/
|
||||
static guint
|
||||
get_etch_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_etch_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
/* length is at offset 4. we add magic bytes length + length size */
|
||||
return tvb_get_ntohl(tvb, offset + 4) + 8;
|
||||
|
|
|
@ -319,7 +319,7 @@ dissect_fcgi_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
}
|
||||
|
||||
static guint
|
||||
get_fcgi_record_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_fcgi_record_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return 8 + tvb_get_ntohs(tvb, offset + 4) + tvb_get_guint8(tvb, offset + 6);
|
||||
}
|
||||
|
|
|
@ -11058,7 +11058,7 @@ dissect_ff(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
|||
|
||||
|
||||
static guint
|
||||
get_ff_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ff_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return (tvb_get_ntohl(tvb, offset + 8));
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
|
|||
}
|
||||
|
||||
static guint
|
||||
get_fix_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_fix_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
int fix_len;
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ dissect_fmtp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_fmtp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_fmtp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return (guint)tvb_get_ntohs(tvb, offset+2);
|
||||
}
|
||||
|
|
|
@ -1975,7 +1975,8 @@ dissect_gadu_gadu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_gadu_gadu_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_gadu_gadu_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 len = tvb_get_letohl(tvb, offset + 4);
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ static const value_string gearman_command_names[] = {
|
|||
};
|
||||
|
||||
static guint
|
||||
get_gearman_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_gearman_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohl(tvb, offset+8)+GEARMAN_COMMAND_HEADER_SIZE;
|
||||
}
|
||||
|
|
|
@ -980,8 +980,10 @@ service_control_dissect(tvbuff_t* tvb,proto_tree* msg_tree, proto_tree* ged125_t
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ged125_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset _U_)
|
||||
get_ged125_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset _U_, void *data _U_)
|
||||
{
|
||||
/* XXX: why does this not use the offset to get the value? */
|
||||
return tvb_get_ntohl(tvb, 0) + 8;
|
||||
}
|
||||
|
||||
|
|
|
@ -4815,7 +4815,7 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
|
|||
}
|
||||
|
||||
static guint
|
||||
get_giop_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_giop_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
|
||||
MessageHeader header;
|
||||
|
|
|
@ -60,7 +60,7 @@ static gboolean get_packet_length(tvbuff_t *tvb, int offset,
|
|||
}
|
||||
|
||||
static guint
|
||||
get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
|
|
|
@ -315,7 +315,9 @@ static void dissect_gnutella_push(tvbuff_t *tvb, guint offset, proto_tree *tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_gnutella_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) {
|
||||
get_gnutella_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 size;
|
||||
|
||||
size = tvb_get_letohl(
|
||||
|
|
|
@ -925,7 +925,8 @@ dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
}
|
||||
|
||||
static guint
|
||||
get_dissect_hartip_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_dissect_hartip_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohs(tvb, offset+6);
|
||||
}
|
||||
|
|
|
@ -236,7 +236,9 @@ static value_string_ext responseTypes_ext = VALUE_STRING_EXT_INIT(responseTypes)
|
|||
|
||||
|
||||
/* Get the length of a single HAZELCAST message */
|
||||
static guint get_hazelcast_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) {
|
||||
static guint get_hazelcast_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
|
||||
guint messageLength;
|
||||
guint headerKeyLength;
|
||||
|
|
|
@ -654,7 +654,8 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
/* determine PDU length of protocol */
|
||||
static guint get_hdfs_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
|
||||
static guint get_hdfs_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset _U_, void *data _U_)
|
||||
{
|
||||
int len = tvb_reported_length(tvb);
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ dissect_write_response(tvbuff_t *tvb, proto_tree *hdfsdata_tree, int offset)
|
|||
|
||||
/* determine PDU length of protocol */
|
||||
static guint
|
||||
get_hdfsdata_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_hdfsdata_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* get data packet len, add FIRST_READ_FRAGMENT_LEN for first fragment (before len),
|
||||
SECOND_READ_FRAGMENT_LEN for second fragment (incl len), subtract 4 for length itself. */
|
||||
|
|
|
@ -993,7 +993,7 @@ dissect_hiqnet_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
|
|||
|
||||
|
||||
static guint
|
||||
get_hiqnet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_hiqnet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* length is at offset + 2 */
|
||||
return tvb_get_ntohl(tvb, offset + 2);
|
||||
|
@ -1021,7 +1021,7 @@ dissect_hiqnet_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
|
|||
|
||||
/* loop on (possibly multiple) hiqnet PDUs in UDP payload */
|
||||
while (tvb_reported_length_remaining(tvb, offset) > 0) {
|
||||
plen = get_hiqnet_pdu_len(pinfo, tvb, offset);
|
||||
plen = get_hiqnet_pdu_len(pinfo, tvb, offset, NULL);
|
||||
captured_length = tvb_captured_length_remaining(tvb, offset);
|
||||
|
||||
if (captured_length > plen)
|
||||
|
|
|
@ -852,7 +852,8 @@ dissect_hislip_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
|||
}
|
||||
|
||||
static guint
|
||||
get_hislip_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset)
|
||||
get_hislip_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
|
||||
guint64 length;
|
||||
|
|
|
@ -275,7 +275,7 @@ dissect_hpfeeds_subscribe_pdu(tvbuff_t *tvb, proto_tree *tree, guint offset)
|
|||
* by the routine to re-assemble the protocol spread on multiple TCP packets
|
||||
*/
|
||||
static guint
|
||||
get_hpfeeds_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_hpfeeds_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohl(tvb, offset + 0);
|
||||
}
|
||||
|
|
|
@ -1361,7 +1361,8 @@ dissect_http2_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
static guint get_http2_message_len( packet_info *pinfo _U_, tvbuff_t *tvb, int offset )
|
||||
static guint get_http2_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
if ( tvb_memeql( tvb, offset, kMagicHello, MAGIC_FRAME_LENGTH ) == 0 ) {
|
||||
return MAGIC_FRAME_LENGTH;
|
||||
|
|
|
@ -913,7 +913,8 @@ static void dissect_icep_reply(tvbuff_t *tvb, guint32 offset,
|
|||
DBG1("consumed --> %d\n", reported_reply_data);
|
||||
}
|
||||
|
||||
static guint get_icep_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_icep_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_letohl(tvb, offset + 10);
|
||||
}
|
||||
|
|
|
@ -715,7 +715,7 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
|
|||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 len;
|
||||
|
||||
|
|
|
@ -1036,7 +1036,8 @@ static void get_QOI(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_tre
|
|||
|
||||
/* Find the APDU 104 (APDU=APCI+ASDU) length.
|
||||
Includes possible tvb_length-1 bytes that don't form an APDU */
|
||||
static guint get_iec104apdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_iec104apdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint8 Val;
|
||||
guint32 Off;
|
||||
|
|
|
@ -484,7 +484,7 @@ dissect_ifcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ifcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ifcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint pdu_len;
|
||||
|
||||
|
|
|
@ -4093,7 +4093,7 @@ static int dissect_ILP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_
|
|||
|
||||
|
||||
static guint
|
||||
get_ilp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ilp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* PDU length = Message length */
|
||||
return tvb_get_ntohs(tvb,offset);
|
||||
|
|
|
@ -707,7 +707,7 @@ static dissector_handle_t q931_handle;
|
|||
|
||||
|
||||
static guint
|
||||
get_ipdc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ipdc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* lower 10 bits only */
|
||||
guint raw_len = (tvb_get_ntohs(tvb,offset+2) & 0x03FF);
|
||||
|
@ -737,7 +737,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
|
||||
gshort nr = tvb_get_guint8(tvb,0);
|
||||
gshort ns = tvb_get_guint8(tvb,1);
|
||||
guint payload_len = get_ipdc_pdu_len(pinfo,tvb,0);
|
||||
guint payload_len = get_ipdc_pdu_len(pinfo,tvb,0,NULL);
|
||||
|
||||
gshort trans_id_size;
|
||||
guint32 trans_id;
|
||||
|
|
|
@ -682,7 +682,7 @@ dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
|
|||
}
|
||||
|
||||
static guint
|
||||
get_isns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_isns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 isns_len;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ dissect_kafka_message_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
|
|||
/* HELPERS */
|
||||
|
||||
static guint
|
||||
get_kafka_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_kafka_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return 4 + tvb_get_ntohl(tvb, offset);
|
||||
}
|
||||
|
|
|
@ -249,7 +249,8 @@ static expert_field ei_kdsp_cmdnum = EI_INIT;
|
|||
|
||||
/* determine PDU length of protocol */
|
||||
static guint
|
||||
get_kdsp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_kdsp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohl(tvb, offset+8) + FRAME_HEADER_LEN; /* length is at offset 8 */
|
||||
}
|
||||
|
|
|
@ -4434,7 +4434,7 @@ kerberos_rm_to_reclen(guint krb_rm)
|
|||
}
|
||||
|
||||
guint
|
||||
get_krb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_krb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint krb_rm;
|
||||
gint pdulen;
|
||||
|
|
|
@ -68,7 +68,7 @@ int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *
|
|||
int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
|
||||
guint32 kerberos_output_keytype(void);
|
||||
|
||||
guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset);
|
||||
guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset, void *data);
|
||||
|
||||
gint kerberos_rm_to_reclen(guint krb_rm);
|
||||
|
||||
|
|
|
@ -544,7 +544,7 @@ dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int current_pr
|
|||
*
|
||||
*/
|
||||
static guint
|
||||
get_knet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_knet_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return count_vle_bytes(tvb, offset) + dissect_content_length_vle(tvb, &offset, NULL);
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
}
|
||||
|
||||
static guint
|
||||
get_laplink_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_laplink_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint plen;
|
||||
/*
|
||||
|
|
|
@ -243,7 +243,8 @@ static int ett_lbmpdm_tcp = -1;
|
|||
static int hf_lbmpdm_tcp_tag = -1;
|
||||
static int hf_lbmpdm_tcp_channel = -1;
|
||||
|
||||
static guint get_lbmpdm_tcp_pdu_length(packet_info * pinfo _U_, tvbuff_t * tvb, int offset)
|
||||
static guint get_lbmpdm_tcp_pdu_length(packet_info * pinfo _U_, tvbuff_t * tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
int encoding;
|
||||
int packet_len = 0;
|
||||
|
|
|
@ -469,7 +469,8 @@ static gboolean lbttcp_packet_is_transport_client(packet_info * pinfo, const lbt
|
|||
return (is_transport_client_packet);
|
||||
}
|
||||
|
||||
static guint get_lbttcp_pdu_length(packet_info * pinfo _U_, tvbuff_t * tvb, int offset)
|
||||
static guint get_lbttcp_pdu_length(packet_info * pinfo _U_, tvbuff_t * tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return lbmc_get_message_length(tvb, offset);
|
||||
}
|
||||
|
|
|
@ -4557,7 +4557,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
|
|||
|
||||
|
||||
static guint
|
||||
get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void* data _U_)
|
||||
{
|
||||
/* sasl encapsulated ldap is 4 bytes plus the length in size */
|
||||
return tvb_get_ntohl(tvb, offset)+4;
|
||||
|
@ -4571,7 +4571,7 @@ dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 len;
|
||||
gboolean ind;
|
||||
|
|
|
@ -1205,7 +1205,7 @@ dissect_lg8979(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
|
|||
/* Return length of L&G 8979 Protocol over TCP message (used for re-assembly) */
|
||||
/******************************************************************************************************/
|
||||
static guint
|
||||
get_lg8979_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
|
||||
get_lg8979_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_, void *data _U_)
|
||||
{
|
||||
|
||||
guint len;
|
||||
|
|
|
@ -275,7 +275,8 @@ dissect_lisp_tcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
|
|||
*/
|
||||
|
||||
static guint
|
||||
get_lisp_tcp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_lisp_tcp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint16 mlen;
|
||||
|
||||
|
|
|
@ -2702,7 +2702,7 @@ dissect_llrp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
|||
|
||||
/* Determine length of LLRP message */
|
||||
static guint
|
||||
get_llrp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_llrp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/* Peek into the header to determine the total message length */
|
||||
return (guint)tvb_get_ntohl(tvb, offset+2);
|
||||
|
|
|
@ -281,7 +281,7 @@ dissect_lsc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
|||
|
||||
/* Determine length of LSC message */
|
||||
static guint
|
||||
get_lsc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_lsc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint8 op_code;
|
||||
guint pdu_len;
|
||||
|
|
|
@ -621,7 +621,8 @@ static guint8 mausb_ep_handle_bus_num(guint16 handle) {
|
|||
}
|
||||
|
||||
/* returns the length field of the MAUSB packet */
|
||||
static guint mausb_get_pkt_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint mausb_get_pkt_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_letohs(tvb, offset + 2);
|
||||
}
|
||||
|
@ -1176,7 +1177,7 @@ dissect_mausb_pkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
/* create display subtree for the protocol */
|
||||
ti = proto_tree_add_item(tree, proto_mausb, tvb, 0,
|
||||
mausb_get_pkt_len(pinfo, tvb, offset), ENC_NA);
|
||||
mausb_get_pkt_len(pinfo, tvb, offset, NULL), ENC_NA);
|
||||
|
||||
mausb_tree = proto_item_add_subtree(ti, ett_mausb);
|
||||
|
||||
|
|
|
@ -651,7 +651,7 @@ dissect_mbrtu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
|
||||
/* Return length of Modbus/TCP message */
|
||||
static guint
|
||||
get_mbtcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_mbtcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint16 plen;
|
||||
|
||||
|
@ -669,7 +669,8 @@ get_mbtcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
|||
|
||||
/* Return length of Modbus RTU over TCP message */
|
||||
static guint
|
||||
get_mbrtu_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
|
||||
get_mbrtu_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset _U_, void *data _U_)
|
||||
{
|
||||
|
||||
/* Modbus/TCP frames include a "length" word in each message; Modbus RTU over TCP does not, so don't attempt to get one */
|
||||
|
|
|
@ -240,7 +240,8 @@ is_memcache_request_or_reply(const gchar *data, int linelen, guint8 *opcode,
|
|||
ReqRespDissector *reqresp_dissector);
|
||||
|
||||
static guint
|
||||
get_memcache_pdu_len (packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_memcache_pdu_len (packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint32 body_len;
|
||||
|
||||
|
|
|
@ -647,7 +647,7 @@ dissect_mongo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
return tvb_length(tvb);
|
||||
}
|
||||
static guint
|
||||
get_mongo_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_mongo_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 plen;
|
||||
|
||||
|
|
|
@ -4021,7 +4021,8 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
|
|||
return tvb_reported_length(tvb);
|
||||
}
|
||||
|
||||
static guint get_mq_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_mq_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
if (tvb_reported_length_remaining(tvb, offset) >= 8)
|
||||
{
|
||||
|
|
|
@ -167,7 +167,8 @@ static gboolean reassemble_mqtt_over_tcp = TRUE;
|
|||
|
||||
#define GET_MQTT_PDU_LEN(msg_len, len_offset) (msg_len + len_offset + MQTT_HDR_SIZE_BEFORE_LEN)
|
||||
|
||||
static guint get_mqtt_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
static guint get_mqtt_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
guint64 msg_len;
|
||||
guint len_offset;
|
||||
|
|
|
@ -956,7 +956,7 @@ dissect_mrcpv2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* get the length of the MRCP message */
|
||||
static guint
|
||||
get_mrcpv2_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_mrcpv2_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
gint len_start;
|
||||
gint len_end;
|
||||
|
|
|
@ -2107,7 +2107,7 @@ tvb_get_fle(tvbuff_t *tvb, int offset, guint64 *res, guint8 *is_null)
|
|||
|
||||
/* dissector helper: length of PDU */
|
||||
static guint
|
||||
get_mysql_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_mysql_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint plen= tvb_get_letoh24(tvb, offset);
|
||||
return plen + 4; /* add length field + packet number */
|
||||
|
|
|
@ -79,7 +79,7 @@ static const value_string nbd_type_vals[] = {
|
|||
* based on the information in the header.
|
||||
*/
|
||||
static guint
|
||||
get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
|
||||
get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 magic, type, packet;
|
||||
conversation_t *conversation;
|
||||
|
|
|
@ -872,7 +872,7 @@ dissect_ncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ncp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ncp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint32 signature;
|
||||
|
||||
|
|
|
@ -3297,7 +3297,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ndmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ndmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint len;
|
||||
|
||||
|
|
|
@ -4260,7 +4260,7 @@ dissect_ndps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree)
|
|||
}
|
||||
|
||||
static guint
|
||||
get_ndps_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_ndps_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohs(tvb, offset +2) + 4;
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ static gint dissect_netsync_cmd_nonexistent(tvbuff_t *tvb, gint offset, proto_t
|
|||
}
|
||||
|
||||
static guint
|
||||
get_netsync_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_netsync_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
guint64 size = 0;
|
||||
guint size_bytes;
|
||||
|
|
|
@ -70,7 +70,8 @@ static const value_string openflow_version_values[] = {
|
|||
};
|
||||
|
||||
static guint
|
||||
get_openflow_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_openflow_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb,
|
||||
int offset, void *data _U_)
|
||||
{
|
||||
return tvb_get_ntohs(tvb, offset + 2);
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ dissect_openvpn_msg_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openvp
|
|||
}
|
||||
|
||||
static guint
|
||||
get_msg_length(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset)
|
||||
get_msg_length(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset, void *data _U_)
|
||||
{
|
||||
return (guint)tvb_get_ntohs(tvb, offset) + 2; /* length field is at offset 0,
|
||||
+2 to account for the length field itself */
|
||||
|
|
|
@ -1362,7 +1362,7 @@ dissect_openwire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
|
|||
}
|
||||
|
||||
static guint
|
||||
get_openwire_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_openwire_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
if (tvb_length_remaining(tvb, offset) >= 5)
|
||||
{
|
||||
|
|
|
@ -491,7 +491,7 @@ decode_time_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto
|
|||
|
||||
/* To find the correct size of the PDU. Needed by the desegmentation feature*/
|
||||
static guint
|
||||
get_opsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
||||
get_opsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
||||
{
|
||||
/*
|
||||
* Get the length of the OPSI packet.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue