2 * Routines for Web Cache Coordination Protocol dissection
3 * Jerry Talkington <jtalkington@users.sourceforge.net>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #include <epan/packet.h>
33 #include <epan/strutil.h>
34 #include <epan/emem.h>
35 #include "packet-wccp.h"
37 static int proto_wccp = -1;
38 static int hf_wccp_message_type = -1; /* the message type */
39 static int hf_wccp_version = -1; /* protocol version */
40 static int hf_hash_revision = -1; /* the version of the hash */
41 static int hf_change_num = -1; /* change number */
42 static int hf_recvd_id = -1;
43 static int hf_cache_ip = -1;
45 static gint ett_wccp = -1;
46 static gint ett_cache_count = -1;
47 static gint ett_buckets = -1;
48 static gint ett_flags = -1;
49 static gint ett_cache_info = -1;
50 static gint ett_security_info = -1;
51 static gint ett_service_info = -1;
52 static gint ett_service_flags = -1;
53 static gint ett_router_identity_element = -1;
54 static gint ett_router_identity_info = -1;
55 static gint ett_wc_identity_element = -1;
56 static gint ett_wc_identity_info = -1;
57 static gint ett_router_view_info = -1;
58 static gint ett_wc_view_info = -1;
59 static gint ett_router_assignment_element = -1;
60 static gint ett_router_assignment_info = -1;
61 static gint ett_query_info = -1;
62 static gint ett_capabilities_info = -1;
63 static gint ett_capability_element = -1;
64 static gint ett_capability_forwarding_method = -1;
65 static gint ett_capability_assignment_method = -1;
66 static gint ett_capability_return_method = -1;
67 static gint ett_alt_assignment_info = -1;
68 static gint ett_mv_set_element = -1;
69 static gint ett_value_element = -1;
70 static gint ett_unknown_info = -1;
75 * http://www.alternic.org/drafts/drafts-f-g/draft-forster-wrec-wccp-v1-00.html
77 * is a copy of the now-expired Internet-Draft for WCCP 1.0.
81 * http://tools.ietf.org/id/draft-wilson-wrec-wccp-v2-01.txt
83 * is an Internet-Draft for WCCP 2.0.
86 /* This is NOT IANA assigned */
87 #define UDP_PORT_WCCP 2048
91 #define WCCP_HERE_I_AM 7
92 #define WCCP_I_SEE_YOU 8
93 #define WCCP_ASSIGN_BUCKET 9
94 #define WCCP2_HERE_I_AM 10
95 #define WCCP2_I_SEE_YOU 11
96 #define WCCP2_REDIRECT_ASSIGN 12
97 #define WCCP2_REMOVAL_QUERY 13
99 static const value_string wccp_type_vals[] = {
100 { WCCP_HERE_I_AM, "1.0 Here I am" },
101 { WCCP_I_SEE_YOU, "1.0 I see you" },
102 { WCCP_ASSIGN_BUCKET, "1.0 Assign bucket" },
103 { WCCP2_HERE_I_AM, "2.0 Here I am" },
104 { WCCP2_I_SEE_YOU, "2.0 I see you" },
105 { WCCP2_REDIRECT_ASSIGN, "2.0 Redirect assign" },
106 { WCCP2_REMOVAL_QUERY, "2.0 Removal query" },
110 static const value_string wccp_version_val[] = {
116 #define HASH_INFO_SIZE (4*(1+8+1))
118 #define WCCP_U_FLAG 0x80000000
120 #define WCCP2_SECURITY_INFO 0
121 #define WCCP2_SERVICE_INFO 1
122 #define WCCP2_ROUTER_ID_INFO 2
123 #define WCCP2_WC_ID_INFO 3
124 #define WCCP2_RTR_VIEW_INFO 4
125 #define WCCP2_WC_VIEW_INFO 5
126 #define WCCP2_REDIRECT_ASSIGNMENT 6
127 #define WCCP2_QUERY_INFO 7
128 #define WCCP2_CAPABILITIES_INFO 8
129 #define WCCP2_ALT_ASSIGNMENT 13
130 #define WCCP2_ASSIGN_MAP 14
131 #define WCCP2_COMMAND_EXTENSION 15
133 static const value_string info_type_vals[] = {
134 { WCCP2_SECURITY_INFO, "Security Info" },
135 { WCCP2_SERVICE_INFO, "Service Info" },
136 { WCCP2_ROUTER_ID_INFO, "Router Identity Info" },
137 { WCCP2_WC_ID_INFO, "Web-Cache Identity Info" },
138 { WCCP2_RTR_VIEW_INFO, "Router View Info" },
139 { WCCP2_WC_VIEW_INFO, "Web-Cache View Info" },
140 { WCCP2_REDIRECT_ASSIGNMENT, "Assignment Info" },
141 { WCCP2_QUERY_INFO, "Query Info" },
142 { WCCP2_CAPABILITIES_INFO, "Capabilities Info" },
143 { WCCP2_ALT_ASSIGNMENT, "Alternate Assignment" },
144 { WCCP2_ASSIGN_MAP, "Assignment Map" },
145 { WCCP2_COMMAND_EXTENSION, "Command Extension" },
149 const value_string service_id_vals[] = {
154 typedef struct capability_flag {
156 const char *short_name;
157 const char *long_name;
160 static void dissect_hash_data(tvbuff_t *tvb, int offset,
161 proto_tree *wccp_tree);
162 static void dissect_web_cache_list_entry(tvbuff_t *tvb, int offset,
163 int index, proto_tree *wccp_tree);
164 static int wccp_bucket_info(guint8 bucket_info, proto_tree *bucket_tree,
165 guint32 start, tvbuff_t *tvb, int offset);
166 static gchar *bucket_name(guint8 bucket);
167 static guint16 dissect_wccp2_header(tvbuff_t *tvb, int offset,
168 proto_tree *wccp_tree);
169 static void dissect_wccp2_info(tvbuff_t *tvb, int offset, guint16 length,
170 proto_tree *wccp_tree);
171 static gboolean dissect_wccp2_security_info(tvbuff_t *tvb, int offset,
172 int length, proto_tree *info_tree);
173 static gboolean dissect_wccp2_service_info(tvbuff_t *tvb, int offset,
174 int length, proto_tree *info_tree);
175 static gboolean dissect_wccp2_router_identity_info(tvbuff_t *tvb,
176 int offset, int length, proto_tree *info_tree);
177 static gboolean dissect_wccp2_wc_identity_info(tvbuff_t *tvb, int offset,
178 int length, proto_tree *info_tree);
179 static gboolean dissect_wccp2_router_view_info(tvbuff_t *tvb, int offset,
180 int length, proto_tree *info_tree);
181 static gboolean dissect_wccp2_wc_view_info(tvbuff_t *tvb, int offset,
182 int length, proto_tree *info_tree);
183 static gboolean dissect_wccp2_assignment_info(tvbuff_t *tvb, int offset,
184 int length, proto_tree *info_tree);
185 static gboolean dissect_wccp2_router_query_info(tvbuff_t *tvb, int offset,
186 int length, proto_tree *info_tree);
187 static gboolean dissect_wccp2_capability_info(tvbuff_t *tvb, int offset,
188 int length, proto_tree *info_tree);
189 static void dissect_32_bit_capability_flags(tvbuff_t *tvb, int curr_offset,
190 guint16 capability_val_len, gint ett, const capability_flag *flags,
191 proto_tree *element_tree);
192 static gboolean dissect_wccp2_alt_assignment_info(tvbuff_t *tvb, int offset,
193 int length, proto_tree *info_tree);
196 dissect_wccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
199 proto_tree *wccp_tree = NULL;
200 proto_item *wccp_tree_item;
201 guint32 wccp_message_type;
207 wccp_message_type = tvb_get_ntohl(tvb, offset);
209 /* Check if this is really a WCCP message */
210 if (match_strval(wccp_message_type, wccp_type_vals) == NULL)
213 if(check_col(pinfo->cinfo, COL_PROTOCOL)) {
214 col_set_str(pinfo->cinfo, COL_PROTOCOL, "WCCP");
216 if(check_col(pinfo->cinfo, COL_INFO)) {
217 col_clear(pinfo->cinfo, COL_INFO);
221 if(check_col(pinfo->cinfo, COL_INFO)) {
222 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(wccp_message_type,
223 wccp_type_vals, "Unknown WCCP message (%u)"));
227 wccp_tree_item = proto_tree_add_item(tree, proto_wccp, tvb, offset,
229 wccp_tree = proto_item_add_subtree(wccp_tree_item, ett_wccp);
231 proto_tree_add_uint(wccp_tree, hf_wccp_message_type, tvb, offset,
232 sizeof(wccp_message_type), wccp_message_type);
233 offset += sizeof(wccp_message_type);
235 switch (wccp_message_type) {
238 proto_tree_add_item(wccp_tree, hf_wccp_version, tvb,
241 dissect_hash_data(tvb, offset, wccp_tree);
242 offset += HASH_INFO_SIZE;
243 proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset,
249 proto_tree_add_item(wccp_tree, hf_wccp_version, tvb,
252 proto_tree_add_item(wccp_tree, hf_change_num, tvb, offset,
255 proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset,
258 cache_count = tvb_get_ntohl(tvb, offset);
259 proto_tree_add_text(wccp_tree, tvb, offset, 4,
260 "Number of Web Caches: %u", cache_count);
262 for (i = 0; i < cache_count; i++) {
263 dissect_web_cache_list_entry(tvb, offset, i,
265 offset += 4 + HASH_INFO_SIZE;
269 case WCCP_ASSIGN_BUCKET:
271 * This hasn't been tested, since I don't have any
272 * traces with this in it.
274 * The V1 spec claims that this does, indeed,
275 * have a Received ID field after the type,
276 * rather than a Version field.
278 proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset,
281 cache_count = tvb_get_ntohl(tvb, offset);
282 proto_tree_add_text(wccp_tree, tvb, offset, 4,
283 "Number of Web Caches: %u", cache_count);
285 for (i = 0; i < cache_count; i++) {
286 ipaddr = tvb_get_ipv4(tvb, offset);
287 proto_tree_add_ipv4_format(wccp_tree,
288 hf_cache_ip, tvb, offset, 4,
290 "Web Cache %d IP Address: %s", i,
291 ip_to_str((guint8 *)&ipaddr));
294 for (i = 0; i < 256; i += 4) {
295 proto_tree_add_text(wccp_tree, tvb, offset, 4,
296 "Buckets %d - %d: %10s %10s %10s %10s",
298 bucket_name(tvb_get_guint8(tvb, offset)),
299 bucket_name(tvb_get_guint8(tvb, offset+1)),
300 bucket_name(tvb_get_guint8(tvb, offset+2)),
301 bucket_name(tvb_get_guint8(tvb, offset+3)));
306 case WCCP2_HERE_I_AM:
307 case WCCP2_I_SEE_YOU:
308 case WCCP2_REMOVAL_QUERY:
309 case WCCP2_REDIRECT_ASSIGN:
310 default: /* assume unknown packets are v2 */
311 length = dissect_wccp2_header(tvb, offset, wccp_tree);
313 dissect_wccp2_info(tvb, offset, length, wccp_tree);
318 return(tvb_length(tvb));
322 dissect_hash_data(tvbuff_t *tvb, int offset, proto_tree *wccp_tree)
324 proto_item *bucket_item;
325 proto_tree *bucket_tree;
327 proto_tree *field_tree;
333 proto_tree_add_item(wccp_tree, hf_hash_revision, tvb, offset, 4,
337 bucket_item = proto_tree_add_text(wccp_tree, tvb, offset, 32,
339 bucket_tree = proto_item_add_subtree(bucket_item, ett_buckets);
341 for (i = 0, n = 0; i < 32; i++) {
342 bucket_info = tvb_get_guint8(tvb, offset);
343 n = wccp_bucket_info(bucket_info, bucket_tree, n, tvb, offset);
346 flags = tvb_get_ntohl(tvb, offset);
347 tf = proto_tree_add_text(wccp_tree, tvb, offset, 4,
348 "Flags: 0x%08X (%s)", flags,
349 ((flags & WCCP_U_FLAG) ?
350 "Hash information is historical" :
351 "Hash information is current"));
352 field_tree = proto_item_add_subtree(tf, ett_flags);
353 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
354 decode_boolean_bitfield(flags, WCCP_U_FLAG,
356 "Hash information is historical",
357 "Hash information is current"));
361 dissect_web_cache_list_entry(tvbuff_t *tvb, int offset, int index,
362 proto_tree *wccp_tree)
365 proto_tree *list_entry_tree;
367 tl = proto_tree_add_text(wccp_tree, tvb, offset, 4 + HASH_INFO_SIZE,
368 "Web-Cache List Entry(%d)", index);
369 list_entry_tree = proto_item_add_subtree(tl, ett_cache_info);
370 proto_tree_add_item(list_entry_tree, hf_cache_ip, tvb, offset, 4,
372 dissect_hash_data(tvb, offset + 4, list_entry_tree);
377 * takes an integer representing a "Hash Information" bitmap, and spits out
378 * the corresponding proto_tree entries, returning the next bucket number.
381 wccp_bucket_info(guint8 bucket_info, proto_tree *bucket_tree, guint32 start,
382 tvbuff_t *tvb, int offset)
386 for(i = 0; i < 8; i++) {
387 proto_tree_add_text(bucket_tree, tvb, offset, sizeof(bucket_info), "Bucket %3d: %s", start, (bucket_info & 1<<i ? "Assigned" : "Not Assigned") );
394 bucket_name(guint8 bucket)
398 if (bucket == 0xff) {
402 g_snprintf(cur, 10+1, "%u", bucket);
408 dissect_wccp2_header(tvbuff_t *tvb, int offset, proto_tree *wccp_tree)
412 proto_tree_add_item(wccp_tree, hf_wccp_version, tvb, offset, 2,
415 length = tvb_get_ntohs(tvb, offset);
416 proto_tree_add_text(wccp_tree, tvb, offset, 2, "Length: %u",
422 dissect_wccp2_info(tvbuff_t *tvb, int offset, guint16 length,
423 proto_tree *wccp_tree)
428 proto_tree *info_tree;
430 gboolean (*dissector)(tvbuff_t *, int, int, proto_tree *);
432 while (length != 0) {
433 type = tvb_get_ntohs(tvb, offset);
434 item_length = tvb_get_ntohs(tvb, offset+2);
438 case WCCP2_SECURITY_INFO:
439 ett = ett_security_info;
440 dissector = dissect_wccp2_security_info;
443 case WCCP2_SERVICE_INFO:
444 ett = ett_service_info;
445 dissector = dissect_wccp2_service_info;
448 case WCCP2_ROUTER_ID_INFO:
449 ett = ett_router_identity_info;
450 dissector = dissect_wccp2_router_identity_info;
453 case WCCP2_WC_ID_INFO:
454 ett = ett_wc_identity_info;
455 dissector = dissect_wccp2_wc_identity_info;
458 case WCCP2_RTR_VIEW_INFO:
459 ett = ett_router_view_info;
460 dissector = dissect_wccp2_router_view_info;
463 case WCCP2_WC_VIEW_INFO:
464 ett = ett_wc_view_info;
465 dissector = dissect_wccp2_wc_view_info;
468 case WCCP2_REDIRECT_ASSIGNMENT:
469 ett = ett_router_assignment_info;
470 dissector = dissect_wccp2_assignment_info;
473 case WCCP2_QUERY_INFO:
474 ett = ett_query_info;
475 dissector = dissect_wccp2_router_query_info;
478 case WCCP2_CAPABILITIES_INFO:
479 ett = ett_capabilities_info;
480 dissector = dissect_wccp2_capability_info;
483 case WCCP2_ALT_ASSIGNMENT:
484 ett = ett_alt_assignment_info;
485 dissector = dissect_wccp2_alt_assignment_info;
488 case WCCP2_ASSIGN_MAP:
489 case WCCP2_COMMAND_EXTENSION:
491 ett = ett_unknown_info;
496 ti = proto_tree_add_text(wccp_tree, tvb, offset, item_length + 4, "%s",
497 val_to_str(type, info_type_vals, "Unknown info type (%u)"));
498 info_tree = proto_item_add_subtree(ti, ett);
499 proto_tree_add_text(info_tree, tvb, offset, 2,
501 val_to_str(type, info_type_vals, "Unknown info type (%u)"));
502 proto_tree_add_text(info_tree, tvb, offset+2, 2,
503 "Length: %u", item_length);
508 * XXX - pass in "length" and check for that as well.
510 if (dissector != NULL) {
511 if (!(*dissector)(tvb, offset, item_length, info_tree))
512 return; /* ran out of data */
514 proto_tree_add_text(info_tree, tvb, offset, item_length,
515 "Data: %u byte%s", item_length,
516 plurality(item_length, "", "s"));
518 offset += item_length;
519 length -= item_length;
523 #define SECURITY_INFO_LEN 4
525 #define WCCP2_NO_SECURITY 0
526 #define WCCP2_MD5_SECURITY 1
529 dissect_wccp2_security_info(tvbuff_t *tvb, int offset, int length,
530 proto_tree *info_tree)
532 guint32 security_option;
534 if (length < SECURITY_INFO_LEN) {
535 proto_tree_add_text(info_tree, tvb, offset, 0,
536 "Item length is %u, should be %u", length,
541 security_option = tvb_get_ntohl(tvb, offset);
542 switch (security_option) {
544 case WCCP2_NO_SECURITY:
545 proto_tree_add_text(info_tree, tvb, offset, 4,
546 "Security Option: None");
549 case WCCP2_MD5_SECURITY:
550 proto_tree_add_text(info_tree, tvb, offset, 4,
551 "Security Option: MD5");
554 proto_tree_add_text(info_tree, tvb, offset,
555 length - 4, "MD5 checksum: %s",
556 tvb_bytes_to_str(tvb, offset, length - 4));
561 proto_tree_add_text(info_tree, tvb, offset, 4,
562 "Security Option: Unknown (%u)", security_option);
568 #define SERVICE_INFO_LEN (4+4+8*2)
570 #define WCCP2_SERVICE_STANDARD 0
571 #define WCCP2_SERVICE_DYNAMIC 1
576 #define WCCP2_SI_SRC_IP_HASH 0x0001
577 #define WCCP2_SI_DST_IP_HASH 0x0002
578 #define WCCP2_SI_SRC_PORT_HASH 0x0004
579 #define WCCP2_SI_DST_PORT_HASH 0x0008
580 #define WCCP2_SI_PORTS_DEFINED 0x0010
581 #define WCCP2_SI_PORTS_SOURCE 0x0020
582 #define WCCP2_SI_SRC_IP_ALT_HASH 0x0100
583 #define WCCP2_SI_DST_IP_ALT_HASH 0x0200
584 #define WCCP2_SI_SRC_PORT_ALT_HASH 0x0400
585 #define WCCP2_SI_DST_PORT_ALT_HASH 0x0800
588 dissect_wccp2_service_info(tvbuff_t *tvb, int offset, int length,
589 proto_tree *info_tree)
594 proto_tree *field_tree;
597 if (length != SERVICE_INFO_LEN) {
598 proto_tree_add_text(info_tree, tvb, offset, 0,
599 "Item length is %u, should be %u", length,
604 service_type = tvb_get_guint8(tvb, offset);
605 switch (service_type) {
607 case WCCP2_SERVICE_STANDARD:
608 proto_tree_add_text(info_tree, tvb, offset, 1,
609 "Service Type: Well-known service");
610 proto_tree_add_text(info_tree, tvb, offset+1, 1,
612 val_to_str(tvb_get_guint8(tvb, offset+1), service_id_vals,
613 "Unknown (0x%02X)"));
617 case WCCP2_SERVICE_DYNAMIC:
618 proto_tree_add_text(info_tree, tvb, offset, 1,
619 "Service Type: Dynamic service");
620 proto_tree_add_text(info_tree, tvb, offset+1, 1,
622 val_to_str(tvb_get_guint8(tvb, offset+1), service_id_vals,
623 "Unknown (0x%02X)"));
624 proto_tree_add_text(info_tree, tvb, offset+2, 1,
625 "Priority: %u", tvb_get_guint8(tvb, offset+2));
627 * XXX - does "IP protocol identifier" mean this is a
628 * protocol type of the sort you get in IP headers?
629 * If so, we should get a table of those from the
630 * IP dissector, and use that.
632 proto_tree_add_text(info_tree, tvb, offset+3, 1,
633 "Protocol: %u", tvb_get_guint8(tvb, offset+3)); /* IP protocol identifier */
637 proto_tree_add_text(info_tree, tvb, offset, 1,
638 "Service Type: Unknown (%u)", service_type);
643 flags = tvb_get_ntohl(tvb, offset);
644 tf = proto_tree_add_text(info_tree, tvb, offset, 4,
645 "Flags: 0x%08X", flags);
646 field_tree = proto_item_add_subtree(tf, ett_service_flags);
647 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
648 decode_boolean_bitfield(flags, WCCP2_SI_SRC_IP_HASH,
650 "Use source IP address in primary hash",
651 "Don't use source IP address in primary hash"));
652 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
653 decode_boolean_bitfield(flags, WCCP2_SI_DST_IP_HASH,
655 "Use destination IP address in primary hash",
656 "Don't use destination IP address in primary hash"));
657 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
658 decode_boolean_bitfield(flags, WCCP2_SI_SRC_PORT_HASH,
660 "Use source port in primary hash",
661 "Don't use source port in primary hash"));
662 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
663 decode_boolean_bitfield(flags, WCCP2_SI_DST_PORT_HASH,
665 "Use destination port in primary hash",
666 "Don't use destination port in primary hash"));
667 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
668 decode_boolean_bitfield(flags, WCCP2_SI_PORTS_DEFINED,
671 "Ports not defined"));
672 if (flags & WCCP2_SI_PORTS_DEFINED) {
673 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
674 decode_boolean_bitfield(flags, WCCP2_SI_PORTS_SOURCE,
676 "Ports refer to source port",
677 "Ports refer to destination port"));
679 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
680 decode_boolean_bitfield(flags, WCCP2_SI_SRC_IP_ALT_HASH,
682 "Use source IP address in secondary hash",
683 "Don't use source IP address in secondary hash"));
684 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
685 decode_boolean_bitfield(flags, WCCP2_SI_DST_IP_ALT_HASH,
687 "Use destination IP address in secondary hash",
688 "Don't use destination IP address in secondary hash"));
689 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
690 decode_boolean_bitfield(flags, WCCP2_SI_SRC_PORT_ALT_HASH,
692 "Use source port in secondary hash",
693 "Don't use source port in secondary hash"));
694 proto_tree_add_text(field_tree, tvb, offset, 4, "%s",
695 decode_boolean_bitfield(flags, WCCP2_SI_DST_PORT_ALT_HASH,
697 "Use destination port in secondary hash",
698 "Don't use destination port in secondary hash"));
701 if (flags & WCCP2_SI_PORTS_DEFINED) {
702 for (i = 0; i < 8; i++) {
703 proto_tree_add_text(info_tree, tvb, offset, 2,
704 "Port %d: %u", i, tvb_get_ntohs(tvb, offset));
712 #define ROUTER_ID_INFO_MIN_LEN (8+4+4)
715 dissect_wccp2_router_identity_element(tvbuff_t *tvb, int offset,
718 proto_tree_add_text(tree, tvb, offset, 4,
719 "IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
720 proto_tree_add_text(tree, tvb, offset + 4, 4,
721 "Receive ID: %u", tvb_get_ntohl(tvb, offset + 4));
725 dissect_wccp2_router_identity_info(tvbuff_t *tvb, int offset, int length,
726 proto_tree *info_tree)
728 guint32 n_received_from;
731 proto_tree *element_tree;
733 if (length < ROUTER_ID_INFO_MIN_LEN) {
734 proto_tree_add_text(info_tree, tvb, offset, 0,
735 "Item length is %u, should be >= %u", length,
736 ROUTER_ID_INFO_MIN_LEN);
740 te = proto_tree_add_text(info_tree, tvb, offset, 8,
741 "Router Identity Element: IP address %s",
742 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
743 element_tree = proto_item_add_subtree(te,
744 ett_router_identity_element);
745 dissect_wccp2_router_identity_element(tvb, offset, element_tree);
748 proto_tree_add_text(info_tree, tvb, offset, 4,
749 "Sent To IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
752 n_received_from = tvb_get_ntohl(tvb, offset);
753 proto_tree_add_text(info_tree, tvb, offset, 4,
754 "Number of Received From IP addresses: %u", n_received_from);
757 for (i = 0; i < n_received_from; i++) {
758 proto_tree_add_text(info_tree, tvb, offset, 4,
759 "Received From IP Address %d: %s", i,
760 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
767 #define WC_ID_INFO_LEN (4+4+8*4+4)
770 dissect_wccp2_web_cache_identity_element(tvbuff_t *tvb, int offset,
773 proto_item *bucket_item;
774 proto_tree *bucket_tree;
776 proto_tree *field_tree;
782 proto_tree_add_text(tree, tvb, offset, 4,
783 "Web-Cache IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
786 proto_tree_add_text(tree, tvb, offset, 2,
787 "Hash Revision %u", tvb_get_ntohs(tvb, offset));
790 flags = tvb_get_ntohs(tvb, offset);
791 tf = proto_tree_add_text(tree, tvb, offset, 2,
792 "Flags: 0x%04X (%s)", flags,
794 "Hash information is historical" :
795 "Hash information is current"));
796 field_tree = proto_item_add_subtree(tf, ett_flags);
797 proto_tree_add_text(field_tree, tvb, offset, 2, "%s",
798 decode_boolean_bitfield(flags, 0x8000,
800 "Hash information is historical",
801 "Hash information is current"));
804 bucket_item = proto_tree_add_text(tree, tvb, offset, 8*4,
806 bucket_tree = proto_item_add_subtree(bucket_item, ett_buckets);
807 for (i = 0, n = 0; i < 32; i++) {
808 bucket_info = tvb_get_guint8(tvb, offset);
809 n = wccp_bucket_info(bucket_info, bucket_tree, n, tvb, offset);
813 proto_tree_add_text(tree, tvb, offset, 2,
814 "Assignment Weight: %u", tvb_get_ntohs(tvb, offset));
817 proto_tree_add_text(tree, tvb, offset, 2,
818 "Status: 0x%04X", tvb_get_ntohs(tvb, offset));
824 dissect_wccp2_wc_identity_info(tvbuff_t *tvb, int offset, int length,
825 proto_tree *info_tree)
828 proto_tree *element_tree;
830 if (length != WC_ID_INFO_LEN) {
831 proto_tree_add_text(info_tree, tvb, offset, 0,
832 "Item length is %u, should be %u", length, WC_ID_INFO_LEN);
836 te = proto_tree_add_text(info_tree, tvb, offset, 4+2+2+32+2+2,
837 "Web-Cache Identity Element: IP address %s",
838 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
839 element_tree = proto_item_add_subtree(te, ett_wc_identity_element);
840 if (!dissect_wccp2_web_cache_identity_element(tvb, offset,
842 return FALSE; /* ran out of data */
847 #define ROUTER_VIEW_INFO_MIN_LEN (4+8+4)
850 dissect_wccp2_assignment_key(tvbuff_t *tvb, int offset,
851 proto_tree *info_tree)
853 proto_tree_add_text(info_tree, tvb, offset, 4,
854 "Assignment Key IP Address: %s",
855 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
856 proto_tree_add_text(info_tree, tvb, offset + 4, 4,
857 "Assignment Key Change Number: %u", tvb_get_ntohl(tvb, offset + 4));
861 dissect_wccp2_router_view_info(tvbuff_t *tvb, int offset, int length,
862 proto_tree *info_tree)
865 guint32 n_web_caches;
868 proto_tree *element_tree;
870 if (length < ROUTER_VIEW_INFO_MIN_LEN) {
871 proto_tree_add_text(info_tree, tvb, offset, 0,
872 "Item length is %u, should be >= %u", length,
873 ROUTER_VIEW_INFO_MIN_LEN);
877 proto_tree_add_text(info_tree, tvb, offset, 4,
878 "Member Change Number: %u", tvb_get_ntohl(tvb, offset));
881 dissect_wccp2_assignment_key(tvb, offset, info_tree);
884 n_routers = tvb_get_ntohl(tvb, offset);
885 proto_tree_add_text(info_tree, tvb, offset, 4,
886 "Number of Routers: %u", n_routers);
889 for (i = 0; i < n_routers; i++) {
890 proto_tree_add_text(info_tree, tvb, offset, 4,
891 "Router %d IP Address: %s", i,
892 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
896 n_web_caches = tvb_get_ntohl(tvb, offset);
897 proto_tree_add_text(info_tree, tvb, offset, 4,
898 "Number of Web Caches: %u", n_web_caches);
901 for (i = 0; i < n_web_caches; i++) {
902 te = proto_tree_add_text(info_tree, tvb, offset, WC_ID_INFO_LEN,
903 "Web-Cache Identity Element %d: IP address %s", i,
904 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
905 element_tree = proto_item_add_subtree(te,
906 ett_wc_identity_element);
907 if (!dissect_wccp2_web_cache_identity_element(tvb,
908 offset, element_tree))
909 return FALSE; /* ran out of data */
910 offset += WC_ID_INFO_LEN;
916 #define WC_VIEW_INFO_MIN_LEN (4+4)
919 dissect_wccp2_wc_view_info(tvbuff_t *tvb, int offset, int length,
920 proto_tree *info_tree)
923 guint32 n_web_caches;
926 proto_tree *element_tree;
928 if (length < WC_VIEW_INFO_MIN_LEN) {
929 proto_tree_add_text(info_tree, tvb, offset, 0,
930 "Item length is %u, should be >= %u", length,
931 WC_VIEW_INFO_MIN_LEN);
935 proto_tree_add_text(info_tree, tvb, offset, 4,
936 "Change Number: %u", tvb_get_ntohl(tvb, offset));
939 n_routers = tvb_get_ntohl(tvb, offset);
940 proto_tree_add_text(info_tree, tvb, offset, 4,
941 "Number of Routers: %u", n_routers);
944 for (i = 0; i < n_routers; i++) {
945 te = proto_tree_add_text(info_tree, tvb, offset, 8,
946 "Router %d Identity Element: IP address %s", i,
947 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
948 element_tree = proto_item_add_subtree(te,
949 ett_router_identity_element);
950 dissect_wccp2_router_identity_element(tvb, offset, element_tree);
954 n_web_caches = tvb_get_ntohl(tvb, offset);
955 proto_tree_add_text(info_tree, tvb, offset, 4,
956 "Number of Web Caches: %u", n_web_caches);
959 for (i = 0; i < n_web_caches; i++) {
960 proto_tree_add_text(info_tree, tvb, offset, 4,
961 "Web-Cache %d: IP address %s", i,
962 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
969 #define ASSIGNMENT_INFO_MIN_LEN (8+4)
972 dissect_wccp2_router_assignment_element(tvbuff_t *tvb, int offset,
975 proto_tree_add_text(tree, tvb, offset, 4,
976 "IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
977 proto_tree_add_text(tree, tvb, offset + 4, 4,
978 "Receive ID: %u", tvb_get_ntohl(tvb, offset + 4));
979 proto_tree_add_text(tree, tvb, offset + 8, 4,
980 "Change Number: %u", tvb_get_ntohl(tvb, offset + 8));
984 assignment_bucket_name(guint8 bucket)
988 if (bucket == 0xff) {
992 g_snprintf(cur, 10+1, "%u%s", bucket >> 1,
993 (bucket & 0x01) ? " (Alt)" : "");
999 dissect_wccp2_assignment_info(tvbuff_t *tvb, int offset, int length,
1000 proto_tree *info_tree)
1003 guint32 n_web_caches;
1006 proto_tree *element_tree;
1008 if (length < ASSIGNMENT_INFO_MIN_LEN) {
1009 proto_tree_add_text(info_tree, tvb, offset, 0,
1010 "Item length is %u, should be >= %u", length,
1011 ASSIGNMENT_INFO_MIN_LEN);
1015 dissect_wccp2_assignment_key(tvb, offset, info_tree);
1018 n_routers = tvb_get_ntohl(tvb, offset);
1019 proto_tree_add_text(info_tree, tvb, offset, 4,
1020 "Number of Routers: %u", n_routers);
1023 for (i = 0; i < n_routers; i++) {
1024 te = proto_tree_add_text(info_tree, tvb, offset, 4,
1025 "Router %d Assignment Element: IP address %s", i,
1026 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1027 element_tree = proto_item_add_subtree(te,
1028 ett_router_assignment_element);
1029 dissect_wccp2_router_assignment_element(tvb, offset,
1034 n_web_caches = tvb_get_ntohl(tvb, offset);
1035 proto_tree_add_text(info_tree, tvb, offset, 4,
1036 "Number of Web Caches: %u", n_web_caches);
1039 for (i = 0; i < n_web_caches; i++) {
1040 proto_tree_add_text(info_tree, tvb, offset, 4,
1041 "Web-Cache %d: IP address %s", i,
1042 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1046 for (i = 0; i < 256; i += 4) {
1047 proto_tree_add_text(info_tree, tvb, offset, 4,
1048 "Buckets %d - %d: %10s %10s %10s %10s",
1050 assignment_bucket_name(tvb_get_guint8(tvb, offset)),
1051 assignment_bucket_name(tvb_get_guint8(tvb, offset+1)),
1052 assignment_bucket_name(tvb_get_guint8(tvb, offset+2)),
1053 assignment_bucket_name(tvb_get_guint8(tvb, offset+3)));
1060 #define QUERY_INFO_LEN (4+4+4+4)
1063 dissect_wccp2_router_query_info(tvbuff_t *tvb, int offset, int length,
1064 proto_tree *info_tree)
1066 if (length != QUERY_INFO_LEN) {
1067 proto_tree_add_text(info_tree, tvb, offset, 0,
1068 "Item length is %u, should be %u", length, QUERY_INFO_LEN);
1072 proto_tree_add_text(info_tree, tvb, offset, 4,
1073 "Router IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1076 proto_tree_add_text(info_tree, tvb, offset, 4,
1077 "Receive ID: %u", tvb_get_ntohl(tvb, offset));
1080 proto_tree_add_text(info_tree, tvb, offset, 4,
1081 "Sent To IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1084 proto_tree_add_text(info_tree, tvb, offset, 4,
1085 "Target IP Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1090 #define WCCP2_FORWARDING_METHOD 0x01
1091 #define WCCP2_ASSIGNMENT_METHOD 0x02
1092 #define WCCP2_PACKET_RETURN_METHOD 0x03
1094 static const value_string capability_type_vals[] = {
1095 { WCCP2_FORWARDING_METHOD, "Forwarding Method" },
1096 { WCCP2_ASSIGNMENT_METHOD, "Assignment Method" },
1097 { WCCP2_PACKET_RETURN_METHOD, "Return Method" },
1101 #define WCCP2_FORWARDING_METHOD_GRE 0x00000001
1102 #define WCCP2_FORWARDING_METHOD_L2 0x00000002
1104 static const capability_flag forwarding_method_flags[] = {
1105 { WCCP2_FORWARDING_METHOD_GRE,
1106 "IP-GRE", "GRE-encapsulated" },
1107 { WCCP2_FORWARDING_METHOD_L2,
1108 "L2", "L2 rewrite" },
1113 #define WCCP2_ASSIGNMENT_METHOD_HASH 0x00000001
1114 #define WCCP2_ASSIGNMENT_METHOD_MASK 0x00000002
1116 static const capability_flag assignment_method_flags[] = {
1117 { WCCP2_ASSIGNMENT_METHOD_HASH, "Hash", "Hash" },
1118 { WCCP2_ASSIGNMENT_METHOD_MASK, "Mask", "Mask" },
1122 #define WCCP2_PACKET_RETURN_METHOD_GRE 0x00000001
1123 #define WCCP2_PACKET_RETURN_METHOD_L2 0x00000002
1125 static const capability_flag packet_return_method_flags[] = {
1126 { WCCP2_PACKET_RETURN_METHOD_GRE,
1127 "IP-GRE", "GRE-encapsulated" },
1128 { WCCP2_PACKET_RETURN_METHOD_L2,
1129 "L2", "L2 rewrite" },
1135 dissect_wccp2_capability_info(tvbuff_t *tvb, int offset, int length,
1136 proto_tree *info_tree)
1138 guint16 capability_type;
1139 guint16 capability_val_len;
1142 proto_tree *element_tree;
1144 for (curr_offset = offset; curr_offset < (length + offset);
1145 curr_offset += (capability_val_len + 4)) {
1146 capability_type = tvb_get_ntohs(tvb, curr_offset);
1147 capability_val_len = tvb_get_ntohs(tvb, curr_offset + 2);
1148 te = proto_tree_add_text(info_tree, tvb, curr_offset,
1149 capability_val_len + 4, "%s",
1150 val_to_str(capability_type,
1151 capability_type_vals, "Unknown Capability Element (0x%08X)"));
1152 element_tree = proto_item_add_subtree(te,
1153 ett_capability_element);
1155 proto_tree_add_text(element_tree, tvb, curr_offset, 2,
1157 val_to_str(capability_type,
1158 capability_type_vals, "Unknown (0x%08X)"));
1160 if (capability_val_len < 4) {
1161 proto_tree_add_text(element_tree, tvb, curr_offset+2, 2,
1162 "Value Length: %u (illegal, must be >= 4)",
1163 capability_val_len);
1166 proto_tree_add_text(element_tree, tvb, curr_offset+2, 2,
1167 "Value Length: %u", capability_val_len);
1169 switch (capability_type) {
1171 case WCCP2_FORWARDING_METHOD:
1172 dissect_32_bit_capability_flags(tvb, curr_offset,
1174 ett_capability_forwarding_method,
1175 forwarding_method_flags, element_tree);
1178 case WCCP2_ASSIGNMENT_METHOD:
1179 dissect_32_bit_capability_flags(tvb, curr_offset,
1181 ett_capability_assignment_method,
1182 assignment_method_flags, element_tree);
1185 case WCCP2_PACKET_RETURN_METHOD:
1186 dissect_32_bit_capability_flags(tvb, curr_offset,
1188 ett_capability_return_method,
1189 packet_return_method_flags, element_tree);
1193 proto_tree_add_text(element_tree, tvb,
1194 curr_offset+4, capability_val_len,
1196 tvb_bytes_to_str(tvb, curr_offset+4,
1197 capability_val_len));
1206 dissect_32_bit_capability_flags(tvbuff_t *tvb, int curr_offset,
1207 guint16 capability_val_len, gint ett, const capability_flag *flags,
1208 proto_tree *element_tree)
1210 guint32 capability_val;
1212 proto_tree *method_tree;
1216 gint returned_length, str_index = 0;
1219 if (capability_val_len != 4) {
1220 proto_tree_add_text(element_tree, tvb,
1221 curr_offset+4, capability_val_len,
1222 "Illegal length (must be 4)");
1226 capability_val = tvb_get_ntohl(tvb, curr_offset + 4);
1227 #define FLAGS_STRING_LEN (128+1)
1228 flags_string=ep_alloc(FLAGS_STRING_LEN);
1229 flags_string[0] = 0;
1230 for (i = 0; flags[i].short_name != NULL; i++) {
1231 if (capability_val & flags[i].value) {
1232 if (str_index != 0) {
1233 returned_length = g_snprintf(&flags_string[str_index],
1234 FLAGS_STRING_LEN-str_index, ",");
1235 str_index += MIN(returned_length, FLAGS_STRING_LEN-str_index);
1237 returned_length = g_snprintf(&flags_string[str_index],
1238 FLAGS_STRING_LEN-str_index, "%s", flags[i].short_name);
1239 str_index += MIN(returned_length, FLAGS_STRING_LEN-str_index);
1242 tm = proto_tree_add_text(element_tree, tvb, curr_offset+4, 4,
1243 "Value: 0x%08X (%s)", capability_val, flags_string);
1245 method_tree = proto_item_add_subtree(tm, ett);
1246 #define BUF_SIZE 1024
1247 buf=ep_alloc(BUF_SIZE);
1249 for (i = 0; flags[i].long_name != NULL; i++) {
1250 p = decode_bitfield_value(buf, capability_val,
1251 flags[i].value, 32);
1252 str_index = MIN((gint)(p-buf), BUF_SIZE);
1253 returned_length = g_snprintf(&flags_string[str_index], BUF_SIZE-str_index,
1254 "%s: %s", flags[i].long_name,
1255 (capability_val & flags[i].value)?
1259 str_index += MIN(returned_length, BUF_SIZE-str_index);
1260 proto_tree_add_text(method_tree, tvb, curr_offset+4, 4,
1265 #define ALT_ASSIGNMENT_INFO_MIN_LEN (4+4)
1267 #define WCCP2_HASH_ASSIGNMENT_TYPE 0x0000
1268 #define WCCP2_MASK_ASSIGNMENT_TYPE 0x0001
1270 static const value_string assignment_type_vals[] = {
1271 { WCCP2_HASH_ASSIGNMENT_TYPE, "Hash" },
1272 { WCCP2_MASK_ASSIGNMENT_TYPE, "Mask" },
1277 dissect_wccp2_value_element(tvbuff_t *tvb, int offset, int index, proto_tree *info_tree)
1280 proto_tree *element_tree;
1282 tl = proto_tree_add_text(info_tree, tvb, offset, 16, "Value Element(%u)", index);
1283 element_tree = proto_item_add_subtree(tl, ett_value_element);
1285 proto_tree_add_text(element_tree, tvb, offset, 4, "Source Address value: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1287 proto_tree_add_text(element_tree, tvb, offset, 4, "Destination Address value: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1289 proto_tree_add_text(element_tree, tvb, offset, 2, "Source Port value: %u", tvb_get_ntohs(tvb, offset));
1291 proto_tree_add_text(element_tree, tvb, offset, 2, "Source Port value: %u", tvb_get_ntohs(tvb, offset));
1293 proto_tree_add_text(element_tree, tvb, offset, 4, "Web Cache Address: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1297 dissect_wccp2_mask_value_set_element(tvbuff_t *tvb, int offset, int index, proto_tree *info_tree)
1300 proto_tree *element_tree;
1301 guint num_of_val_elements;
1304 tl = proto_tree_add_text(info_tree, tvb, offset, 0,
1305 "Mask/Value Set Element(%d)", index);
1306 element_tree = proto_item_add_subtree(tl, ett_mv_set_element);
1308 proto_tree_add_text(element_tree, tvb, offset, 4, "Source Address Mask: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1310 proto_tree_add_text(element_tree, tvb, offset, 4, "Destination Address Mask: %s", ip_to_str(tvb_get_ptr(tvb, offset, 4)));
1312 proto_tree_add_text(element_tree, tvb, offset, 2, "Source Port Mask: %04x", tvb_get_ntohs(tvb, offset));
1314 proto_tree_add_text(element_tree, tvb, offset, 2, "Destination Port Mask: %04x", tvb_get_ntohs(tvb, offset));
1317 proto_tree_add_text(element_tree, tvb, offset, 4, "Number of Value Elements: %u", tvb_get_ntohl(tvb, offset));
1318 num_of_val_elements = tvb_get_ntohl(tvb, offset);
1321 for (i = 0; i < num_of_val_elements; i++)
1323 dissect_wccp2_value_element(tvb, offset, i, element_tree);
1327 proto_item_set_len(tl, 16+i*16);
1333 dissect_wccp2_alt_assignment_info(tvbuff_t *tvb, int offset, int length,
1334 proto_tree *info_tree)
1336 guint16 assignment_type;
1337 guint16 assignment_length;
1339 if (length < ALT_ASSIGNMENT_INFO_MIN_LEN) {
1340 proto_tree_add_text(info_tree, tvb, offset, 0,
1341 "Item length is %u, should be >= %u", length,
1342 ALT_ASSIGNMENT_INFO_MIN_LEN);
1346 assignment_type = tvb_get_ntohs(tvb, offset);
1347 proto_tree_add_text(info_tree, tvb, offset, 2,
1348 "Assignment type: %s", val_to_str(assignment_type,
1349 assignment_type_vals, "Unknown assignment type (%u)"));
1352 assignment_length = tvb_get_ntohs(tvb, offset);
1353 proto_tree_add_text(info_tree, tvb, offset, 2,
1354 "Assignment length: %u", assignment_length);
1357 switch (assignment_type) {
1358 case WCCP2_HASH_ASSIGNMENT_TYPE:
1359 dissect_wccp2_assignment_info(tvb, offset, assignment_length, info_tree);
1362 case WCCP2_MASK_ASSIGNMENT_TYPE:
1368 dissect_wccp2_assignment_key(tvb, offset, info_tree);
1371 num_of_rtr = tvb_get_ntohl(tvb, offset);
1372 proto_tree_add_text(info_tree, tvb, offset, 4, "Number of routers: %u", num_of_rtr);
1374 for (i = 0; i < num_of_rtr; i++)
1376 dissect_wccp2_router_assignment_element(tvb, offset, info_tree);
1380 num_of_elem = tvb_get_ntohl(tvb, offset);
1381 proto_tree_add_text(info_tree, tvb, offset, 4, "Number of elements: %u", num_of_elem);
1383 for (i = 0; i < num_of_elem; i++)
1385 offset += dissect_wccp2_mask_value_set_element(tvb, offset, i, info_tree);
1398 proto_register_wccp(void)
1400 static hf_register_info hf[] = {
1401 { &hf_wccp_message_type,
1402 { "WCCP Message Type", "wccp.message", FT_UINT32, BASE_DEC, VALS(wccp_type_vals), 0x0,
1403 "The WCCP message that was sent", HFILL }
1406 { "WCCP Version", "wccp.version", FT_UINT32, BASE_HEX, VALS(wccp_version_val), 0x0,
1407 "The WCCP version", HFILL }
1409 { &hf_hash_revision,
1410 { "Hash Revision", "wccp.hash_revision", FT_UINT32, BASE_DEC, 0x0, 0x0,
1411 "The cache hash revision", HFILL }
1414 { "Change Number", "wccp.change_num", FT_UINT32, BASE_DEC, 0x0, 0x0,
1415 "The Web-Cache list entry change number", HFILL }
1418 { "Received ID", "wccp.recvd_id", FT_UINT32, BASE_DEC, 0x0, 0x0,
1419 "The number of I_SEE_YOU's that have been sent", HFILL }
1422 { "Web Cache IP address", "wccp.cache_ip", FT_IPv4, BASE_NONE, NULL, 0x0,
1423 "The IP address of a Web cache", HFILL }
1426 static gint *ett[] = {
1435 &ett_router_identity_element,
1436 &ett_router_identity_info,
1437 &ett_wc_identity_element,
1438 &ett_wc_identity_info,
1439 &ett_router_view_info,
1442 &ett_router_assignment_element,
1443 &ett_router_assignment_info,
1444 &ett_capabilities_info,
1445 &ett_capability_element,
1446 &ett_capability_forwarding_method,
1447 &ett_capability_assignment_method,
1448 &ett_capability_return_method,
1449 &ett_mv_set_element,
1451 &ett_alt_assignment_info,
1455 proto_wccp = proto_register_protocol("Web Cache Coordination Protocol",
1457 proto_register_field_array(proto_wccp, hf, array_length(hf));
1458 proto_register_subtree_array(ett, array_length(ett));
1462 proto_reg_handoff_wccp(void)
1464 dissector_handle_t wccp_handle;
1466 wccp_handle = new_create_dissector_handle(dissect_wccp, proto_wccp);
1467 dissector_add("udp.port", UDP_PORT_WCCP, wccp_handle);