Project

General

Profile

0001-GSUP-add-E-interface-messages-wip.patch

WIP patch for wireshark onto current master (355fe663408695e4191fde9404cc97bd41f6834d) - neels, 04/02/2019 03:03 AM

View differences:

epan/dissectors/packet-gsm_gsup.c
99 99

  
100 100
	OSMO_GSUP_IMEI_IE			= 0x50,
101 101
	OSMO_GSUP_IMEI_RESULT_IE		= 0x51,
102

  
103
	OSMO_GSUP_KIND_IE			= 0x0a,
104

  
105
	/* Inter-MSC handover related */
106
	OSMO_GSUP_SOURCE_NAME_IE		= 0x60,
107
	OSMO_GSUP_DESTINATION_NAME_IE		= 0x61,
108
	OSMO_GSUP_AN_APDU_IE			= 0x62,
109
	OSMO_GSUP_CAUSE_RR_IE			= 0x63,
110
	OSMO_GSUP_CAUSE_BSSAP_IE		= 0x64,
111
	OSMO_GSUP_CAUSE_SM_IE			= 0x65,
102 112
};
103 113

  
104 114
/*! GSUP message type */
......
148 158
	OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST	= 0x30,
149 159
	OSMO_GSUP_MSGT_CHECK_IMEI_ERROR		= 0x31,
150 160
	OSMO_GSUP_MSGT_CHECK_IMEI_RESULT	= 0x32,
161

  
162
	OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST		= 0x34,
163
	OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR			= 0x35,
164
	OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT		= 0x36,
165

  
166
	OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST	= 0x38,
167
	OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR	= 0x39,
168
	OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT	= 0x3a,
169

  
170
	OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST		= 0x3c,
171
	OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR			= 0x3d,
172
	OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT			= 0x3e,
173

  
174
	OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST	= 0x40,
175
	OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST	= 0x44,
176

  
177
	OSMO_GSUP_MSGT_E_CLOSE					= 0x47,
178
	OSMO_GSUP_MSGT_E_ABORT					= 0x4b,
179

  
180
	OSMO_GSUP_MSGT_E_ROUTING_ERROR				= 0x4e,
151 181
};
152 182

  
153 183
#define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00)
......
193 223
	OSMO_GSUP_SMS_SM_ALERT_RSN_MEM_AVAIL	= 0x02,
194 224
};
195 225

  
226
enum osmo_gsup_access_network_protocol {
227
	OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006 = 1,
228
	OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413 = 2,
229
};
230

  
231
enum osmo_gsup_kind {
232
	OSMO_GSUP_KIND_UNSET = 0,
233
	OSMO_GSUP_KIND_SUBSCRIBER_MANAGEMENT = 1,
234
	OSMO_GSUP_KIND_SMS = 2,
235
	OSMO_GSUP_KIND_USSD = 3,
236
	OSMO_GSUP_KIND_INTER_MSC = 4,
237
};
238

  
196 239
/***********************************************************************
197 240
 * Wireshark Dissector Implementation
198 241
 ***********************************************************************/
......
231 274
static int hf_gsup_sm_rp_mms = -1;
232 275
static int hf_gsup_sm_alert_rsn = -1;
233 276
static int hf_gsup_imei_result = -1;
277
static int hf_gsup_kind = -1;
234 278

  
235 279
static gint ett_gsup = -1;
236 280
static gint ett_gsup_ie = -1;
......
242 286
static dissector_handle_t gsm_map_handle;
243 287
static dissector_handle_t gsm_sms_handle;
244 288
static dissector_handle_t bssap_imei_handle;
289
static dissector_handle_t bssap_handle;
245 290

  
246 291
static const value_string gsup_iei_types[] = {
247 292
	{ OSMO_GSUP_IMSI_IE,		"IMSI" },
......
279 324
	{ OSMO_GSUP_SM_ALERT_RSN_IE,	"SM Alert Reason" },
280 325
	{ OSMO_GSUP_IMEI_IE,		"IMEI" },
281 326
	{ OSMO_GSUP_IMEI_RESULT_IE,	"IMEI Check Result" },
327
	{ OSMO_GSUP_KIND_IE,		"Subsystem Kind" },
328
	{ OSMO_GSUP_SOURCE_NAME_IE,	"Source Name"},
329
	{ OSMO_GSUP_DESTINATION_NAME_IE,"Destination Name"},
330
	{ OSMO_GSUP_AN_APDU_IE,		"AN-APDU"},
331
	{ OSMO_GSUP_CAUSE_RR_IE,	"RR-Cause"},
332
	{ OSMO_GSUP_CAUSE_BSSAP_IE,	"BSSAP-Cause"},
333
	{ OSMO_GSUP_CAUSE_SM_IE,	"SM-Cause"},
282 334
	{ 0, NULL }
283 335
};
284 336

  
......
317 369
	{ OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST,		"Check IMEI Request"},
318 370
	{ OSMO_GSUP_MSGT_CHECK_IMEI_ERROR,		"Check IMEI Error"},
