aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dccp.c
blob: 79019cf08373d1f7210e04d643af293471dafcff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
/* packet-dccp.c
 * Routines for Distributed Checksum Clearinghouse packet dissection
 * DCC Home: http://www.rhyolite.com/anti-spam/dcc/
 *
 * Copyright 1999, Nathan Neulinger <nneul@umr.edu>
 *
 * $Id: packet-dccp.c,v 1.11 2004/03/11 03:24:13 gerald Exp $
 *
 * Ethereal - Network traffic analyzer
 * By Gerald Combs <gerald@ethereal.com>
 * Copyright 1998 Gerald Combs
 *
 * Copied from packet-tftp.c
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>

#include <string.h>
#include <glib.h>
#include <epan/packet.h>

#include <packet-dccp.h>

static int proto_dccp = -1;
static int hf_dccp_len = -1;
static int hf_dccp_pkt_vers = -1;
static int hf_dccp_op = -1;
static int hf_dccp_clientid = -1;
static int hf_dccp_opnums_host = -1;
static int hf_dccp_opnums_pid = -1;
static int hf_dccp_opnums_report = -1;
static int hf_dccp_opnums_retrans = -1;

static int hf_dccp_signature = -1;
static int hf_dccp_max_pkt_vers = -1;
static int hf_dccp_qdelay_ms = -1;
static int hf_dccp_brand = -1;

static int hf_dccp_ck_type = -1;
static int hf_dccp_ck_len = -1;
static int hf_dccp_ck_sum = -1;

static int hf_dccp_date = -1;

static int hf_dccp_target = -1;

static int hf_dccp_adminop = -1;
static int hf_dccp_adminval = -1;
static int hf_dccp_floodop = -1;
static int hf_dccp_trace = -1;
static int hf_dccp_trace_admin = -1;
static int hf_dccp_trace_anon = -1;
static int hf_dccp_trace_client = -1;
static int hf_dccp_trace_rlim = -1;
static int hf_dccp_trace_query = -1;
static int hf_dccp_trace_ridc = -1;
static int hf_dccp_trace_flood = -1;

static gint ett_dccp = -1;
static gint ett_dccp_opnums = -1;
static gint ett_dccp_op = -1;
static gint ett_dccp_ck = -1;
static gint ett_dccp_trace = -1;

/* Utility macros */
#define D_SIGNATURE() \
	proto_tree_add_item(dccp_optree, hf_dccp_signature, tvb, \
		offset, sizeof(DCC_SIGNATURE), FALSE); \
	offset += sizeof(DCC_SIGNATURE);

#define D_LABEL(label,len) \
	proto_tree_add_text(dccp_optree, tvb, offset, len, label); \
	offset += len;

#define D_TEXT(label, endpad) { \
	int next_offset,linelen,left; \
	const char *line; \
	while (tvb_offset_exists(tvb, offset+endpad)) { \
		left = tvb_length_remaining(tvb,offset) - endpad; \
		linelen = tvb_find_line_end(tvb, offset, left, &next_offset, \
		    FALSE); \
		line = tvb_get_ptr(tvb, offset, linelen); \
		proto_tree_add_text(dccp_optree, tvb, offset, \
			next_offset - offset, "%s: %s", \
			label, tvb_format_text(tvb, offset, next_offset - offset)); \
		offset = next_offset; \
	} \
}


#define D_TARGET() \
	proto_tree_add_item_hidden(dccp_tree, hf_dccp_target, tvb, \
		offset, sizeof(DCC_TGTS), FALSE); \
	proto_tree_add_text(dccp_optree, tvb, offset, sizeof(DCC_TGTS), \
		val_to_str(tvb_get_ntohl(tvb,offset), dccp_target_vals, "Targets (%u)")); \
	offset += sizeof(DCC_TGTS); \

#define D_DATE() { \
	nstime_t ts; \
	ts.nsecs = 0; \
	ts.secs = tvb_get_ntohl(tvb,offset); \
	proto_tree_add_time(dccp_optree, hf_dccp_date, tvb, offset, 4, &ts); \
	offset += 4; \
}


