Set the svn:eol-style property on all text files to "native", so that
[obnox/wireshark/wip.git] / packet-dccp.c
1 /* packet-dccp.c
2  * Routines for Distributed Checksum Clearinghouse packet dissection
3  * DCC Home: http://www.rhyolite.com/anti-spam/dcc/
4  *
5  * Copyright 1999, Nathan Neulinger <nneul@umr.edu>
6  *
7  * $Id$
8  *
9  * Ethereal - Network traffic analyzer
10  * By Gerald Combs <gerald@ethereal.com>
11  * Copyright 1998 Gerald Combs
12  *
13  * Copied from packet-tftp.c
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <stdio.h>
35
36 #include <string.h>
37 #include <glib.h>
38 #include <epan/packet.h>
39
40 #include <packet-dccp.h>
41
42 static int proto_dccp = -1;
43 static int hf_dccp_len = -1;
44 static int hf_dccp_pkt_vers = -1;
45 static int hf_dccp_op = -1;
46 static int hf_dccp_clientid = -1;
47 static int hf_dccp_opnums_host = -1;
48 static int hf_dccp_opnums_pid = -1;
49 static int hf_dccp_opnums_report = -1;
50 static int hf_dccp_opnums_retrans = -1;
51
52 static int hf_dccp_signature = -1;
53 static int hf_dccp_max_pkt_vers = -1;
54 static int hf_dccp_qdelay_ms = -1;
55 static int hf_dccp_brand = -1;
56
57 static int hf_dccp_ck_type = -1;
58 static int hf_dccp_ck_len = -1;
59 static int hf_dccp_ck_sum = -1;
60
61 static int hf_dccp_date = -1;
62
63 static int hf_dccp_target = -1;
64
65 static int hf_dccp_adminop = -1;
66 static int hf_dccp_adminval = -1;
67 static int hf_dccp_floodop = -1;
68 static int hf_dccp_trace = -1;
69 static int hf_dccp_trace_admin = -1;
70 static int hf_dccp_trace_anon = -1;
71 static int hf_dccp_trace_client = -1;
72 static int hf_dccp_trace_rlim = -1;
73 static int hf_dccp_trace_query = -1;
74 static int hf_dccp_trace_ridc = -1;
75 static int hf_dccp_trace_flood = -1;
76
77 static gint ett_dccp = -1;
78 static gint ett_dccp_opnums = -1;
79 static gint ett_dccp_op = -1;
80 static gint ett_dccp_ck = -1;
81 static gint ett_dccp_trace = -1;
82
83 /* Utility macros */
84 #define D_SIGNATURE() \
85         proto_tree_add_item(dccp_optree, hf_dccp_signature, tvb, \
86                 offset, sizeof(DCC_SIGNATURE), FALSE); \
87         offset += sizeof(DCC_SIGNATURE);
88
89 #define D_LABEL(label,len) \
90         proto_tree_add_text(dccp_optree, tvb, offset, len, label); \
91         offset += len;
92
93 #define D_TEXT(label, endpad) { \
94         int next_offset,linelen,left; \
95         const char *line; \
96         while (tvb_offset_exists(tvb, offset+endpad)) { \
97                 left = tvb_length_remaining(tvb,offset) - endpad; \
98                 linelen = tvb_find_line_end(tvb, offset, left, &next_offset, \
99                     FALSE); \
100                 line = tvb_get_ptr(tvb, offset, linelen); \
101                 proto_tree_add_text(dccp_optree, tvb, offset, \
102                         next_offset - offset, "%s: %s", \
103                         label, tvb_format_text(tvb, offset, next_offset - offset)); \
104                 offset = next_offset; \
105         } \
106 }
107
108
109 #define D_TARGET() \
110         proto_tree_add_item_hidden(dccp_tree, hf_dccp_target, tvb, \
111                 offset, sizeof(DCC_TGTS), FALSE); \
112         proto_tree_add_text(dccp_optree, tvb, offset, sizeof(DCC_TGTS), \
113                 val_to_str(tvb_get_ntohl(tvb,offset), dccp_target_vals, "Targets (%u)")); \
114         offset += sizeof(DCC_TGTS); \
115
116 #define D_DATE() { \
117         nstime_t ts; \
118         ts.nsecs = 0; \
119         ts.secs = tvb_get_ntohl(tvb,offset); \
120         proto_tree_add_time(dccp_optree, hf_dccp_date, tvb, offset, 4, &ts); \
121         offset += 4; \
122 }
123
124
125 #define D_CHECKSUM() { \
126         proto_tree *cktree, *ti; \
127         ti = proto_tree_add_text(dccp_optree, tvb, offset, sizeof(DCC_CK), \
128                 "Checksum - %s", val_to_str(tvb_get_guint8(tvb,offset), \
129                 dccp_cktype_vals, \
130                 "Unknown Type: %u")); \
131         cktree = proto_item_add_subtree(ti, ett_dccp_ck); \
132         proto_tree_add_item(cktree, hf_dccp_ck_type, tvb, offset, 1, FALSE); \
133         offset += 1; \
134         proto_tree_add_item(cktree, hf_dccp_ck_len, tvb, offset, 1, FALSE); \
135         offset += 1; \
136         proto_tree_add_item(cktree, hf_dccp_ck_sum, tvb, offset, \
137                 sizeof(DCC_SUM), FALSE); \
138         offset += sizeof(DCC_SUM); \
139 }
140
141
142 /* Lookup string tables */
143 static const value_string dccp_op_vals[] = {
144         {DCC_OP_INVALID, "Invalid Op"},
145         {DCC_OP_NOP,    "No-Op"},
146         {DCC_OP_REPORT, "Report and Query"},
147         {DCC_OP_QUERY, "Query"},
148         {DCC_OP_QUERY_RESP, "Server Response"},
149         {DCC_OP_ADMN, "Admin"},
150         {DCC_OP_OK, "Ok"},
151         {DCC_OP_ERROR, "Server Failing"},
152         {DCC_OP_DELETE, "Delete Checksum(s)"},
153         {0, NULL}
154 };
155
156 static const value_string dccp_cktype_vals[] = {
157         {DCC_CK_INVALID, "Invalid/Deleted from DB when seen"},
158         {DCC_CK_IP,     "MD5 of binary source IPv6 address"},
159         {DCC_CK_ENV_FROM, "MD5 of envelope Mail From value"},
160         {DCC_CK_FROM, "MD5 of header From: line"},
161         {DCC_CK_SUB, "MD5 of substitute header line"},
162         {DCC_CK_MESSAGE_ID, "MD5 of header Message-ID: line"},
163         {DCC_CK_RECEIVED, "MD5 of last header Received: line"},
164         {DCC_CK_BODY, "MD5 of body"},
165         {DCC_CK_FUZ1, "MD5 of filtered body - FUZ1"},
166         {DCC_CK_FUZ2, "MD5 of filtered body - FUZ2"},
167         {DCC_CK_FUZ3, "MD5 of filtered body - FUZ3"},
168         {DCC_CK_FUZ4, "MD5 of filtered body - FUZ4"},
169         {DCC_CK_SRVR_ID, "hostname for server-ID check "},
170         {DCC_CK_ENV_TO, "MD5 of envelope Rcpt To value"},
171         {0, NULL},
172 };
173
174 static const value_string dccp_adminop_vals[] = {
175         {DCC_AOP_OK, "Never sent"},
176         {DCC_AOP_STOP, "Stop Gracefully"},
177         {DCC_AOP_NEW_IDS, "Load keys and client IDs"},
178         {DCC_AOP_FLOD, "Flood control"},
179         {DCC_AOP_DB_UNLOCK, "Start Switch to new database"},
180         {DCC_AOP_DB_NEW, "Finish Switch to new database"},
181         {DCC_AOP_STATS, "Return counters"},
182         {DCC_AOP_STATS_CLEAR, "Return and zero counters"},
183         {DCC_AOP_TRACE_ON, "Enable tracing"},
184         {DCC_AOP_TRACE_OFF, "Disable tracing"},
185         {DCC_AOP_CUR_CLIENTS, "List clients"},
186         {0, NULL},
187 };
188
189 static const value_string dccp_target_vals[] = {
190         {DCC_TGTS_TOO_MANY, "Targets (>= 16777200)"},
191         {DCC_TGTS_OK, "Certified not spam"},
192         {DCC_TGTS_OK2, "Half certified not spam"},
193         {DCC_TGTS_DEL, "Deleted checksum"},
194         {DCC_TGTS_INVALID, "Invalid"},
195         {0, NULL},
196 };
197
198 static const value_string dccp_floodop_vals[] = {
199         {DCC_AOP_FLOD_CHECK, "Check"},
200         {DCC_AOP_FLOD_SHUTDOWN, "Shutdown"},
201         {DCC_AOP_FLOD_HALT, "Halt"},
202         {DCC_AOP_FLOD_RESUME, "Resume"},
203         {DCC_AOP_FLOD_REWIND, "Rewind"},
204         {DCC_AOP_FLOD_LIST, "List"},
205         {DCC_AOP_FLOD_STATS, "Stats"},
206         {DCC_AOP_FLOD_STATS_CLEAR, "Clear Stats"},
207         {0,NULL},
208 };
209
210 static gboolean
211 dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
212 {
213         proto_tree      *dccp_tree, *dccp_optree, *dccp_opnumtree, *ti;
214         proto_tree *dccp_tracetree;
215         int offset = 0;
216         int client_is_le = 0;
217         int op = 0;
218         int i, is_response;
219
220         if (pinfo->srcport != DCC_PORT && pinfo->destport != DCC_PORT) {
221                 /* Not the right port - not a DCC packet. */
222                 return FALSE;
223         }
224
225         /* get at least a full packet structure */
226         if ( !tvb_bytes_exist(tvb, 0, sizeof(DCC_HDR)) ) {
227                 /* Doesn't have enough bytes to contain packet header. */
228                 return FALSE;
229         }
230
231         if (check_col(pinfo->cinfo, COL_PROTOCOL))
232                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DCCP");
233
234         offset = 0;
235         is_response = pinfo->srcport == DCC_PORT;
236
237         if (check_col(pinfo->cinfo, COL_INFO)) {
238                 col_add_fstr(pinfo->cinfo, COL_INFO,
239                         "%s: %s",
240                         is_response ? "Response" : "Request",
241                         val_to_str(tvb_get_guint8(tvb, offset+3),
242                                  dccp_op_vals, "Unknown Op: %u")
243                 );
244         }
245
246         if (tree) {
247                 ti = proto_tree_add_item(tree, proto_dccp, tvb, offset, -1,
248                         FALSE);
249                 dccp_tree = proto_item_add_subtree(ti, ett_dccp);
250
251                 proto_tree_add_item(dccp_tree, hf_dccp_len, tvb,
252                         offset, 2, FALSE);
253
254                 if ( !tvb_bytes_exist(tvb, 0, tvb_get_ntohs(tvb, offset))) {
255                         /* Doesn't have number of bytes that header claims. */
256                         proto_tree_add_text(dccp_tree, tvb, offset, 2, "Error - packet is shorter than header claims!");
257                 }
258                 offset += 2;
259
260                 proto_tree_add_item(dccp_tree, hf_dccp_pkt_vers, tvb,
261                         offset, 1, FALSE);
262                 offset += 1;
263
264                 op = tvb_get_guint8(tvb, offset);
265                 proto_tree_add_item(dccp_tree, hf_dccp_op, tvb,
266                         offset, 1, FALSE);
267                 offset += 1;
268
269                 proto_tree_add_item(dccp_tree, hf_dccp_clientid, tvb,
270                         offset, 4, FALSE);
271                 offset += 4;
272
273                 ti = proto_tree_add_text(dccp_tree, tvb, offset, -1, "Operation Numbers (Opaque to Server)");
274                 dccp_opnumtree = proto_item_add_subtree(ti, ett_dccp_opnums);
275
276                 /* Note - these are indeterminate - they are sortof considered opaque to the client */
277                 /* Make some attempt to figure out if this data is little endian, not guaranteed to be
278                 correct if connection went through a firewall or similar. */
279
280                 /* Very hokey check - if all three of pid/report/retrans look like little-endian
281                         numbers, host is probably little endian. Probably innacurate on super-heavily-used
282                         DCC clients though. This should be good enough for now. */
283                 client_is_le = ( (tvb_get_guint8(tvb, offset+4) | tvb_get_guint8(tvb, offset+4)) &&
284                                                  (tvb_get_guint8(tvb, offset+8) | tvb_get_guint8(tvb, offset+9)) &&
285                                                  (tvb_get_guint8(tvb, offset+12) | tvb_get_guint8(tvb, offset+13)) );
286
287                 proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_host, tvb,
288                         offset, 4, client_is_le);
289                 offset += 4;
290
291                 proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_pid, tvb,
292                         offset, 4, client_is_le);
293                 offset += 4;
294
295                 proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_report, tvb,
296                         offset, 4, client_is_le);
297                 offset += 4;
298
299                 proto_tree_add_item(dccp_opnumtree, hf_dccp_opnums_retrans, tvb,
300                         offset, 4, client_is_le);
301                 offset += 4;
302
303                 ti = proto_tree_add_text(dccp_tree, tvb, offset, -1, "Operation: %s",
304                         val_to_str(op, dccp_op_vals, "Unknown Op: %u"));
305                 dccp_optree = proto_item_add_subtree(ti, ett_dccp_op);
306
307                 switch(op) {
308                         case DCC_OP_NOP:
309                                 D_SIGNATURE();
310                                 break;
311
312                         case DCC_OP_REPORT:
313                                 D_TARGET();
314                                 for (i=0; i<=DCC_QUERY_MAX &&
315                                         tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++)
316                                 {
317                                         D_CHECKSUM();
318                                 }
319                                 D_SIGNATURE();
320                                 break;
321
322                         case DCC_OP_QUERY_RESP:
323                                 for (i=0; i<=DCC_QUERY_MAX &&
324                                         tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++)
325                                 {
326                                         D_TARGET();
327                                 }
328                                 D_SIGNATURE();
329                                 break;
330
331                         case DCC_OP_ADMN:
332                                 if ( is_response )
333                                 {
334                                         int left = tvb_length_remaining(tvb, offset) -
335                                                 sizeof(DCC_SIGNATURE);
336                                         if ( left == sizeof(DCC_ADMN_RESP_CLIENTS) )
337                                         {
338                                                 D_LABEL("Addr", 16);
339                                                 D_LABEL("Id", sizeof(DCC_CLNT_ID));
340                                                 D_LABEL("Last Used", 4);
341                                                 D_LABEL("Requests", 4);
342                                         }
343                                         else
344                                         {
345                                                 D_TEXT("Response Text", sizeof(DCC_SIGNATURE));
346                                         }
347                                         D_SIGNATURE();
348                                 }
349                                 else
350                                 {
351                                         int aop;
352
353                                         D_DATE();
354
355                                         aop = tvb_get_guint8(tvb, offset+4);
356                                         proto_tree_add_item(dccp_optree, hf_dccp_adminop, tvb, offset+4,
357                                                 1, FALSE);
358                                         if (check_col(pinfo->cinfo, COL_INFO)) {
359                                                 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
360                                                         val_to_str(tvb_get_guint8(tvb,offset+4),
361                                                         dccp_adminop_vals, "Unknown (%u)"));
362                                         }
363
364                                         if (aop == DCC_AOP_TRACE_ON || aop == DCC_AOP_TRACE_OFF )
365                                         {
366                                                 ti = proto_tree_add_item(dccp_optree, hf_dccp_trace, tvb, offset,
367                                                         4, FALSE);
368                                                 dccp_tracetree = proto_item_add_subtree(ti, ett_dccp_trace);
369                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_admin, tvb, offset, 4, FALSE);
370                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_anon, tvb, offset, 4, FALSE);
371                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_client, tvb, offset, 4, FALSE);
372                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_rlim, tvb, offset, 4, FALSE);
373                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_query, tvb, offset, 4, FALSE);
374                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_ridc, tvb, offset, 4, FALSE);
375                                                 proto_tree_add_item(dccp_tracetree, hf_dccp_trace_flood, tvb, offset, 4, FALSE);
376                                         }
377                                         else if ( aop == DCC_AOP_FLOD )
378                                         {
379                                                 proto_tree_add_item(dccp_optree, hf_dccp_floodop,
380                                                         tvb, offset, 4, FALSE);
381                                                 if (check_col(pinfo->cinfo, COL_INFO)) {
382                                                         col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
383                                                                 val_to_str(tvb_get_ntohl(tvb,offset),
384                                                                 dccp_floodop_vals, "Unknown (%u)"));
385                                                 }
386                                         }
387                                         else
388                                         {
389                                                 proto_tree_add_item(dccp_optree, hf_dccp_adminval,
390                                                         tvb, offset, 4, FALSE);
391                                         }
392                                         offset += 4;
393
394                                         offset += 1; /* admin op we did in reverse order */
395                                         D_LABEL("Pad", 3);
396                                         D_SIGNATURE();
397                                 }
398                                 break;
399
400                         case DCC_OP_OK:
401                                 proto_tree_add_item(dccp_optree, hf_dccp_max_pkt_vers, tvb,
402                                         offset, 1, FALSE);
403                                 offset += 1;
404
405                                 D_LABEL("Unused", 1);
406
407                                 proto_tree_add_item(dccp_optree, hf_dccp_qdelay_ms, tvb,
408                                         offset, 2, FALSE);
409                                 offset += 2;
410
411                                 proto_tree_add_item(dccp_optree, hf_dccp_brand, tvb,
412                                         offset, sizeof(DCC_BRAND), FALSE);
413                                 offset += sizeof(DCC_BRAND);
414
415                                 D_SIGNATURE();
416                                 break;
417
418                         default:
419                                 /* do nothing */
420                                 break;
421                 }
422         }
423
424         return TRUE;
425 }
426
427 void
428 proto_register_dccp(void)
429 {
430         static hf_register_info hf[] = {
431                         { &hf_dccp_len, {
432                                 "Packet Length", "dccp.len", FT_UINT16, BASE_DEC,
433                                 NULL, 0, "Packet Length", HFILL }},
434
435                         { &hf_dccp_pkt_vers, {
436                                 "Packet Version", "dccp.pkt_vers", FT_UINT16, BASE_DEC,
437                                 NULL, 0, "Packet Version", HFILL }},
438
439                         { &hf_dccp_op, {
440                                 "Operation Type", "dccp.op", FT_UINT8, BASE_DEC,
441                                 VALS(dccp_op_vals), 0, "Operation Type", HFILL }},
442
443                         { &hf_dccp_clientid, {
444                                 "Client ID", "dccp.clientid", FT_UINT32, BASE_DEC,
445                                 NULL, 0, "Client ID", HFILL }},
446
447                         { &hf_dccp_opnums_host, {
448                                 "Host", "dccp.opnums.host", FT_IPv4, BASE_DEC,
449                                 NULL, 0, "Host", HFILL }},
450
451                         { &hf_dccp_opnums_pid, {
452                                 "Process ID", "dccp.opnums.pid", FT_UINT32, BASE_DEC,
453                                 NULL, 0, "Process ID", HFILL }},
454
455                         { &hf_dccp_opnums_report, {
456                                 "Report", "dccp.opnums.report", FT_UINT32, BASE_DEC,
457                                 NULL, 0, "Report", HFILL }},
458
459                         { &hf_dccp_opnums_retrans, {
460                                 "Retransmission", "dccp.opnums.retrans", FT_UINT32, BASE_DEC,
461                                 NULL, 0, "Retransmission", HFILL }},
462
463                         { &hf_dccp_signature, {
464                                 "Signature", "dccp.signature", FT_BYTES, BASE_HEX,
465                                 NULL, 0, "Signature", HFILL }},
466
467                         { &hf_dccp_max_pkt_vers, {
468                                 "Maximum Packet Version", "dccp.max_pkt_vers", FT_UINT8, BASE_DEC,
469                                 NULL, 0, "Maximum Packet Version", HFILL }},
470
471                         { &hf_dccp_qdelay_ms, {
472                                 "Client Delay", "dccp.qdelay_ms", FT_UINT16, BASE_DEC,
473                                 NULL, 0, "Client Delay", HFILL }},
474
475                         { &hf_dccp_brand, {
476                                 "Server Brand", "dccp.brand", FT_STRING, BASE_DEC,
477                                 NULL, 0, "Server Brand", HFILL }},
478
479                         { &hf_dccp_ck_type, {
480                                 "Type", "dccp.checksum.type", FT_UINT8, BASE_DEC,
481                                 VALS(dccp_cktype_vals), 0, "Checksum Type", HFILL }},
482
483                         { &hf_dccp_ck_len, {
484                                 "Length", "dccp.checksum.length", FT_UINT8, BASE_DEC,
485                                 NULL, 0, "Checksum Length", HFILL }},
486
487                         { &hf_dccp_ck_sum, {
488                                 "Sum", "dccp.checksum.sum", FT_BYTES, BASE_HEX,
489                                 NULL, 0, "Checksum", HFILL }},
490
491                         { &hf_dccp_target, {
492                                 "Target", "dccp.target", FT_UINT32, BASE_HEX,
493                                 NULL, 0, "Target", HFILL }},
494
495                         { &hf_dccp_date, {
496                                 "Date", "dccp.date", FT_ABSOLUTE_TIME, BASE_DEC,
497                                 NULL, 0, "Date", HFILL }},
498
499                         { &hf_dccp_adminop, {
500                                 "Admin Op", "dccp.adminop", FT_UINT8, BASE_DEC,
501                                 VALS(dccp_adminop_vals), 0, "Admin Op", HFILL }},
502
503                         { &hf_dccp_adminval, {
504                                 "Admin Value", "dccp.adminval", FT_UINT32, BASE_DEC,
505                                 NULL, 0, "Admin Value", HFILL }},
506
507                         { &hf_dccp_trace, {
508                                 "Trace Bits", "dccp.trace", FT_UINT32, BASE_HEX,
509                                 NULL, 0, "Trace Bits", HFILL }},
510
511                         { &hf_dccp_trace_admin, {
512                                 "Admin Requests", "dccp.trace.admin", FT_BOOLEAN, 32,
513                                 NULL, 0x00000001, "Admin Requests", HFILL }},
514
515                         { &hf_dccp_trace_anon, {
516                                 "Anonymous Requests", "dccp.trace.anon", FT_BOOLEAN, 32,
517                                 NULL, 0x00000002, "Anonymous Requests", HFILL }},
518
519                         { &hf_dccp_trace_client, {
520                                 "Authenticated Client Requests", "dccp.trace.client", FT_BOOLEAN, 32,
521                                 NULL, 0x00000004, "Authenticated Client Requests", HFILL }},
522
523                         { &hf_dccp_trace_rlim, {
524                                 "Rate-Limited Requests", "dccp.trace.rlim", FT_BOOLEAN, 32,
525                                 NULL, 0x00000008, "Rate-Limited Requests", HFILL }},
526
527                         { &hf_dccp_trace_query, {
528                                 "Queries and Reports", "dccp.trace.query", FT_BOOLEAN, 32,
529                                 NULL, 0x00000010, "Queries and Reports", HFILL }},
530
531                         { &hf_dccp_trace_ridc, {
532                                 "RID Cache Messages", "dccp.trace.ridc", FT_BOOLEAN, 32,
533                                 NULL, 0x00000020, "RID Cache Messages", HFILL }},
534
535                         { &hf_dccp_trace_flood, {
536                                 "Input/Output Flooding", "dccp.trace.flood", FT_BOOLEAN, 32,
537                                 NULL, 0x00000040, "Input/Output Flooding", HFILL }},
538
539                         { &hf_dccp_floodop, {
540                                 "Flood Control Operation", "dccp.floodop", FT_UINT32, BASE_DEC,
541                                 VALS(dccp_floodop_vals), 0, "Flood Control Operation", HFILL }},
542
543         };
544         static gint *ett[] = {
545                 &ett_dccp,
546                 &ett_dccp_op,
547                 &ett_dccp_ck,
548                 &ett_dccp_opnums,
549                 &ett_dccp_trace,
550         };
551
552         proto_dccp = proto_register_protocol("Distributed Checksum Clearinghouse Protocol",
553             "DCCP", "dccp");
554
555         proto_register_field_array(proto_dccp, hf, array_length(hf));
556
557         proto_register_subtree_array(ett, array_length(ett));
558 }
559
560 void
561 proto_reg_handoff_dccp(void)
562 {
563         heur_dissector_add("udp", dissect_dccp, proto_dccp);
564 }