Project

General

Profile

Bug #6377 » 0001-GSM-IPA-properly-handle-PDUs-spanning-multiple-TCP-s.patch

pespin, 02/27/2024 07:09 PM

View differences:

epan/dissectors/packet-gsm_ipa.c
12 12

  
13 13
#include "config.h"
14 14

  
15
#include "packet-tcp.h"
16

  
15 17
#include <epan/packet.h>
16 18
#include <epan/prefs.h>
17 19

  
......
65 67
static dissector_handle_t ipa_udp_handle;
66 68
static gboolean global_ipa_in_root = FALSE;
67 69
static gboolean global_ipa_in_info = FALSE;
70
static gboolean global_tcp_desegment = FALSE;
68 71

  
69 72
/* Initialize the protocol and registered fields */
70 73
static int proto_ipa;
......
371 374
}
372 375

  
373 376
static int
374
dissect_ipa_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
377
_dissect_ipa_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
375 378
{
376 379
	if (!dissect_ipa(tvb, pinfo, tree, FALSE))
377 380
		return 0;
378 381
	return tvb_captured_length(tvb);
379 382
}
380 383

  
384
static guint
385
get_dissect_ipa_tcp_len(packet_info *pinfo _U_, tvbuff_t *tvb,
386
			int offset, void *data _U_)
387
{
388
	return tvb_get_ntohs(tvb, offset) + 3;
389
}
390

  
391
static int
392
dissect_ipa_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
393
{
394
	tcp_dissect_pdus(tvb, pinfo, tree, global_tcp_desegment, 3,
395
			 get_dissect_ipa_tcp_len, _dissect_ipa_tcp, data);
396
	return tvb_reported_length(tvb);
397
}
398

  
381 399
static int
382 400
dissect_ipa_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
383 401
{
......
468 486
	prefs_register_bool_preference(ipa_module, "hsl_debug_in_info",
469 487
					"HSL Debug messages in INFO column",
470 488
					NULL, &global_ipa_in_info);
489
	prefs_register_bool_preference(ipa_module, "desegment",
490
				       "Desegment IPA messages spanning multiple TCP segments",
491
				       NULL, &global_tcp_desegment);
471 492

  
472 493
	ipa_tcp_handle = register_dissector("gsm_ipa.tcp", dissect_ipa_tcp, proto_ipa);
473 494
	ipa_udp_handle = register_dissector("gsm_ipa.udp", dissect_ipa_udp, proto_ipa);
(2-2/2)
Add picture from clipboard (Maximum size: 48.8 MB)