#define D_CHECKSUM() { \
	proto_tree *cktree, *ti; \
	ti = proto_tree_add_text(dccp_optree, tvb, offset, sizeof(DCC_CK), \
		"Checksum - %s", val_to_str(tvb_get_guint8(tvb,offset), \
		dccp_cktype_vals, \
		"Unknown Type: %u")); \
	cktree = proto_item_add_subtree(ti, ett_dccp_ck); \
	proto_tree_add_item(cktree, hf_dccp_ck_type, tvb, offset, 1, FALSE); \
	offset += 1; \
	proto_tree_add_item(cktree, hf_dccp_ck_len, tvb, offset, 1, FALSE); \
	offset += 1; \
	proto_tree_add_item(cktree, hf_dccp_ck_sum, tvb, offset, \
		sizeof(DCC_SUM), FALSE); \
	offset += sizeof(DCC_SUM); \
}


/* Lookup string tables */
static const value_string dccp_op_vals[] = {
	{DCC_OP_INVALID, "Invalid Op"},
	{DCC_OP_NOP, 	"No-Op"},
	{DCC_OP_REPORT, "Report and Query"},
	{DCC_OP_QUERY, "Query"},
	{DCC_OP_QUERY_RESP, "Server Response"},
	{DCC_OP_ADMN, "Admin"},
	{DCC_OP_OK, "Ok"},
	{DCC_OP_ERROR, "Server Failing"},
	{DCC_OP_DELETE, "Delete Checksum(s)"},
	{0, NULL}
};

static const value_string dccp_cktype_vals[] = {
	{DCC_CK_INVALID, "Invalid/Deleted from DB when seen"},
	{DCC_CK_IP, 	"MD5 of binary source IPv6 address"},
	{DCC_CK_ENV_FROM, "MD5 of envelope Mail From value"},
	{DCC_CK_FROM, "MD5 of header From: line"},
	{DCC_CK_SUB, "MD5 of substitute header line"},
	{DCC_CK_MESSAGE_ID, "MD5 of header Message-ID: line"},
	{DCC_CK_RECEIVED, "MD5 of last header Received: line"},
	{DCC_CK_BODY, "MD5 of body"},
	{DCC_CK_FUZ1, "MD5 of filtered body - FUZ1"},
	{DCC_CK_FUZ2, "MD5 of filtered body - FUZ2"},
	{DCC_CK_FUZ3, "MD5 of filtered body - FUZ3"},
	{DCC_CK_FUZ4, "MD5 of filtered body - FUZ4"},
	{DCC_CK_SRVR_ID, "hostname for server-ID check "},
	{DCC_CK_ENV_TO, "MD5 of envelope Rcpt To value"},
	{0, NULL},
};

static const value_string dccp_adminop_vals[] = {
	{DCC_AOP_OK, "Never sent"},
	{DCC_AOP_STOP, "Stop Gracefully"},
	{DCC_AOP_NEW_IDS, "Load keys and client IDs"},
	{DCC_AOP_FLOD, "Flood control"},
	{DCC_AOP_DB_UNLOCK, "Start Switch to new database"},
	{DCC_AOP_DB_NEW, "Finish Switch to new database"},
	{DCC_AOP_STATS, "Return counters"},
	{DCC_AOP_STATS_CLEAR, "Return and zero counters"},
	{DCC_AOP_TRACE_ON, "Enable tracing"},
	{DCC_AOP_TRACE_OFF, "Disable tracing"},
	{DCC_AOP_CUR_CLIENTS, "List clients"},
	{0, NULL},
};

static const value_string dccp_target_vals[] = {
	{DCC_TGTS_TOO_MANY, "Targets (>= 16777200)"},
	{DCC_TGTS_OK, "Certified not spam"},
	{DCC_TGTS_OK2, "Half certified not spam"},
	{DCC_TGTS_DEL, "Deleted checksum"},
	{DCC_TGTS_INVALID, "Invalid"},
	{0, NULL},
};

static const value_string dccp_floodop_vals[] = {
	{DCC_AOP_FLOD_CHECK, "Check"},
	{DCC_AOP_FLOD_SHUTDOWN, "Shutdown"},
	{DCC_AOP_FLOD_HALT, "Halt"},
	{DCC_AOP_FLOD_RESUME, "Resume"},
	{DCC_AOP_FLOD_REWIND, "Rewind"},
	{DCC_AOP_FLOD_LIST, "List"},
	{DCC_AOP_FLOD_STATS, "Stats"},
	{DCC_AOP_FLOD_STATS_CLEAR, "Clear Stats"},
	{0,NULL},
};