319 371
	{ OSMO_GSUP_MSGT_CHECK_IMEI_RESULT,		"Check IMEI Result"},
372
	{ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST,	"E Prepare Handover Request"},
373
	{ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR,	"E Prepare Handover Error"},
374
	{ OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT,	"E Prepare Handover Result"},
375
	{ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST,	"E Prepare Subsequent Handover Request"},
376
	{ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR,	"E Prepare Subsequent Handover Error"},
377
	{ OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT,	"E Prepare Subsequent Handover Result"},
378
	{ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST,	"E Send End Signal Request"},
379
	{ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR,	"E Send End Signal Error"},
380
	{ OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT,	"E Send End Signal Result"},
381
	{ OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST,	"E Process Access Signalling Request"},
382
	{ OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST,	"E Forward Access Signalling Request"},
383
	{ OSMO_GSUP_MSGT_E_CLOSE,			"E Close"},
384
	{ OSMO_GSUP_MSGT_E_ABORT,			"E Abort"},
385
	{ OSMO_GSUP_MSGT_E_ROUTING_ERROR,		"E Routing Error"},
320 386
	{ 0, NULL }
321 387
};
322 388

  
......
362 428
	{ 0, NULL }
363 429
};
364 430

  
431
static const value_string gsup_kind_types[] = {
432
	{ OSMO_GSUP_KIND_UNSET, "unset" },
433
	{ OSMO_GSUP_KIND_SUBSCRIBER_MANAGEMENT, "Subscriber-Management" },
434
	{ OSMO_GSUP_KIND_SMS, "SMS" },
435
	{ OSMO_GSUP_KIND_USSD, "USSD" },
436
	{ OSMO_GSUP_KIND_INTER_MSC, "Inter-MSC" },
437
	{ 0, NULL }
438
};
439

  
365 440
static void dissect_ss_info_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint len, proto_tree *tree)
366 441
{
367 442
	guint saved_offset;
......
515 590
		call_dissector(bssap_imei_handle, ss_tvb, pinfo, tree);
516 591
}
517 592

  
593
static void dissect_an_apdu_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset,
594
			       guint ie_len, proto_tree *tree)
595
{
596
	tvbuff_t *ss_tvb = tvb_new_subset_length(tvb, offset+1, ie_len-1);
597
	if (bssap_handle)
598
		call_dissector(bssap_handle, ss_tvb, pinfo, tree);
599
}
600

  
518 601
static gint
519 602
dissect_gsup_tlvs(tvbuff_t *tvb, int base_offs, int length, packet_info *pinfo, proto_tree *tree,
520 603
		  proto_item *gsup_ti, guint8 msg_type)
......
658 741
		case OSMO_GSUP_IMEI_RESULT_IE:
659 742
			proto_tree_add_item(att_tree, hf_gsup_imei_result, tvb, offset, len, ENC_NA);
660 743
			break;
744
		case OSMO_GSUP_KIND_IE:
745
			proto_tree_add_item(att_tree, hf_gsup_kind, tvb, offset, len, ENC_NA);
746
			break;
747
		case OSMO_GSUP_AN_APDU_IE:
748
			dissect_an_apdu_ie(tvb, pinfo, offset, len, att_tree);
749
			break;
750

  
751
		case OSMO_GSUP_SOURCE_NAME_IE:
752
		case OSMO_GSUP_DESTINATION_NAME_IE:
753
		case OSMO_GSUP_CAUSE_RR_IE:
754
		case OSMO_GSUP_CAUSE_BSSAP_IE:
755
		case OSMO_GSUP_CAUSE_SM_IE:
756

  
661 757
		case OSMO_GSUP_HLR_NUMBER_IE:
662 758
		case OSMO_GSUP_PDP_TYPE_IE:
663 759
		case OSMO_GSUP_PDP_QOS_IE:
......
769 865
		  FT_UINT8, BASE_DEC, VALS(osmo_gsup_sms_sm_alert_rsn_types), 0, NULL, HFILL } },
770 866
		{ &hf_gsup_imei_result, { "IMEI Check Result", "gsup.imei_check_res",
771 867
		  FT_UINT8, BASE_DEC, VALS(gsup_imei_result_types), 0, NULL, HFILL } },
868
		{ &hf_gsup_kind, { "Kind", "gsup.kind",
869
		  FT_UINT8, BASE_DEC, VALS(gsup_kind_types), 0, NULL, HFILL } },
772 870
	};
773 871
	static gint *ett[] = {
774 872
		&ett_gsup,
......
806 904
	gsm_map_handle = find_dissector_add_dependency("gsm_map", proto_gsup);
807 905
	gsm_sms_handle = find_dissector_add_dependency("gsm_sms", proto_gsup);
808 906
	bssap_imei_handle = find_dissector_add_dependency("bssap.imei", proto_gsup);
907
	bssap_handle = find_dissector_add_dependency("bssap", proto_gsup);
809 908
}
810 909

  
811 910
/*
812
- 
Add picture from clipboard (Maximum size: 48.8 MB)