Пример #1
0
static gint dissect_netsync_cmd_error( tvbuff_t *tvb,  gint offset, proto_tree *tree, guint size _U_)
{
	guint64 len = 0;

	offset += dissect_uleb128( tvb, offset, &len );

	proto_tree_add_item(tree, hf_netsync_cmd_error_msg, tvb,
				offset, (gint)len, ENC_ASCII|ENC_NA );
	offset += (gint)len;

	return offset;
}
static gint dissect_netsync_cmd_error( tvbuff_t *tvb,  gint offset, proto_tree *tree, guint size _U_)
{
	guint len = 0;

	offset += dissect_uleb128( tvb, offset, &len );

	proto_tree_add_item(tree, hf_netsync_cmd_error_msg, tvb,
				offset, len, FALSE );
	offset += len;

	return offset;
}
Пример #3
0
static gint ett_mqtt_hdr_flags = -1;
static gint ett_mqtt_con_flags = -1;
static gint ett_mqtt_conack_flags = -1;

/* Reassemble SMPP TCP segments */
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, void *data _U_)
{
  guint64 msg_len;
  guint len_offset;

  len_offset = dissect_uleb128(tvb, (offset + MQTT_HDR_SIZE_BEFORE_LEN), &msg_len);

  /* Explicitly Downcast the value, because the length can never be more than 4 bytes */
  return (guint)(GET_MQTT_PDU_LEN(msg_len, len_offset));
}

/* Dissect the MQTT message */
static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
  guint8  mqtt_fixed_hdr;
  guint8  mqtt_msg_type;

  int offset = 0;

  /* Extract the message ID */
  mqtt_fixed_hdr = tvb_get_guint8(tvb, offset);