static gboolean
dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
	proto_tree      *dccp_tree, *dccp_optree, *dccp_opnumtree, *ti;
	proto_tree *dccp_tracetree;
	int offset = 0;
	int client_is_le = 0;
	int op = 0;
	int i, is_response;

	if (pinfo->srcport != DCC_PORT && pinfo->destport != DCC_PORT) {
		/* Not the right port - not a DCC packet. */
		return FALSE;
	}

	/* get at least a full packet structure */
	if ( !tvb_bytes_exist(tvb, 0, sizeof(DCC_HDR)) ) {
		/* Doesn't have enough bytes to contain packet header. */
		return FALSE;
	}

	if (check_col(pinfo->cinfo, COL_PROTOCOL))
		col_set_str(pinfo->cinfo, COL_PROTOCOL, "DCCP");

	offset = 0;
	is_response = pinfo->srcport == DCC_PORT;

	if (check_col(pinfo->cinfo, COL_INFO)) {
		col_add_fstr(pinfo->cinfo, COL_INFO,
			"%s: %s",
			is_response ? "Response" : "Request",
			val_to_str(tvb_get_guint8(tvb, offset+3),
				 dccp_op_vals, "Unknown Op: %u")
		);
	}

	if (tree) {
		ti = proto_tree_add_item(tree, proto_dccp, tvb, offset, -1,
			FALSE);
		dccp_tree = proto_item_add_subtree(ti, ett_dccp);

		proto_tree_add_item(dccp_tree, hf_dccp_len, tvb,
			offset, 2, FALSE);

		if ( !tvb_bytes_exist(tvb, 0, tvb_get_ntohs(tvb, offset))) {
			/* Doesn't have number of bytes that header claims. */
			proto_tree_add_text(dccp_tree, tvb, offset, 2, "Error - packet is shorter than header claims!");
		}
		offset += 2;

		proto_tree_add_item(dccp_tree, hf_dccp_pkt_vers, tvb,
			offset, 1, FALSE);
		offset += 1;

		op = tvb_get_guint8(tvb, offset);
		proto_tree_add_item(dccp_tree, hf_dccp_op, tvb,
			offset, 1, FALSE);
		offset += 1;

		proto_tree_add_item(dccp_tree, hf_dccp_clientid, tvb,
			offset, 4, FALSE);
		offset += 4;

		ti = proto_tree_add_text(dccp_tree, tvb, offset, -1, "Operation Numbers (Opaque to Server)");
		dccp_opnumtree = proto_item_add_subtree(ti, ett_dccp_opnums);

		/* Note - these are indeterminate - they are sortof considered opaque to the client */
		/* Make some attempt to figure out if this data is little endian, not guaranteed to be
		correct if connection went through a firewall or similar. */

		/* Very hokey check - if all three of pid/report/retrans look like little-endian
			numbers, host is probably little endian. Probably innacurate on super-heavily-used
			DCC clients though. This should be good enough for now. */
		client_is_le = ( (tvb_get_guint8(tvb, offset+4) | tvb_get_guint8(tvb, offset+4)) &&
						 (tvb_get_guint8(tvb, offset+8) | tvb_get_guint8(tvb, offset+9)) &&
						 (tvb_get_guint8(tvb, offset+12) | tvb_get_guint8(tvb, offset+13)) );

		proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_host, tvb,
			offset, 4, client_is_le);
		offset += 4;

		proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_pid, tvb,
			offset, 4, client_is_le);
		offset += 4;

		proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_report, tvb,
			offset, 4, client_is_le);
		offset += 4;

		proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_retrans, tvb,
			offset, 4, client_is_le);
		offset += 4;

		ti = proto_tree_add_text(dccp_tree, tvb, offset, -1, "Operation: %s",
			val_to_str(op, dccp_op_vals, "Unknown Op: %u"));
		dccp_optree = proto_item_add_subtree(ti, ett_dccp_op);

		switch(op) {
			case DCC_OP_NOP:
				D_SIGNATURE();
				break;

			case DCC_OP_REPORT:
				D_TARGET();
				for (i=0; i<=DCC_QUERY_MAX &&
					tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++)
				{
					D_CHECKSUM();
				}
				D_SIGNATURE();
				break;

			case DCC_OP_QUERY_RESP:
				for (i=0; i<=DCC_QUERY_MAX &&
					tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++)
				{
					D_TARGET();
				}
				D_SIGNATURE();
				break;

			case DCC_OP_ADMN:
				if ( is_response )
				{
					int left = tvb_length_remaining(tvb, offset) -
						sizeof(DCC_SIGNATURE);
					if ( left == sizeof(DCC_ADMN_RESP_CLIENTS) )
					{
						D_LABEL("Addr", 16);
						D_LABEL("Id", sizeof(DCC_CLNT_ID));
						D_LABEL("Last Used", 4);
						D_LABEL("Requests", 4);
					}
					else
					{
						D_TEXT("Response Text", sizeof(DCC_SIGNATURE));
					}
					D_SIGNATURE();
				}
				else
				{
					int aop;

					D_DATE();

					aop = tvb_get_guint8(tvb, offset+4);
					proto_tree_add_item(dccp_optree, hf_dccp_adminop, tvb, offset+4,
						1, FALSE);
					if (check_col(pinfo->cinfo, COL_INFO)) {
						col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
							val_to_str(tvb_get_guint8(tvb,offset+4),
							dccp_adminop_vals, "Unknown (%u)"));
					}

					if (aop == DCC_AOP_TRACE_ON || aop == DCC_AOP_TRACE_OFF )
					{
						ti = proto_tree_add_item(dccp_optree, hf_dccp_trace, tvb, offset,
							4, FALSE);
						dccp_tracetree = proto_item_add_subtree(ti, ett_dccp_trace);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_admin, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_anon, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_client, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_rlim, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_query, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_ridc, tvb, offset, 4, FALSE);
						proto_tree_add_item(dccp_tracetree, hf_dccp_trace_flood, tvb, offset, 4, FALSE);
					}
					else if ( aop == DCC_AOP_FLOD )
					{
						proto_tree_add_item(dccp_optree, hf_dccp_floodop,
							tvb, offset, 4, FALSE);
						if (check_col(pinfo->cinfo, COL_INFO)) {
							col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
								val_to_str(tvb_get_ntohl(tvb,offset),
								dccp_floodop_vals, "Unknown (%u)"));
						}
					}
					else
					{
						proto_tree_add_item(dccp_optree, hf_dccp_adminval,
							tvb, offset, 4, FALSE);
					}
					offset += 4;

					offset += 1; /* admin op we did in reverse order */
					D_LABEL("Pad", 3);
					D_SIGNATURE();
				}
				break;

			case DCC_OP_OK:
				proto_tree_add_item(dccp_optree, hf_dccp_max_pkt_vers, tvb,
					offset, 1, FALSE);
				offset += 1;

				D_LABEL("Unused", 1);

				proto_tree_add_item(dccp_optree, hf_dccp_qdelay_ms, tvb,
					offset, 2, FALSE);
				offset += 2;

				proto_tree_add_item(dccp_optree, hf_dccp_brand, tvb,
					offset, sizeof(DCC_BRAND), FALSE);
				offset += sizeof(DCC_BRAND);

				D_SIGNATURE();
				break;

			default:
				/* do nothing */
				break;
		}
	}

	return TRUE;
}

void
proto_register_dccp(void)
{
	static hf_register_info hf[] = {
			{ &hf_dccp_len, {
				"Packet Length", "dccp.len", FT_UINT16, BASE_DEC,
				NULL, 0, "Packet Length", HFILL }},

			{ &hf_dccp_pkt_vers, {
				"Packet Version", "dccp.pkt_vers", FT_UINT16, BASE_DEC,
				NULL, 0, "Packet Version", HFILL }},

			{ &hf_dccp_op, {
				"Operation Type", "dccp.op", FT_UINT8, BASE_DEC,
				VALS(dccp_op_vals), 0, "Operation Type", HFILL }},

			{ &hf_dccp_clientid, {
				"Client ID", "dccp.clientid", FT_UINT32, BASE_DEC,
				NULL, 0, "Client ID", HFILL }},

			{ &hf_dccp_opnums_host, {
				"Host", "dccp.opnums.host", FT_IPv4, BASE_DEC,
				NULL, 0, "Host", HFILL }},

			{ &hf_dccp_opnums_pid, {
				"Process ID", "dccp.opnums.pid", FT_UINT32, BASE_DEC,
				NULL, 0, "Process ID", HFILL }},

			{ &hf_dccp_opnums_report, {
				"Report", "dccp.opnums.report", FT_UINT32, BASE_DEC,
				NULL, 0, "Report", HFILL }},

			{ &hf_dccp_opnums_retrans, {
				"Retransmission", "dccp.opnums.retrans", FT_UINT32, BASE_DEC,
				NULL, 0, "Retransmission", HFILL }},

			{ &hf_dccp_signature, {
				"Signature", "dccp.signature", FT_BYTES, BASE_HEX,
				NULL, 0, "Signature", HFILL }},

			{ &hf_dccp_max_pkt_vers, {
				"Maximum Packet Version", "dccp.max_pkt_vers", FT_UINT8, BASE_DEC,
				NULL, 0, "Maximum Packet Version", HFILL }},

			{ &hf_dccp_qdelay_ms, {
				"Client Delay", "dccp.qdelay_ms", FT_UINT16, BASE_DEC,
				NULL, 0, "Client Delay", HFILL }},

			{ &hf_dccp_brand, {
				"Server Brand", "dccp.brand", FT_STRING, BASE_DEC,
				NULL, 0, "Server Brand", HFILL }},

			{ &hf_dccp_ck_type, {
				"Type", "dccp.checksum.type", FT_UINT8, BASE_DEC,
				VALS(dccp_cktype_vals), 0, "Checksum Type", HFILL }},

			{ &hf_dccp_ck_len, {
				"Length", "dccp.checksum.length", FT_UINT8, BASE_DEC,
				NULL, 0, "Checksum Length", HFILL }},

			{ &hf_dccp_ck_sum, {
				"Sum", "dccp.checksum.sum", FT_BYTES, BASE_HEX,
				NULL, 0, "Checksum", HFILL }},

			{ &hf_dccp_target, {
				"Target", "dccp.target", FT_UINT32, BASE_HEX,
				NULL, 0, "Target", HFILL }},

			{ &hf_dccp_date, {
				"Date", "dccp.date", FT_ABSOLUTE_TIME, BASE_DEC,
				NULL, 0, "Date", HFILL }},

			{ &hf_dccp_adminop, {
				"Admin Op", "dccp.adminop", FT_UINT8, BASE_DEC,
				VALS(dccp_adminop_vals), 0, "Admin Op", HFILL }},

			{ &hf_dccp_adminval, {
				"Admin Value", "dccp.adminval", FT_UINT32, BASE_DEC,
				NULL, 0, "Admin Value", HFILL }},

			{ &hf_dccp_trace, {
				"Trace Bits", "dccp.trace", FT_UINT32, BASE_HEX,
				NULL, 0, "Trace Bits", HFILL }},

			{ &hf_dccp_trace_admin, {
				"Admin Requests", "dccp.trace.admin", FT_BOOLEAN, 32,
				NULL, 0x00000001, "Admin Requests", HFILL }},

			{ &hf_dccp_trace_anon, {
				"Anonymous Requests", "dccp.trace.anon", FT_BOOLEAN, 32,
				NULL, 0x00000002, "Anonymous Requests", HFILL }},

			{ &hf_dccp_trace_client, {
				"Authenticated Client Requests", "dccp.trace.client", FT_BOOLEAN, 32,
				NULL, 0x00000004, "Authenticated Client Requests", HFILL }},

			{ &hf_dccp_trace_rlim, {
				"Rate-Limited Requests", "dccp.trace.rlim", FT_BOOLEAN, 32,
				NULL, 0x00000008, "Rate-Limited Requests", HFILL }},

			{ &hf_dccp_trace_query, {
				"Queries and Reports", "dccp.trace.query", FT_BOOLEAN, 32,
				NULL, 0x00000010, "Queries and Reports", HFILL }},

			{ &hf_dccp_trace_ridc, {
				"RID Cache Messages", "dccp.trace.ridc", FT_BOOLEAN, 32,
				NULL, 0x00000020, "RID Cache Messages", HFILL }},

			{ &hf_dccp_trace_flood, {
				"Input/Output Flooding", "dccp.trace.flood", FT_BOOLEAN, 32,
				NULL, 0x00000040, "Input/Output Flooding", HFILL }},

			{ &hf_dccp_floodop, {
				"Flood Control Operation", "dccp.floodop", FT_UINT32, BASE_DEC,
				VALS(dccp_floodop_vals), 0, "Flood Control Operation", HFILL }},

        };
	static gint *ett[] = {
		&ett_dccp,
		&ett_dccp_op,
		&ett_dccp_ck,
		&ett_dccp_opnums,
		&ett_dccp_trace,
	};

	proto_dccp = proto_register_protocol("Distributed Checksum Clearinghouse Protocol",
	    "DCCP", "dccp");

	proto_register_field_array(proto_dccp, hf, array_length(hf));

	proto_register_subtree_array(ett, array_length(ett));
}

void
proto_reg_handoff_dccp(void)
{
	heur_dissector_add("udp", dissect_dccp, proto_dccp);
}