625c93c1c9a8ac5a62b13f91176dff09909e9e6f
[obnox/wireshark/wip.git] / epan / dissectors / packet-wlccp.c
1 /* packet-wlccp.c
2  * Routines for Cisco Wireless LAN Context Control Protocol dissection
3  *
4  * Copyright 2005, Joerg Mayer (see AUTHORS file)
5  * Copyright 2006, Stephen Fisher (see AUTHORS file)
6  * Copyright 2007, Kevin A. Noll <maillistnoll@earthlink.net>
7  *
8  * $Id$
9  *
10  * Wireshark - Network traffic analyzer
11  * By Gerald Combs <gerald@wireshark.org>
12  * Copyright 1998 Gerald Combs
13  *
14  * The CISCOWL dissector was merged into this one.
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
29  */
30
31 /* Version 0x00 was reverse engineered */
32 /* Version 0xC1 Protocol reference: US Patent Application 0050220054 */
33 /* and considerable reverse engineering due to the patent application*/
34 /* being incomplete                                                  */
35
36 /* More clues to version 0x00 of the protocol:
37  *
38  * Header (Eth V2 or SNAP)
39  * Length (2 bytes)
40  * Type (2 bytes)
41  *      0202: Unknown, Length 36 (14 + 20 + 2)
42  *      4001: Unknown, Length 48 (14 + 32 + 2)
43  *      4601: Unknown, Length 34 (14 + 18 + 2)
44  *      4081 on Eth V2: Name, Version Length 84 (14 + 48 + 20 + 2)
45  *      4081 on 802.3: Name Length 72 (14 + 56 + 2)
46  * Dst MAC (6 bytes)
47  * Src MAC (6 bytes)
48  * Unknown1 (2 bytes)  Unknown19 + Unknown2 may be a MAC address on type 0202
49  * Unknown2 (4 bytes)   see Unknown19
50  * 0 (17 bytes)
51  * Device IP (4 bytes)
52  * 0 (2 bytes)
53  * Device name (8 bytes)
54  * 0 (20 bytes)
55  * Unknown3 (2 bytes)
56  * Unknown4 (4 bytes)
57  * Version string (10 bytes)
58  * 0 (4 bytes)
59  * 0 (2 bytes)
60  */
61
62 #ifdef HAVE_CONFIG_H
63 # include "config.h"
64 #endif
65
66 #include <stdlib.h>
67
68 #include <glib.h>
69
70 #include <epan/packet.h>
71 #include <epan/etypes.h>
72 #include <epan/oui.h>
73 #include "packet-llc.h"
74
75
76 /* The UDP port that WLCCP is expected to ride on */
77 /* WLCCP also uses an LLC OUI type and an ethertype */
78 #define WLCCP_UDP_PORT 2887
79
80
81 /* SAP is 2-bit version and 6-bit Type */
82 #define SAP_VERSION_MASK (0xC0)
83 #define SAP_VALUE_MASK (0x3f)
84
85 static const value_string wlccp_sap_vs[] = {
86         { 0x0, "Context Management"        },
87         { 0x1, "Security"                  },
88         { 0x2, "Radio Resource Management" },
89         { 0x3, "QOS"                       },
90         { 0x4, "Network Management"        },
91         { 0x5, "MIP"                       },
92         { 0, NULL                          }
93 };
94
95 #define WLCCP_SAP_CCM (0x00)
96 #define WLCCP_SAP_SEC (0x01)
97 #define WLCCP_SAP_RRM (0x02)
98 #define WLCCP_SAP_QOS (0x03)
99 #define WLCCP_SAP_NM  (0x04)
100 #define WLCCP_SAP_MIP (0x05)
101
102 static const value_string wlccp_node_type_vs[] = {
103         { 0x00, "None"                          },
104         { 0x01, "Access Point (AP)"             },
105         { 0x02, "Subnet Context Manager (SCM)"  },
106         { 0x04, "Local Context Manager (LCM)"   },
107         { 0x08, "Campus Context Manager (CCM)"  },
108         { 0x10, "Infrastructure (ICN)"          },
109         { 0x40, "Client"                        },
110 /*      { 0x8000, "Multi Mask?"             }, */
111         { 0, NULL                               }
112 };
113
114 /* The Message Type field contains a 2-bit Sub-Type and a 6-bit Base Message Type */
115 #define MT_SUBTYPE         (0xC0)
116 #define MT_BASE_MSG_TYPE   (0x3F)
117
118 static const value_string wlccp_subtype_vs[] = {
119         { 0x0, "Request" },
120         { 0x1, "Reply"   },
121         { 0x2, "Confirm" },
122         { 0x3, "Ack"     },
123         { 0, NULL      }
124 };
125
126 /* The Message Type definitions are a combination of the SAP and the Type_ID    */
127 /* fields. These mappings are not well documented and have been gathered from a */
128 /* combination of the WLCCP patent application, experimentation, and WLCCP      */
129 /* device logs.                                                                 */
130
131 /* For SAP=0 */
132 static const value_string wlccp_msg_type_vs_0[] = {
133         { 0x1, "SCM Advertise"                  },
134         { 0x2, "CCM Advertise"                  },
135         { 0x3, "Registration"                   },
136         { 0x4, "DeRegistration"                 },
137         { 0x5, "Detach"                         },
138         { 0x6, "Context"                        },
139         { 0x7, "Path Update"                    },
140         { 0x8, "Path Check"                     },
141         { 0x9, "PreRegistration"                },
142         { 0x0a, "Trace"                         },
143         { 0x0b, "cmAAA EAP Authent"             },
144         { 0x0c, "cmPathInit Path Authent"       },
145         { 0x0f, "cmWIDS"                        },
146         { 0, NULL                               }
147
148 };
149
150 /* For SAP=1 */
151 static const value_string wlccp_msg_type_vs_1[] = {
152 /*      { 0x1, "Unknown"                        }, */
153         { 0, NULL                               }
154
155 };
156
157 /* For SAP=2 */
158 static const value_string wlccp_msg_type_vs_2[] = {
159         { 0x1, "rmReq"                          },
160         { 0x2, "rmReqRoutingResp"               },
161         { 0x3, "rmReport"                       },
162         { 0, NULL                               }
163
164 };
165
166 /* For SAP=3 */
167 static const value_string wlccp_msg_type_vs_3[] = {
168 /*      { 0x1, "Unknown"                        }, */
169         { 0, NULL                               }
170
171 };
172
173 /* For SAP=4 */
174 static const value_string wlccp_msg_type_vs_4[] = {
175         { 0x01, "nmAck"                         },
176         { 0x10, "nmConfigRequest"               },
177         { 0x11, "nmConfigReply"                 },
178         { 0x20, "nmApRegistration"              },
179         { 0x21, "nmScmStateChange"              },
180         { 0x22, "nmScmKeepActive"               },
181         { 0x30, "nmClientEventReport"           },
182         { 0x31, "nmAllClientRefreshRequest"     },
183         { 0, NULL                               }
184
185 };
186
187 /* For SAP=5 */
188 static const value_string wlccp_msg_type_vs_5[] = {
189 /*      { 0x1, "Unknown"                        }, */
190         { 0, NULL                               }
191
192 };
193
194
195 /* Mask definitions for the CM Flags field */
196 #define F_RETRY            (1<<15)
197 #define F_RESPONSE_REQUEST (1<<14)
198 #define F_TLV              (1<<13)
199 #define F_INBOUND          (1<<12)
200 #define F_OUTBOUND         (1<<11)
201 #define F_HOPWISE_ROUTING  (1<<10)
202 #define F_ROOT_CM          (1<<9)
203 #define F_RELAY            (1<<8)
204 #define F_MIC              (1<<7)
205
206 /* Mask definitions for the RM Flags field */
207 #define RM_F_REQUEST_REPLY    (1<<0)
208 #define RM_F_MIC              (1<<1)
209
210 /* Mask definitions for the NM Flags field */
211 /* the NM flags are the same as the CM flags except there is no
212 INBOUND, OUTBOUND, HOPWISE_ROUTING, ROOT_CM, or RELAY flag, and
213 the RESPONSE_REQUEST flag is renamed ACK_REQD
214 */
215 #define F_ACK_REQD         (1<<14)
216
217
218 /* Mask definitions for the SCM Flags field */
219 #define F_SCM_LAYER2UPDATE      (1<<3)
220 #define F_SCM_UNATTACHED        (1<<2)
221 #define F_SCM_UNSCHEDULED       (1<<1)
222 #define F_SCM_ACTIVE            (1<<0)
223
224 /* Mask definitions for the SCM Priority Flags field */
225 #define F_SCM_PRIORITY  0xfe
226 #define F_SCM_PREFERRED         0x01
227
228 /* Mask definitions for the SCM Bridge Priority Flags field */
229 #define F_SCM_BRIDGE_PRIORITY   0xfe
230 #define F_SCM_BRIDGE_DISABLE    0x01
231
232 /* The TLV Type definitions are a combination of the TLV Group and the       */
233 /* TLV Type ID fields. These mappings are not well documented and have been  */
234 /* gathered from a combination of the WLCCP patent application,              */
235 /* experimentation, and WLCCP device logs                                    */
236
237 /* The TLV Group/Type Field contains some flags and the Group ID and Type ID */
238 #define TLV_F_CONTAINER         (0x8000)
239 #define TLV_F_ENCRYPTED         (0x4000)
240 #define TLV_F_RESVD             (0x3000)
241 #define TLV_F_RESVD2            (0x2000)
242 #define TLV_F_RESVD3            (0x1000)
243 #define TLV_F_REQUEST           (0x0080)
244 #define TLV_GROUP_ID            (0x0F00)
245 #define TLV_TYPE_ID             (0x007F)
246
247 static const value_string wlccp_tlv_group_vs[] = {
248         { 0x0, "WLCCP Group"                    },
249         { 0x1, "Security Group"                 },
250         { 0x2, "RRM Group"                      },
251         { 0x3, "QOS Group"                      },
252         { 0x4, "NM Group"                       },
253         { 0x5, "MIP Group"                      },
254         { 0, NULL                               }
255 };
256
257
258 #define WLCCP_TLV_GROUP_WLCCP (0x00)
259 #define WLCCP_TLV_GROUP_SEC (0x01)
260 #define WLCCP_TLV_GROUP_RRM (0x02)
261 #define WLCCP_TLV_GROUP_QOS (0x03)
262 #define WLCCP_TLV_GROUP_NM  (0x04)
263 #define WLCCP_TLV_GROUP_MIP (0x05)
264
265 /* Group 0 */
266 static const value_string wlccp_tlv_typeID_0[] = {
267         { 0x00, "NULL TLV"                              },
268         { 0x09, "ipv4Address"                           },
269         { 0x01, "Container"                             },
270         { 0x02, "AP Port Info"                          },
271         { 0x03, "ipv4 Subnet ID"                        },
272         { 0x04, "Secondary LAN Address List"            },
273         { 0x05, "Multicast Ethernet Address List"       },
274         { 0x06, "ipv4 Multicast Address List"           },
275         { 0x07, "AP Port List"                          },
276         { 0x08, "Requestor SSID"                        },
277         { 0, NULL                                       }
278 };
279
280 /* Group 1 */
281 static const value_string wlccp_tlv_typeID_1[] = {
282         { 0x01, "initSession"                           },
283         { 0x02, "inSecureContextReq"                    },
284         { 0x06, "authenticator"                         },
285         { 0x08, "mic"                                   },
286         { 0x0a, "inSecureContextReply"                  },
287         { 0, NULL                                       }
288 };
289
290 /* Group 2 */
291 static const value_string wlccp_tlv_typeID_2[] = {
292         { 0x03, "rmReport"                              },
293         { 0x04, "aggrRmReport"                          },
294         { 0x15, "frameReport"                           },
295         { 0x17, "ccaReport"                             },
296         { 0x19, "rpiHistReport"                         },
297         { 0x1e, "commonBeaconReport"                    },
298         { 0x1f, "aggrBeaconReport"                      },
299         { 0x5b, "mfpRouting"                            },
300         { 0x5c, "mfpConfig"                             },
301         { 0, NULL                                       }
302 };
303
304 /* Group 3 */
305 static const value_string wlccp_tlv_typeID_3[] = {
306 /*      { 0x01, "Unknown"                               } */
307         { 0, NULL                                       },
308 };
309
310 /* Group 4 */
311 static const value_string wlccp_tlv_typeID_4[] = {
312 /*      { 0x01, "Unknown"                               } */
313         { 0, NULL                                       },
314 };
315
316 /* Group 5 */
317 static const value_string wlccp_tlv_typeID_5[] = {
318 /*      { 0x01, "Unknown"                               } */
319         { 0, NULL                                       },
320 };
321
322
323
324
325
326 static const value_string wlccp_aaa_msg_type_vs[] = {
327         { 0x0, "Start"                          },
328         { 0x1, "Finish"                         },
329         { 0x2, "EAPOL"                          },
330         { 0x3, "Cisco Accounting"               },
331         { 0, NULL                               }
332 };
333
334 static const value_string wlccp_eapol_auth_type_vs[] = {
335         { 0x0, "EAP Only"                       },
336         { 0x1, "MAC Only"                       },
337         { 0x2, "MAC then EAP"                   },
338         { 0x3, "MAC and EAP"                    },
339         { 0x4, "LEAP only"                      },
340         { 0x5, "MAC then LEAP"                  },
341         { 0x6, "MAC and LEAP"                   },
342         { 0, NULL                               }
343 };
344
345 static const value_string wlccp_key_mgmt_type_vs[] = {
346         { 0x0, "None"                           },
347         { 0x1, "CCKM"                           },
348         { 0x2, "Legacy 802.1x"                  },
349         { 0x3, "SSN/TGi"                        },
350         { 0, NULL                               }
351 };
352
353 static const value_string eapol_type_vs[] = {
354         { 0x0, "EAP Packet"                     },
355         { 0x1, "EAP Start"                      },
356         { 0x2, "Unknown"                        },
357         { 0x3, "Key"                            },
358         { 0, NULL                               }
359
360 };
361
362 static const value_string wlccp_status_vs[] = {
363         {0, "Success"                           },
364         { 0, NULL                               }
365 };
366
367 static const value_string cisco_pid_vals[] = {
368         { 0x0000, "WLCCP" },
369         { 0, NULL         }
370 };
371
372 static const value_string wlccp_mode_vs[] = {
373         { 0x0,          "apSelected"    },
374         {0x01,          "series"        },
375         {0x3,           "parallel"      },
376         {0, NULL                        }
377 };
378
379
380 static const value_string phy_type_80211_vs[] = {
381         { 0x01,         "FHSS 2.4 GHz"          },
382         { 0x02,         "DSSS 2.4 GHz"          },
383         { 0x03,         "IR Baseband"           },
384         { 0x04,         "OFDM 5GHz"             },
385         { 0x05,         "HRDSSS"                },
386         { 0x06,         "ERP"                   },
387         { 0, NULL                               }
388 };
389
390
391 /* 802.11 capabilities flags */
392 #define F_80211_ESS             0x0001
393 #define F_80211_IBSS            0x0002
394 #define F_80211_CFPOLL          0x0004
395 #define F_80211_CFPOLL_REQ      0x0008
396 #define F_80211_PRIVACY         0x0010
397 #define F_80211_SHORT_PREAMBLE  0x0020
398 #define F_80211_PBCC            0x0040
399 #define F_80211_CH_AGILITY      0x0080
400 #define F_80211_SPEC_MGMT       0x0100
401 #define F_80211_QOS             0x0200
402 #define F_80211_SHORT_TIME_SLOT 0x0400
403 #define F_80211_APSD            0x0800
404 #define F_80211_RESVD           0x1000
405 #define F_80211_DSSS_OFDM       0x2000
406 #define F_80211_DLYD_BLK_ACK    0x4000
407 #define F_80211_IMM_BLK_ACK     0x8000
408
409
410
411
412 /*
413 struct subdissector_returns_t
414 {
415         static int consumed
416         static gboolean mic_flag;
417         static gboolean tlv_flag;
418 }; * struct flags_t declaration *
419 */
420
421
422
423 /* Forward declarations we need below */
424 static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
425 static guint dissect_wlccp_sec_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
426 static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
427 static guint dissect_wlccp_qos_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
428 static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
429 static guint dissect_wlccp_mip_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type);
430
431 static guint dissect_wlccp_tlvs(proto_tree *_tree, tvbuff_t *tvb, guint tlv_offset, guint _depth);
432
433 static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
434 static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
435 static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
436 static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
437 static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
438 static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti);
439
440 static void set_mic_flag(gboolean flag);
441 static void set_tlv_flag(gboolean flag);
442 static gboolean get_tlv_flag(void);
443 static gboolean get_mic_flag(void);
444
445 /* Initialize some utlity variables */
446 static gboolean mic_flag=0, tlv_flag=0;
447
448 /* Initialize the protocol and registered fields */
449 static int proto_wlccp = -1;
450
451 static int hf_llc_wlccp_pid = -1;
452
453
454
455 static int hf_wlccp_dstmac = -1;
456 static int hf_wlccp_srcmac = -1;
457 static int hf_wlccp_hostname = -1;
458
459 /* WLCCP Fixed header fields */
460 static int hf_wlccp_version = -1;
461
462 static int hf_wlccp_sap = -1; /* SAP Tree */
463 static int hf_wlccp_sap_version = -1;
464 static int hf_wlccp_sap_id = -1;
465
466 static int hf_wlccp_destination_node_type = -1;
467 static int hf_wlccp_length = -1;
468
469 static int hf_wlccp_type = -1; /* Message Type Tree */
470 static int hf_wlccp_subtype = -1;
471 static int hf_wlccp_base_message_type_0 = -1;
472 static int hf_wlccp_base_message_type_1 = -1;
473 static int hf_wlccp_base_message_type_2 = -1;
474 static int hf_wlccp_base_message_type_3 = -1;
475 static int hf_wlccp_base_message_type_4 = -1;
476 static int hf_wlccp_base_message_type_5 = -1;
477 static int hf_wlccp_base_message_type_unknown = -1;
478
479 static int hf_wlccp_hops = -1;
480 static int hf_wlccp_nm_version = -1;
481
482 static int hf_wlccp_msg_id = -1;
483
484 static int hf_wlccp_flags = -1; /* Flags Tree */
485 static int hf_wlccp_rm_flags = -1;
486 static int hf_wlccp_retry_flag = -1;
487 static int hf_wlccp_response_request_flag = -1;
488 static int hf_wlccp_ack_required_flag = -1;
489 static int hf_wlccp_tlv_flag = -1;
490 static int hf_wlccp_inbound_flag = -1;
491 static int hf_wlccp_outbound_flag = -1;
492 static int hf_wlccp_hopwise_routing_flag = -1;
493 static int hf_wlccp_root_cm_flag = -1;
494 static int hf_wlccp_relay_flag = -1;
495 static int hf_wlccp_mic_flag = -1;
496 static int hf_wlccp_rm_request_reply_flag = -1;
497 static int hf_wlccp_rm_mic_flag = -1;
498
499 static int hf_wlccp_originator = -1; /* Originator Tree */
500 static int hf_wlccp_originator_node_type = -1;
501 /* static int hf_wlccp_originator_id = -1; */
502
503 static int hf_wlccp_responder = -1; /* Responder Tree */
504 static int hf_wlccp_responder_node_type = -1;
505 /*static int hf_wlccp_responder_id = -1; */
506
507
508 /* static int hf_wlccp_relay_node = -1;*/ /* Relay Node Tree */
509 static int hf_wlccp_relay_node_type = -1;
510 static int hf_wlccp_relay_node_id = -1;
511
512 static int hf_wlccp_priority = -1;
513 static int hf_wlccp_age = -1;
514 static int hf_wlccp_period = -1;
515 static int hf_wlccp_ipv4_address = -1;
516
517 /* SCM Advertisement */
518 static int hf_wlccp_scm_hop_address = -1;
519
520 static int hf_wlccp_scm_flags = -1; /* SCM Flags Tree */
521 static int hf_wlccp_scm_active_flag = -1;
522 static int hf_wlccp_scm_unscheduled_flag = -1;
523 static int hf_wlccp_scm_unattached_flag = -1;
524 static int hf_wlccp_scm_layer2update_flag = -1;
525
526 static int hf_wlccp_scm_election_group = -1;
527 static int hf_wlccp_scm_attach_count = -1;
528
529 static int hf_wlccp_scm_priority_flags = -1; /* SCM Priority Flags */
530 static int hf_wlccp_scm_priority = -1;
531 static int hf_wlccp_scm_preferred_flag = -1;
532
533 static int hf_wlccp_scm_bridge_priority_flags = -1; /* SCM Bridge Priority Flags */
534 static int hf_wlccp_scm_bridge_priority = -1;
535 static int hf_wlccp_scm_bridge_disable_flag = -1;
536
537 static int hf_wlccp_scm_node_id = -1;
538 static int hf_wlccp_scm_unknown_short = -1;
539 static int hf_wlccp_scm_instance_age = -1;
540 static int hf_wlccp_scm_path_cost = -1;
541 static int hf_wlccp_scm_hop_count = -1;
542 static int hf_wlccp_scm_advperiod = -1;
543
544 /*kan for apRegistration messages*/
545 static int hf_wlccp_timestamp = -1;
546 static int hf_wlccp_apregstatus = -1;
547 static int hf_wlccp_ap_node_id = -1;
548 static int hf_wlccp_ap_node_type = -1;
549 static int hf_wlccp_ap_node_id_address = -1;
550 /*kan for nmPathInit messages */
551 static int hf_wlccp_requ_node_type = -1;
552 static int hf_wlccp_requ_node_id = -1;
553 static int hf_wlccp_status = -1;
554 static int hf_wlccp_path_init_rsvd = -1;
555 /*kan - for cmAAA messages */
556 static int hf_wlccp_aaa_msg_type = -1;
557 static int hf_wlccp_aaa_auth_type = -1;
558 static int hf_wlccp_keymgmt_type = -1;
559 /*kan - for cmAAA EAPOL messages */
560 static int hf_wlccp_eapol_msg = -1;
561 static int hf_wlccp_eapol_version = -1;
562 static int hf_wlccp_eapol_type = -1;
563 static int hf_wlccp_eap_msg_length = -1;
564 static int hf_wlccp_eap_msg = -1;
565 /*kan - for cmAAA Proprietary message */
566 static int hf_wlccp_cisco_acctg_msg = -1;
567 /*kan - for cmWIDS */
568 static int hf_wlccp_wids_msg_type = -1;
569 /*kan - for nmConfigRequest and nmConfigReply */
570 static int hf_wlccp_nmconfig = -1;
571
572 static int hf_wlccp_scmstate_change = -1;
573 static int hf_wlccp_scmstate_change_reason = -1;
574
575 static int hf_wlccp_scmattach_state = -1;
576 static int hf_wlccp_nmcapability = -1;
577 static int hf_wlccp_refresh_req_id = -1;
578
579 static int hf_wlccp_tlv = -1;
580 static int hf_tlv_flags = -1;
581
582 static int hf_wlccp_null_tlv = -1;
583
584 static int hf_wlccp_tlv_type = -1;
585 static int hf_wlccp_tlv_type0 = -1;
586 static int hf_wlccp_tlv_type1 = -1;
587 static int hf_wlccp_tlv_type2 = -1;
588 static int hf_wlccp_tlv_type3 = -1;
589 static int hf_wlccp_tlv_type4 = -1;
590 static int hf_wlccp_tlv_type5 = -1;
591 static int hf_wlccp_tlv_group = -1;
592 static int hf_wlccp_tlv_container_flag = -1;
593 static int hf_wlccp_tlv_encrypted_flag = -1;
594 static int hf_wlccp_tlv_request_flag = -1;
595 static int hf_wlccp_tlv_reserved_bit = -1;
596 static int hf_wlccp_tlv_length = -1;
597
598 /* static int hf_wlccp_tlv_value = -1; */
599
600 static int hf_wlccp_path_length = -1;
601 static int hf_wlccp_mic_msg_seq_count = -1;
602 static int hf_wlccp_mic_length = -1;
603 static int hf_wlccp_mic_value = -1;
604
605 static int hf_wlccp_key_seq_count = -1;
606 static int hf_wlccp_dest_node_type = -1;
607 static int hf_wlccp_dest_node_id = -1;
608 static int hf_wlccp_supp_node_type = -1;
609 static int hf_wlccp_supp_node_id = -1;
610 static int hf_wlccp_key_mgmt_type = -1;
611 static int hf_wlccp_nonce = -1;
612 static int hf_wlccp_session_timeout = -1;
613 static int hf_wlccp_src_node_type = -1;
614 static int hf_wlccp_src_node_id = -1;
615 static int hf_wlccp_token = -1;
616 static int hf_wlccp_mode = -1;
617 static int hf_wlccp_scan_mode = -1;
618 static int hf_wlccp_rss = -1;
619 static int hf_wlccp_srcidx = -1;
620 static int hf_wlccp_parent_tsf = -1;
621 static int hf_wlccp_target_tsf = -1;
622
623 static int hf_wlccp_channel = -1;
624 static int hf_wlccp_phy_type = -1;
625 static int hf_wlccp_bssid = -1;
626 static int hf_wlccp_beacon_interval = -1;
627 /* static int hf_wlccp_capabilities = -1; */
628 static int hf_wlccp_tlv80211 = -1;
629 static int hf_wlccp_duration = -1;
630 static int hf_wlccp_rpidensity = -1;
631 static int hf_wlccp_ccabusy = -1;
632 static int hf_wlccp_sta_type = -1;
633 static int hf_wlccp_stamac = -1;
634 static int hf_wlccp_token2 = -1;
635 static int hf_wlccp_interval = -1;
636 static int hf_wlccp_count = -1;
637 static int hf_framereport_elements = -1;
638 static int hf_wlccp_numframes = -1;
639 static int hf_wlccp_mfpcapability = -1;
640 static int hf_wlccp_mfpflags = -1;
641 static int hf_wlccp_mfpconfig = -1;
642 static int hf_wlccp_clientmac = -1;
643 static int hf_time_elapsed = -1;
644 static int hf_wlccp_parent_ap_mac = -1;
645 static int hf_wlccp_auth_type =-1;
646 static int hf_reg_lifetime = -1;
647 static int hf_wlccp_radius_user_name = -1;
648 static int hf_wds_reason = -1;
649
650
651 static int hf_wlccp_80211_capabilities = -1;
652 static int hf_80211_cap_ess = -1;
653 static int hf_80211_cap_ibss = -1;
654 static int hf_80211_cap_cf_pollable = -1;
655 static int hf_80211_cap_cf_poll_req = -1;
656 static int hf_80211_cap_privacy = -1;
657 static int hf_80211_short_preamble = -1;
658 static int hf_80211_pbcc = -1;
659 static int hf_80211_chan_agility = -1;
660 static int hf_80211_spectrum_mgmt = -1;
661 static int hf_80211_qos = -1;
662 static int hf_80211_short_time_slot = -1;
663 static int hf_80211_apsd = -1;
664 static int hf_80211_reserved = -1;
665 static int hf_80211_dsss_ofdm = -1;
666 static int hf_80211_dlyd_block_ack = -1;
667 static int hf_80211_imm_block_ack = -1;
668
669
670 static int hf_wlccp_tlv_unknown_value = -1;
671
672 /* Initialize the subtree pointers */
673 static gint ett_wlccp = -1;
674 static gint ett_wlccp_sap_tree = -1;
675 static gint ett_wlccp_type = -1;
676 static gint ett_wlccp_cm_flags = -1;
677 static gint ett_wlccp_scm_flags = -1;
678 static gint ett_wlccp_scm_priority_flags = -1;
679 static gint ett_wlccp_scm_bridge_priority_flags = -1;
680 static gint ett_wlccp_rm_flags = -1;
681 static gint ett_wlccp_nm_flags = -1;
682
683
684 static gint ett_wlccp_flags = -1;
685 static gint ett_wlccp_ap_node_id = -1;
686 static gint ett_wlccp_eapol_msg_tree = -1;
687 static gint ett_wlccp_eap_tree = -1;
688 static gint ett_wlccp_tlv_tree = -1;
689 static gint ett_tlv_flags_tree = -1;
690 static gint ett_tlv_sub_tree = -1;
691 static gint ett_80211_capability_flags_tree = -1;
692 static gint ett_framereport_elements_tree = -1;
693
694
695
696 /* Code to actually dissect the packets */
697 static void
698 dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
699 {
700         /* Set up structures needed to add the protocol subtree and manage it */
701         proto_item *ti;
702         proto_tree *wlccp_tree, *wlccp_sap_tree, *wlccp_type_tree;
703
704         guint offset = 0, old_offset;
705
706         guint8 version=0, sap_id=0;
707
708         guint16 type;
709         guint8 base_message_type=0, message_sub_type=0;
710
711         /* Make entries in Protocol column and Info column on summary display */
712         col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLCCP");
713
714         if (check_col(pinfo->cinfo, COL_INFO))
715         {
716                 if(tvb_get_guint8(tvb, 0) == 0xC1)  /* Get the version number */
717                 {
718
719                         sap_id = tvb_get_guint8(tvb,1) & SAP_VALUE_MASK;
720                         base_message_type=(tvb_get_guint8(tvb,6)) & MT_BASE_MSG_TYPE;
721                         message_sub_type=(tvb_get_guint8(tvb, 6) &  MT_SUBTYPE ) >> 6;
722
723
724                         switch (sap_id)
725                         {
726
727                                 case WLCCP_SAP_CCM:
728                                 {
729
730                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
731                                                 val_to_str(base_message_type, wlccp_msg_type_vs_0, "Unknown"),
732                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
733                                         );
734                                         break;
735
736                                 } /* case WLCCP_SAP_CCM */
737
738                                 case WLCCP_SAP_SEC:
739                                 {
740
741                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
742                                                 val_to_str(base_message_type, wlccp_msg_type_vs_1, "Unknown"),
743                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
744                                         );
745                                         break;
746                                 } /* case WLCCP_SAP_SEC */
747
748                                 case WLCCP_SAP_RRM:
749                                 {
750                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
751                                                 val_to_str(base_message_type, wlccp_msg_type_vs_2, "Unknown"),
752                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
753                                         );
754                                         break;
755
756                                 } /* case WLCCP_SAP_RRM */
757
758                                 case WLCCP_SAP_QOS:
759                                 {
760                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
761                                                 val_to_str(base_message_type, wlccp_msg_type_vs_3, "Unknown"),
762                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
763                                         );
764                                         break;
765                                 } /* case WLCCP_SAP_QOS */
766
767                                 case WLCCP_SAP_NM:
768                                 {
769                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
770                                                 val_to_str(base_message_type, wlccp_msg_type_vs_4, "Unknown"),
771                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
772                                         );
773                                         break;
774
775                                 } /* case WLCCP_SAP_NM */
776
777                                 case WLCCP_SAP_MIP:
778                                 {
779                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
780                                                 val_to_str(base_message_type, wlccp_msg_type_vs_5, "Unknown"),
781                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
782                                         );
783                                         break;
784                                 } /* case WLCCP_SAP_MIP */
785
786                                 default:
787                                 {
788                                         col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s  SubType: %s",
789                                                 "Unknown",
790                                                 val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown")
791                                         );
792                                         break;
793                                 } /* default for switch sap */
794
795
796                         } /* switch sap */
797
798                 } /* if version=0xC1 (tvb_get_guint8(tvb, 0) == 0xC1)*/
799
800         } /* if check_col */
801
802         if (tree) {
803                 /* create display subtree for the protocol */
804                 ti = proto_tree_add_item(tree, proto_wlccp, tvb, 0, -1, ENC_BIG_ENDIAN);
805                 wlccp_tree = proto_item_add_subtree(ti, ett_wlccp);
806
807                 proto_tree_add_item(wlccp_tree, hf_wlccp_version,
808                                     tvb, offset, 1, ENC_BIG_ENDIAN);
809
810                 /* interpretation of the packet is determined by WLCCP version */
811                 version = tvb_get_guint8(tvb, 0);
812                 offset += 1;
813
814                 if(version == 0x0) {
815                         proto_tree_add_item(wlccp_tree, hf_wlccp_length,
816                                             tvb, 1, 1, ENC_BIG_ENDIAN);
817
818                         proto_tree_add_item(wlccp_tree, hf_wlccp_type,
819                                             tvb, 2, 2, ENC_BIG_ENDIAN);
820                         type = tvb_get_ntohs(tvb, 2);
821
822                         proto_tree_add_item(wlccp_tree, hf_wlccp_dstmac,
823                                             tvb, 4, 6, ENC_NA);
824
825                         proto_tree_add_item(wlccp_tree, hf_wlccp_srcmac,
826                                             tvb, 10, 6, ENC_NA);
827
828                         if(type == 0x4081) {
829                                 proto_tree_add_item(wlccp_tree, hf_wlccp_ipv4_address,
830                                                     tvb, 38, 4, ENC_BIG_ENDIAN);
831
832                                 proto_tree_add_item(wlccp_tree, hf_wlccp_hostname,
833                                                     tvb, 44, 28, ENC_ASCII|ENC_NA);
834                         } /* if type = 0x4081 */
835                 } /* if version == 0x00 */
836
837                 if(version == 0xC1)
838                 {
839
840                         { /* SAP Field */
841                         ti = proto_tree_add_item(wlccp_tree, hf_wlccp_sap,
842                                                 tvb, offset, 1, ENC_BIG_ENDIAN);
843                         wlccp_sap_tree = proto_item_add_subtree(ti, ett_wlccp_sap_tree);
844
845                         proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_version,
846                                             tvb, offset, 1, ENC_BIG_ENDIAN);
847
848                         proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_id,
849                                             tvb, offset, 1, ENC_BIG_ENDIAN);
850
851                         sap_id = tvb_get_guint8(tvb,offset) & SAP_VALUE_MASK;
852
853                         offset += 1;
854
855                         } /* SAP Field */
856
857                         proto_tree_add_item(wlccp_tree, hf_wlccp_destination_node_type,
858                                             tvb, offset, 2, ENC_BIG_ENDIAN);
859                         offset += 2;
860
861                         proto_tree_add_item(wlccp_tree, hf_wlccp_length,
862                                             tvb, offset, 2, ENC_BIG_ENDIAN);
863                         offset += 2;
864
865
866                         { /* Message Type Field */
867                         ti = proto_tree_add_item(wlccp_tree, hf_wlccp_type,
868                                                  tvb, offset, 1, ENC_BIG_ENDIAN);
869
870                         wlccp_type_tree = proto_item_add_subtree(ti, ett_wlccp_type);
871
872                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_subtype,
873                                             tvb, offset, 1, ENC_BIG_ENDIAN);
874
875                         switch (sap_id)
876                         {
877
878                                 case WLCCP_SAP_CCM:
879                                 {
880
881                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_0,
882                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
883
884                                         break;
885
886                                 } /* case WLCCP_SAP_CCM */
887
888                                 case WLCCP_SAP_SEC:
889                                 {
890                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_1,
891                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
892
893                                         break;
894
895                                 } /* case WLCCP_SAP_SEC */
896
897                                 case WLCCP_SAP_RRM:
898                                 {
899                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_2,
900                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
901
902                                         break;
903
904                                 } /* case WLCCP_SAP_RRM */
905
906                                 case WLCCP_SAP_QOS:
907                                 {
908                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_3,
909                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
910
911                                         break;
912
913                                 } /* case WLCCP_SAP_QOS */
914
915                                 case WLCCP_SAP_NM:
916                                 {
917                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_4,
918                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
919
920                                         break;
921
922                                 } /* case WLCCP_SAP_NM */
923
924                                 case WLCCP_SAP_MIP:
925                                 {
926                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_5,
927                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
928
929                                         break;
930
931                                 } /* case WLCCP_SAP_MIP */
932
933                                 default:
934                                 {
935
936                                         proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_unknown,
937                                                         tvb, offset, 1, ENC_BIG_ENDIAN);
938
939                                         break;
940
941                                 } /* default for switch sap */
942
943                         } /* switch sap */
944
945                         base_message_type=(tvb_get_guint8(tvb,offset) & MT_BASE_MSG_TYPE );
946
947                         offset += 1;
948                         } /* Message Type Field */
949
950                         /* after the Message Type Field things change based on SAP and Message Type */
951
952                         set_mic_flag(FALSE);
953                         set_tlv_flag(FALSE);
954
955                         switch (sap_id)
956                         {
957
958                                 case WLCCP_SAP_CCM:
959                                 {
960
961                                         offset = dissect_wlccp_ccm_msg(wlccp_tree, tvb, offset, base_message_type);
962
963                                         break;
964
965                                 } /* case WLCCP_SAP_CCM */
966
967                                 case WLCCP_SAP_SEC:
968                                 {
969
970                                         offset = dissect_wlccp_sec_msg(wlccp_tree, tvb, offset, base_message_type);
971
972                                         break;
973
974                                 } /* case WLCCP_SAP_SEC */
975
976                                 case WLCCP_SAP_RRM:
977                                 {
978
979                                         offset = dissect_wlccp_rrm_msg(wlccp_tree, tvb, offset, base_message_type);
980
981                                         break;
982
983                                 } /* case WLCCP_SAP_RRM */
984
985                                 case WLCCP_SAP_QOS:
986                                 {
987
988                                         offset = dissect_wlccp_qos_msg(wlccp_tree, tvb, offset, base_message_type);
989
990                                         break;
991
992                                 } /* case WLCCP_SAP_QOS */
993
994                                 case WLCCP_SAP_NM:
995                                 {
996
997                                         offset = dissect_wlccp_nm_msg(wlccp_tree, tvb, offset, base_message_type);
998
999                                         break;
1000
1001                                 } /* case WLCCP_SAP_NM */
1002
1003                                 case WLCCP_SAP_MIP:
1004                                 {
1005
1006                                         offset = dissect_wlccp_mip_msg(wlccp_tree, tvb, offset, base_message_type);
1007
1008                                         break;
1009
1010                                 } /* case WLCCP_SAP_MIP */
1011
1012                                 default:
1013                                 {
1014                                         /* what should we do if we get an undefined SAP? */
1015
1016                                         break;
1017
1018                                 } /* default for switch sap */
1019
1020                         } /* switch sap */
1021
1022
1023
1024                         if(get_tlv_flag() || get_mic_flag())
1025                         {
1026
1027                                 if (tvb_length_remaining(tvb,offset) < 4)
1028                                 {
1029                                 /* something is wrong if the TLV flag is set and there's not enough left in the buffer */
1030
1031                                 /* proto_tree_add_string(wlccp_tree, NULL, tvb, offset, -1, "MIC Flag=%d and TLV Flag=%d, but no data left to decode."); */
1032
1033                                 } /* if bytes_left <=0 */
1034                                 else
1035                                 {
1036
1037                                         while (tvb_length_remaining(tvb,offset) >= 4)
1038                                         {
1039                                                 old_offset = offset;
1040                                                 offset = dissect_wlccp_tlvs(wlccp_tree, tvb, offset, 0);
1041                                                 DISSECTOR_ASSERT(offset > old_offset);
1042                                         } /* while bytes_left */
1043
1044 ;
1045                                 } /*else bytes_left < 4 */
1046
1047                         } /* if tlv_flag || mic_flag */
1048
1049                 } /* if version == 0xC1 */
1050
1051         } /* if tree */
1052
1053 } /* dissect_wlccp */
1054
1055
1056 /*******************************************************************************************/
1057
1058 /* some utility functions */
1059
1060 /* these could be implemented with a struct */
1061
1062 static void set_mic_flag(gboolean flag)
1063 {
1064         mic_flag=flag;
1065 } /*set_mic_flag */
1066
1067 static void set_tlv_flag(gboolean flag)
1068 {
1069         tlv_flag=flag;
1070 } /* set_tlv_flag */
1071
1072 static gboolean get_tlv_flag(void)
1073 {
1074         return(tlv_flag);
1075 } /* get_tlv_flag */
1076
1077 static gboolean get_mic_flag(void)
1078 {
1079         return(mic_flag);
1080 } /* get_mic_flag */
1081
1082 /*******************************************************************************************/
1083
1084 static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type)
1085 {
1086         proto_item *_ti;
1087         proto_tree *_wlccp_eapol_msg_tree, *_wlccp_cm_flags_tree, *_wlccp_scm_flags_tree, *_wlccp_scm_priority_flags_tree, *_wlccp_scm_bridge_priority_flags_tree;
1088
1089         gboolean _relay_flag=0, _mic_flag=0, _tlv_flag=0;
1090         guint8 _aaa_msg_type=0, _eapol_type=0;
1091         guint16 _eap_msg_length=0;
1092
1093         proto_tree_add_item(_tree, hf_wlccp_hops,
1094                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1095         _offset += 1;
1096
1097         proto_tree_add_item(_tree, hf_wlccp_msg_id,
1098                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1099         _offset += 2;
1100
1101
1102 /* Decode the CM Flags Field */
1103
1104         _ti = proto_tree_add_item(_tree, hf_wlccp_flags,
1105                                 _tvb, _offset, 2, ENC_BIG_ENDIAN);
1106         _wlccp_cm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_cm_flags);
1107
1108
1109         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_retry_flag,
1110                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1111
1112         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_response_request_flag,
1113                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1114
1115         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_tlv_flag,
1116                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1117         _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1;
1118         set_tlv_flag(_tlv_flag);
1119
1120         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_inbound_flag,
1121                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1122
1123         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_outbound_flag,
1124                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1125
1126         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_hopwise_routing_flag,
1127                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1128
1129         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_root_cm_flag,
1130                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1131
1132         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_relay_flag,
1133                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1134         _relay_flag = (tvb_get_ntohs(_tvb, _offset)>>8) & 1;
1135
1136         proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_mic_flag,
1137                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1138         _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1;
1139         set_mic_flag(_mic_flag);
1140
1141         _offset += 2;
1142
1143 /* End Decode the CM Flags Field */
1144
1145
1146         proto_tree_add_item(_tree, hf_wlccp_originator_node_type,
1147                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1148         _offset += 2;
1149
1150         proto_tree_add_item(_tree, hf_wlccp_originator,
1151                             _tvb, _offset, 6, ENC_NA);
1152         _offset += 6;
1153
1154         proto_tree_add_item(_tree, hf_wlccp_responder_node_type,
1155                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1156         _offset += 2;
1157
1158         proto_tree_add_item(_tree, hf_wlccp_responder,
1159                             _tvb, _offset, 6, ENC_NA);
1160         _offset += 6;
1161
1162         if(_relay_flag)
1163         {
1164                 proto_tree_add_item(_tree, hf_wlccp_relay_node_type,
1165                                     _tvb, _offset, 2, ENC_BIG_ENDIAN);
1166                 _offset += 2;
1167
1168                 proto_tree_add_item(_tree, hf_wlccp_relay_node_id,
1169                                     _tvb, _offset, 6, ENC_NA);
1170                 _offset += 6;
1171
1172         } /* if _relay_flag */
1173
1174
1175         switch (_base_message_type)
1176         {
1177
1178                 case 0x01:
1179                 {
1180                         proto_tree_add_item(_tree, hf_wlccp_scm_hop_address,
1181                                             _tvb, _offset, 6, ENC_NA);
1182                         _offset += 6;
1183
1184 /* Decode the SCM Flags Field */
1185
1186                         _ti = proto_tree_add_item(_tree, hf_wlccp_scm_flags,
1187                                                 _tvb, _offset, 2, ENC_BIG_ENDIAN);
1188                         _wlccp_scm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_flags);
1189
1190                         proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_layer2update_flag,
1191                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
1192
1193                         proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_unattached_flag,
1194                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
1195
1196                         proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_unscheduled_flag,
1197                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
1198
1199                         proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_active_flag,
1200                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
1201                         _offset += 2;
1202
1203 /* End Decode the SCM Flags Field */
1204
1205
1206                         proto_tree_add_item(_tree, hf_wlccp_scm_election_group,
1207                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1208                         _offset += 1;
1209
1210                         proto_tree_add_item(_tree, hf_wlccp_scm_attach_count,
1211                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1212                         _offset += 1;
1213
1214 /* Decode the SCM Priority Flags Field */
1215
1216                         _ti = proto_tree_add_item(_tree, hf_wlccp_scm_priority_flags,
1217                                                 _tvb, _offset, 1, ENC_BIG_ENDIAN);
1218                         _wlccp_scm_priority_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_priority_flags);
1219
1220                         proto_tree_add_item(_wlccp_scm_priority_flags_tree, hf_wlccp_scm_priority,
1221                                         _tvb, _offset, 1, ENC_BIG_ENDIAN);
1222
1223                         proto_tree_add_item(_wlccp_scm_priority_flags_tree, hf_wlccp_scm_preferred_flag,
1224                                         _tvb, _offset, 1, ENC_BIG_ENDIAN);
1225
1226                         _offset += 1;
1227
1228 /* End Decode the SCM Priority Flags Field */
1229
1230 /* Decode the SCM Bridge Priority Flags Field */
1231
1232                         _ti = proto_tree_add_item(_tree, hf_wlccp_scm_bridge_priority_flags,
1233                                                 _tvb, _offset, 1, ENC_BIG_ENDIAN);
1234                         _wlccp_scm_bridge_priority_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_bridge_priority_flags);
1235
1236                         proto_tree_add_item(_wlccp_scm_bridge_priority_flags_tree, hf_wlccp_scm_bridge_priority,
1237                                         _tvb, _offset, 1, ENC_BIG_ENDIAN);
1238
1239                         proto_tree_add_item(_wlccp_scm_bridge_priority_flags_tree, hf_wlccp_scm_bridge_disable_flag,
1240                                         _tvb, _offset, 1, ENC_BIG_ENDIAN);
1241
1242                         _offset += 1;
1243
1244 /* End Decode the SCM Bridge Priority Flags Field */
1245
1246                         proto_tree_add_item(_tree, hf_wlccp_scm_node_id,
1247                                             _tvb, _offset, 6, ENC_NA);
1248                         _offset += 6;
1249
1250                         proto_tree_add_item(_tree, hf_wlccp_scm_unknown_short,
1251                                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1252                         _offset += 2;
1253
1254                         proto_tree_add_item(_tree, hf_wlccp_scm_instance_age,
1255                                             _tvb, _offset, 4, ENC_BIG_ENDIAN);
1256                         _offset += 4;
1257
1258                         proto_tree_add_item(_tree, hf_wlccp_scm_path_cost,
1259                                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1260                         _offset += 2;
1261
1262                         proto_tree_add_item(_tree, hf_wlccp_scm_hop_count,
1263                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1264                         _offset += 1;
1265
1266                         proto_tree_add_item(_tree, hf_wlccp_scm_advperiod,
1267                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1268                         _offset += 1;
1269
1270                         break;
1271                 } /* case 0x01 */
1272
1273                 case 0x02:
1274                 {
1275
1276                         break;
1277                 } /* case 0x02 */
1278
1279                 case 0x03:
1280                 {
1281
1282                         break;
1283                 } /* case 0x03 */
1284
1285                 case 0x04:
1286                 {
1287
1288                         break;
1289                 } /* case 0x04 */
1290
1291                 case 0x05:
1292                 {
1293
1294                         break;
1295                 } /* case 0x05 */
1296
1297                 case 0x06:
1298                 {
1299
1300                         break;
1301                 } /* case 0x06 */
1302
1303                 case 0x07:
1304                 {
1305
1306                         break;
1307                 } /* case 0x07 */
1308
1309                 case 0x08:
1310                 {
1311
1312                         break;
1313                 } /* case 0x08 */
1314
1315                 case 0x09:
1316                 {
1317
1318                         break;
1319                 } /* case 0x09 */
1320
1321                 case 0x0a:
1322                 {
1323
1324                         break;
1325                 } /* case 0x0a */
1326
1327                 case 0x0b: /* cmAAA */
1328                 {
1329                         proto_tree_add_item(_tree, hf_wlccp_requ_node_type,
1330                                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1331                         _offset += 2;
1332
1333                         proto_tree_add_item(_tree, hf_wlccp_requ_node_id,
1334                                             _tvb, _offset, 6, ENC_NA);
1335                         _offset += 6;
1336
1337                         /*kan - according to the patent applicatoin these fields vary based
1338                         on one another.
1339                         For now we decode what we know about and then we'll come back and add
1340                         the rest */
1341
1342                         proto_tree_add_item(_tree, hf_wlccp_aaa_msg_type,
1343                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1344                         _aaa_msg_type=tvb_get_guint8(_tvb,_offset);
1345                         _offset += 1;
1346
1347                         proto_tree_add_item(_tree, hf_wlccp_aaa_auth_type,
1348                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1349                         _offset += 1;
1350
1351                         proto_tree_add_item(_tree, hf_wlccp_keymgmt_type,
1352                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1353                         _offset += 1;
1354
1355                         proto_tree_add_item(_tree, hf_wlccp_status,
1356                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1357                         _offset += 1;
1358
1359 /* kan - I'm pretty sure this EAPOL tree only applies sometimes, but it's the only complete example that I have
1360 to test against for now.
1361 For that matter, it may be possible to just hand this piece of the packet over to the EAPOL dissector and let it
1362 handle things. To be investigated further */
1363
1364                         if (_aaa_msg_type == 0x2)  /*EAPOL*/
1365                         {
1366                                 _ti = proto_tree_add_item(_tree, hf_wlccp_eapol_msg,
1367                                                          _tvb, _offset, 6, ENC_NA);
1368
1369                                 _wlccp_eapol_msg_tree = proto_item_add_subtree(
1370                                                 _ti, ett_wlccp_eapol_msg_tree);
1371
1372
1373 /* THIS NEEDS TO BE CHECKED */
1374                                 /*kan - skip some unknown bytes */
1375                                 _offset += 2;
1376
1377                                 proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_version,
1378                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1379
1380                                 _offset += 1;
1381
1382                                 proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_type,
1383                                                     _tvb, _offset, 1, ENC_BIG_ENDIAN);
1384                                 _eapol_type=tvb_get_guint8(_tvb, _offset);
1385                                 _offset += 1;
1386
1387                                 if (_eapol_type == 0)
1388                                 {
1389                                         proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg_length,
1390                                                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1391                                         _eap_msg_length=tvb_get_ntohs(_tvb, _offset);
1392                                         _offset += 2;
1393
1394                                         proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg,
1395                                                             _tvb, _offset, _eap_msg_length, ENC_NA);
1396                                         _offset += _eap_msg_length;
1397
1398                                 } /* if _eapol_type == 0 */
1399
1400                         } /* if _aaa_msg_type ==0x2 */
1401
1402                         if (_aaa_msg_type == 0x3)  /*Cisco proprietary message*/
1403                         {
1404                                 proto_tree_add_item(_tree, hf_wlccp_cisco_acctg_msg,
1405                                                     _tvb, _offset, -1, ENC_NA);
1406                         } /* if aaa_msg_type == 0x3 */
1407
1408                         break;
1409                 } /* case 0x0b */
1410
1411                 case 0x0c:  /* cmPathInit */
1412                 {
1413                         proto_tree_add_item(_tree, hf_wlccp_requ_node_type,
1414                                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1415                         _offset += 2;
1416
1417                         proto_tree_add_item(_tree, hf_wlccp_requ_node_id,
1418                                             _tvb, _offset, 6, ENC_NA);
1419                         _offset += 6;
1420
1421                         /*kan - there's a reserved alignment byte right here*/
1422                         proto_tree_add_item(_tree, hf_wlccp_path_init_rsvd,
1423                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1424                         _offset += 1;
1425
1426                         proto_tree_add_item(_tree, hf_wlccp_status,
1427                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1428                         _offset +=1;
1429
1430                         break;
1431                 } /* case 0x0c */
1432
1433                 case 0x0f:  /* cmWIDS */
1434                 {
1435                         proto_tree_add_item(_tree, hf_wlccp_wids_msg_type,
1436                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1437                         _offset += 1;
1438
1439                         proto_tree_add_item(_tree, hf_wlccp_status,
1440                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1441                         _offset +=1;
1442
1443                         break;
1444                 } /* case 0x0f */
1445
1446                 default:
1447                 {
1448
1449                         break;
1450                 } /* default for switch _base_message_type */
1451
1452         } /* switch _base_message_type */
1453
1454
1455         return(_offset);
1456 } /* dissect_wlccp_ccm_msg */
1457
1458 static guint dissect_wlccp_sec_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type)
1459 {
1460
1461 /* at the momemt we have no more data to use to write this dissector code */
1462 /* it's just a place holder for now                                       */
1463
1464         switch (_base_message_type)
1465         {
1466
1467                 case 0x01:
1468                 {
1469
1470                         break;
1471                 } /* case 0x01 */
1472
1473                 default:
1474                 {
1475
1476                         break;
1477                 } /* default for switch _base_message_type */
1478
1479         } /* switch _base_message_type */
1480
1481
1482
1483         return(_offset);
1484
1485 } /* dissect_wlccp_sec_msg */
1486
1487 static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type)
1488 {
1489
1490         proto_tree *_wlccp_rm_flags_tree;
1491         proto_item *_ti;
1492
1493         gboolean _mic_flag=0;
1494
1495
1496
1497 /* Decode the RM Flags Field */
1498
1499         _ti = proto_tree_add_item(_tree, hf_wlccp_rm_flags,
1500                          _tvb, _offset, 1, ENC_BIG_ENDIAN);
1501
1502         _wlccp_rm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_rm_flags);
1503
1504         proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_mic_flag,
1505                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1506
1507         _mic_flag = (tvb_get_guint8(_tvb, _offset) & RM_F_MIC) >> 1;
1508
1509         set_mic_flag(_mic_flag);
1510
1511         set_tlv_flag(TRUE);
1512
1513         proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_request_reply_flag,
1514                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1515
1516         _offset += 1;
1517
1518 /* End Decode the RM Flags Field */
1519
1520         proto_tree_add_item(_tree, hf_wlccp_msg_id,
1521                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1522         _offset += 2;
1523
1524         proto_tree_add_item(_tree, hf_wlccp_originator_node_type,
1525                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1526         _offset += 2;
1527
1528         proto_tree_add_item(_tree, hf_wlccp_originator,
1529                             _tvb, _offset, 6, ENC_NA);
1530         _offset += 6;
1531
1532         proto_tree_add_item(_tree, hf_wlccp_responder_node_type,
1533                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1534         _offset += 2;
1535
1536         proto_tree_add_item(_tree, hf_wlccp_responder,
1537                             _tvb, _offset, 6, ENC_NA);
1538         _offset += 6;
1539
1540
1541         switch (_base_message_type)
1542         {
1543
1544                 case 0x01: /* rmReq */
1545                 {
1546                         break;
1547                 } /* case 0x01 */
1548
1549                 case 0x02: /* rmReqRoutingResp */
1550                 {
1551                         break;
1552                 } /* case 0x01 */
1553
1554                 case 0x03: /* rmReport */
1555                 {
1556                         break;
1557                 } /* case 0x01 */
1558
1559                 default:
1560                 {
1561
1562                         break;
1563                 } /* default for switch _base_message_type */
1564
1565         } /* switch _base_message_type */
1566
1567
1568         return(_offset);
1569
1570 } /* dissect_wlccp_rrm_msg */
1571
1572
1573
1574 static guint dissect_wlccp_qos_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type)
1575 {
1576 /* at the momemt we have no more data to use to write this dissector code */
1577 /* it's just a place holder for now                                       */
1578
1579
1580         switch (_base_message_type)
1581         {
1582
1583                 case 0x01:
1584                 {
1585
1586                         break;
1587                 } /* case 0x01 */
1588
1589                 default:
1590                 {
1591
1592                         break;
1593                 } /* default for switch _base_message_type */
1594
1595         } /* switch _base_message_type */
1596
1597
1598         return(_offset);
1599
1600 } /* dissect_wlccp_qos_msg */
1601
1602
1603 static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type)
1604 {
1605         proto_item *_ti;
1606         proto_tree *_wlccp_ap_node_id_tree, *_wlccp_nm_flags_tree;
1607
1608         gboolean _mic_flag=0, _tlv_flag=0;
1609
1610
1611         proto_tree_add_item(_tree, hf_wlccp_nm_version,
1612                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1613         _offset += 1;
1614
1615         proto_tree_add_item(_tree, hf_wlccp_msg_id,
1616                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1617         _offset += 2;
1618
1619
1620 /* Decode the NM Flags Field */
1621
1622         _ti = proto_tree_add_item(_tree, hf_wlccp_flags,
1623                          _tvb, _offset, 2, ENC_BIG_ENDIAN);
1624         _wlccp_nm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_nm_flags);
1625
1626
1627         proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_retry_flag,
1628                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1629
1630         proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_ack_required_flag,
1631                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1632
1633         proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_tlv_flag,
1634                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1635         _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1;
1636         set_tlv_flag(_tlv_flag);
1637
1638         proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_mic_flag,
1639                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1640         _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1;
1641         set_mic_flag(_mic_flag);
1642
1643         _offset += 2;
1644
1645 /* End Decode the NM Flags Field */
1646
1647
1648         proto_tree_add_item(_tree, hf_wlccp_originator_node_type,
1649                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1650         _offset += 2;
1651
1652         proto_tree_add_item(_tree, hf_wlccp_originator,
1653                             _tvb, _offset, 6, ENC_NA);
1654         _offset += 6;
1655
1656         proto_tree_add_item(_tree, hf_wlccp_responder_node_type,
1657                             _tvb, _offset, 2, ENC_BIG_ENDIAN);
1658         _offset += 2;
1659
1660         proto_tree_add_item(_tree, hf_wlccp_responder,
1661                             _tvb, _offset, 6, ENC_NA);
1662         _offset += 6;
1663
1664
1665         switch (_base_message_type)
1666         {
1667
1668                 case 0x01:  /* nmAck */
1669                 {
1670                         break;
1671                 } /* case 0x01 */
1672
1673                 case 0x10:  /* nmConfigRequest */
1674                 {
1675                         proto_tree_add_item(_tree, hf_wlccp_nmconfig,
1676                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1677                         _offset += 1;
1678
1679                         /* kan - there appears to be some padding or other unknowns here */
1680                         _offset += 3;
1681
1682                         break;
1683                 } /* case 0x10 */
1684
1685                 case 0x11:  /* nmConfigReply */
1686                 {
1687                         proto_tree_add_item(_tree, hf_wlccp_nmconfig,
1688                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1689                         _offset += 1;
1690
1691                         /* kan - there appears to be some padding or other unknowns here */
1692                         _offset += 3;
1693
1694                         break;
1695                 } /* case 0x11 */
1696
1697                 case 0x20:  /* nmApRegistration */
1698                 {
1699                         proto_tree_add_item(_tree, hf_wlccp_timestamp,
1700                                         _tvb, _offset, 8, ENC_BIG_ENDIAN);
1701                         _offset += 8;
1702
1703                         proto_tree_add_item(_tree, hf_wlccp_apregstatus,
1704                                         _tvb, _offset, 1, ENC_BIG_ENDIAN);
1705                         _offset += 1;
1706
1707                         _offset += 3; /*kan - skip some apparently unused bytes */
1708
1709                         _ti = proto_tree_add_item(_tree, hf_wlccp_ap_node_id,
1710                                                 _tvb, _offset, 8, ENC_NA);
1711
1712                         _wlccp_ap_node_id_tree = proto_item_add_subtree(
1713                                         _ti, ett_wlccp_ap_node_id);
1714
1715                         proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_type,
1716                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
1717                         _offset += 2;
1718
1719                         proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_id_address,
1720                                         _tvb, _offset, 6, ENC_NA);
1721                         _offset += 6;
1722
1723                         break;
1724                 } /* case 0x20 */
1725
1726                 case 0x21: /* nmScmStateChange */
1727                 {
1728                         proto_tree_add_item(_tree, hf_wlccp_timestamp,
1729                                             _tvb, _offset, 8, ENC_BIG_ENDIAN);
1730                         _offset += 8;
1731
1732                         proto_tree_add_item(_tree, hf_wlccp_scmstate_change,
1733                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1734                         _offset += 1;
1735
1736                         proto_tree_add_item(_tree, hf_wlccp_scmstate_change_reason,
1737                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1738                         _offset += 1;
1739
1740                         /*kan - skip some apparently unused bytes */
1741                         _offset += 2;
1742
1743                         break;
1744                 } /* case 0x21 */
1745
1746                 case 0x22: /* nmScmKeepActive */
1747                 {
1748                         proto_tree_add_item(_tree, hf_wlccp_scmattach_state,
1749                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1750                         _offset += 1;
1751
1752                         proto_tree_add_item(_tree, hf_wlccp_nmconfig,
1753                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1754                         _offset += 1;
1755
1756                         proto_tree_add_item(_tree, hf_wlccp_nmcapability,
1757                                             _tvb, _offset, 1, ENC_BIG_ENDIAN);
1758                         _offset += 1;
1759
1760                          /*kan - skip some apparently unused bytes */
1761                         _offset += 1;
1762
1763                         break;
1764                 } /* case 0x22 */
1765
1766                 case 0x30: /* nmClientEventReport */
1767                 {
1768                         proto_tree_add_item(_tree, hf_wlccp_timestamp,
1769                                             _tvb, _offset, 8, ENC_BIG_ENDIAN);
1770                         _offset += 8;
1771
1772                         break;
1773                 } /* case 0x30 */
1774
1775                 case 0x31: /* nmAllClientRefreshRequest */
1776                 {
1777                         proto_tree_add_item(_tree, hf_wlccp_refresh_req_id,
1778                                             _tvb, _offset, 4, ENC_BIG_ENDIAN);
1779                         _offset += 4;
1780
1781                         break;
1782                 } /* case 0x31 */
1783
1784                 default:
1785                 {
1786
1787                         break;
1788                 } /* default for switch _base_message_type */
1789
1790         } /* switch _base_message_type */
1791
1792
1793
1794         return(_offset);
1795
1796 } /* dissect_wlccp_nm_msg */
1797
1798 static guint dissect_wlccp_mip_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type)
1799 {
1800 /* at the momemt we have no more data to use to write this dissector code */
1801 /* it's just a place holder for now                                       */
1802
1803         switch (_base_message_type)
1804         {
1805
1806                 case 0x01:
1807                 {
1808
1809                         break;
1810                 } /* case 0x01 */
1811
1812                 default:
1813                 {
1814
1815                         break;
1816                 } /* default for switch _base_message_type */
1817
1818         } /* switch _base_message_type */
1819
1820         return(_offset);
1821
1822 } /* dissect_wlccp_mip_msg */
1823
1824
1825 /***************************************************************************************************/
1826
1827 static guint dissect_wlccp_tlvs( proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint _depth)
1828 {
1829
1830         proto_item *_ti, *_temp_ti;
1831         proto_tree *_tlv_tree;
1832         proto_tree *_tlv_flags_tree;
1833
1834         gboolean _container_flag=0;
1835         gint  _group_id=0, _type_id=0;
1836         guint _length=0;
1837         guint _tlv_end=0;
1838         guint _old_offset;
1839
1840
1841
1842         /* the TLV length is 2 bytes into the TLV, and we need it now */
1843         _length = tvb_get_ntohs(_tvb,_offset+2);
1844
1845         /* figure out where the end of this TLV is so we know when to stop dissecting it */
1846         _tlv_end = _offset + _length;
1847
1848         /* this TLV is _length bytes long */
1849         _ti = proto_tree_add_item(_tree, hf_wlccp_tlv, _tvb, _offset, _length, ENC_NA);
1850         /* create the TLV sub tree */
1851         _tlv_tree = proto_item_add_subtree(_ti, ett_wlccp_tlv_tree);
1852
1853         /* save the pointer because we'll add some text to it later */
1854         _temp_ti = _ti;
1855
1856
1857
1858         /* add an arbitrary safety factor in case we foul up the dissector recursion */
1859         DISSECTOR_ASSERT(_depth < 100);
1860
1861         /* add the flags field to the tlv_tree */
1862         _ti = proto_tree_add_item(_tlv_tree, hf_tlv_flags, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1863         _tlv_flags_tree = proto_item_add_subtree(_ti, ett_tlv_flags_tree);
1864
1865         /*
1866         first 2 bytes are the flags, Group and Type
1867         bit 0 = container,
1868         bit 1 = encrypted,
1869         bits 2-3 = reserved,
1870         bits 4-7 = group ID,
1871         bit 5 = request,
1872         bits 9-15 = type ID
1873         */
1874
1875
1876         /* the TLV group and type IDs are contained in the flags field, extract them */
1877         _group_id = (tvb_get_ntohs(_tvb,_offset) & TLV_GROUP_ID) >> 8;
1878         _type_id = (tvb_get_ntohs(_tvb,_offset) & TLV_TYPE_ID);
1879
1880         /* add the flags to the tree */
1881         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_container_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1882         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_encrypted_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1883         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_reserved_bit, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1884         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_group, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1885         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_request_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1886
1887         /* a hack to show the right string representation of the type_id in the tree */
1888         switch (_group_id)
1889         {
1890                 case WLCCP_TLV_GROUP_WLCCP:
1891                 {
1892                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type0, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1893                         break;
1894                 } /* case WLCCP_TLV_GROUP_WLCCP */
1895
1896                 case WLCCP_TLV_GROUP_SEC:
1897                 {
1898                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type1, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1899                         break;
1900                 } /* case WLCCP_TLV_GROUP_SEC */
1901
1902                 case WLCCP_TLV_GROUP_RRM:
1903                 {
1904                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type2, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1905                         break;
1906                 } /* case WLCCP_TLV_GROUP_RRM */
1907
1908                 case WLCCP_TLV_GROUP_QOS:
1909                 {
1910                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type3, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1911                         break;
1912                 } /* case WLCCP_TLV_GROUP_QOS */
1913
1914                 case WLCCP_TLV_GROUP_NM:
1915                 {
1916                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type4, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1917                         break;
1918                 } /* case WLCCP_TLV_GROUP_NM */
1919
1920                 case WLCCP_TLV_GROUP_MIP:
1921                 {
1922                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type5, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1923                         break;
1924                 } /* case WLCCP_TLV_GROUP_MIP */
1925
1926                 default:
1927                 {
1928                         proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1929                         break;
1930                 } /* case default for switch _group_id */
1931
1932
1933         } /* switch _group_id */
1934
1935         _container_flag = (tvb_get_ntohs(_tvb, _offset) & TLV_F_CONTAINER) >> 15;
1936
1937         /* according to the patent, some behavior changes if the request flag is set */
1938         /* it would be nice if it said how, but I don't think it matters for decoding purposes */
1939
1940         _offset += 2;
1941
1942         /* finished with the flags field */
1943
1944         /* add the length field to the tlv_tree */
1945         proto_tree_add_item(_tlv_tree, hf_wlccp_tlv_length, _tvb, _offset, 2, ENC_BIG_ENDIAN);
1946
1947         _offset += 2;
1948         /* finished with the length field */
1949
1950         /* now decode the fixed fields in each TLV */
1951
1952         switch (_group_id)
1953         {
1954                 case WLCCP_TLV_GROUP_WLCCP:
1955                 {
1956                         _offset = dissect_wlccp_ccm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1957                         break;
1958
1959                 } /* case WLCCP_TLV_GROUP_WLCCP */
1960
1961                 case WLCCP_TLV_GROUP_SEC:
1962                 {
1963                         _offset = dissect_wlccp_sec_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1964                         break;
1965
1966                 } /* case WLCCP_TLV_GROUP_SEC */
1967
1968                 case WLCCP_TLV_GROUP_RRM:
1969                 {
1970                         _offset = dissect_wlccp_rrm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1971                         break;
1972
1973                 } /* case WLCCP_TLV_GROUP_RRM */
1974
1975                 case WLCCP_TLV_GROUP_QOS:
1976                 {
1977                         _offset = dissect_wlccp_qos_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1978                         break;
1979
1980                 } /* case WLCCP_TLV_GROUP_QOS */
1981
1982                 case WLCCP_TLV_GROUP_NM:
1983                 {
1984                         _offset = dissect_wlccp_nm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1985                         break;
1986
1987                 } /* case WLCCP_TLV_GROUP_NM */
1988
1989                 case WLCCP_TLV_GROUP_MIP:
1990                 {
1991                         _offset = dissect_wlccp_mip_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti);
1992                         break;
1993
1994                 } /* case WLCCP_TLV_GROUP_MIP */
1995
1996                 default:
1997                 {
1998                         _offset = _tlv_end;
1999                         break;
2000                 } /* case default for switch _group_id */
2001
2002         } /* switch _group_id */
2003
2004         /* done with decoding the fixed TLV fields */
2005
2006
2007
2008         /* If this TLV is a container, then build a sub tree and decode the contained TLVs */
2009
2010         if (_container_flag && (_offset >= _tlv_end) )
2011         {
2012         /* something is wrong if there's not enough left in the buffer */
2013
2014         } /* if container_flag and _offset >= _tlv_end */
2015         else /* _container_flag && _offset >= tlv_end */
2016         {
2017
2018                 if (_container_flag &&  (_offset < _tlv_end) )
2019                 {
2020
2021                         while (_offset < _tlv_end)
2022                         {
2023                                 _old_offset = _offset;
2024                                 _offset = dissect_wlccp_tlvs(_tlv_tree, _tvb, _offset, _depth++);
2025                                 DISSECTOR_ASSERT(_offset > _old_offset);
2026                         } /* while bytes_left >= 4*/
2027
2028                 } /* _container_flag && (tvb_length_remaining(_tvb,_offset) >= 4) */
2029
2030         } /*_container_flag && (tvb_length_remaining(_tvb,_offset) < 4) */
2031
2032
2033         /* done with decoding the contained TLVs */
2034
2035         return(_tlv_end);
2036
2037 } /* dissect_wlccp_tlvs */
2038
2039
2040 /* ************************************************************************************************************* */
2041
2042 /* ALL THE TLV SUB-DISSECTORS NEED A DEFAULT CASE, OTHERWISE WE'LL GET INTO AN INFINITE RECURSION LOOP INSIDE    */
2043 /* THE CALLING FUNCTION dissect_wlccp_tlvs.  BESIDES, IT'S JUST GOOD FORM :-)                                    */
2044
2045
2046 static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
2047 {
2048
2049         switch (_type_id)
2050         {
2051
2052                 case 0x00:  /* NULL TLV */
2053                 {
2054                         proto_item_append_text(_ti, "     NULL TLV");
2055                         proto_tree_add_item(_tree, hf_wlccp_null_tlv    , _tvb, _offset, _length, ENC_NA);
2056                         _offset += _length;
2057
2058                         break;
2059
2060                 } /* case tlv_type_id = 0x09 */
2061
2062
2063                 case 0x09:  /* ipv4Address */
2064                 {
2065                         proto_item_append_text(_ti, "     IPv4Address");
2066                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2067                         _offset += 4;
2068
2069                         break;
2070
2071                 } /* case tlv_type_id = 0x09 */
2072
2073
2074                 default:
2075                 {
2076                 /* for unknown types, just add them to the tree as a blob */
2077                         proto_item_append_text(_ti, "     Unknown");
2078
2079                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
2080                         _offset += _length;
2081
2082                         break;
2083                 } /* case default for tlv_group_id=0x00  */
2084
2085         } /* switch _type_id */
2086
2087         return(_offset);
2088
2089 } /* dissect_wlccp_ccm_tlv */
2090
2091
2092
2093 static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
2094 {
2095
2096         switch (_type_id)
2097         {
2098
2099                 case 0x01: /* initSession */
2100                 {
2101
2102                         proto_item_append_text(_ti, "     initSession");
2103
2104                         /* skip some unused bytes */
2105                         _offset += 1;
2106
2107                         proto_tree_add_item(_tree, hf_wlccp_path_length, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2108                         _offset += 1;
2109
2110                         /* skip some unused bytes */
2111                         _offset += 2;
2112
2113
2114                         break;
2115                 } /* case 0x01 */
2116
2117                 case 0x02: /* inSecureContextReq */
2118                 {
2119
2120                         proto_item_append_text(_ti, "     inSecureContextReq");
2121
2122                         proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2123                         _offset += 4;
2124
2125                         proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2126                         _offset += 2;
2127
2128                         proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA);
2129                         _offset += 6;
2130
2131                         proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2132                         _offset += 2;
2133
2134                         proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, ENC_NA);
2135                         _offset += 6;
2136
2137                         /* skip unused bytes */
2138                         _offset += 1;
2139
2140                         proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2141                         _offset += 1;
2142
2143                         proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA);
2144                         _offset += 32;
2145
2146                         break;
2147                 } /* case 0x02 */
2148
2149
2150                 case 0x06: /*  authenticator */
2151                 {
2152
2153                         proto_item_append_text(_ti, "     authenticator");
2154
2155                         proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2156                         _offset += 2;
2157
2158                         proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA);
2159                         _offset += 6;
2160
2161                         proto_tree_add_item(_tree, hf_wlccp_src_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2162                         _offset += 2;
2163
2164                         proto_tree_add_item(_tree, hf_wlccp_src_node_id, _tvb, _offset, 6, ENC_NA);
2165                         _offset += 6;
2166
2167                         proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2168                         _offset += 4;
2169
2170                         /* skip unused bytes */
2171                         _offset += 1;
2172
2173                         proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2174                         _offset += 1;
2175
2176                         proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA);
2177                         _offset += 32;
2178
2179                         break;
2180                 } /* case 0x06 */
2181
2182                 case 0x08: /* MIC */
2183                 {
2184
2185                         guint16 _mic_length=0;
2186
2187                         proto_item_append_text(_ti, "     mic");
2188
2189                         proto_tree_add_item(_tree, hf_wlccp_mic_msg_seq_count, _tvb, _offset, 8, ENC_BIG_ENDIAN);
2190                         _offset += 8;
2191
2192                         proto_tree_add_item(_tree, hf_wlccp_mic_length, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2193                         _mic_length = tvb_get_ntohs(_tvb,_offset);
2194                         _offset += 2;
2195
2196                         proto_tree_add_item(_tree, hf_wlccp_mic_value, _tvb, _offset, _mic_length, ENC_NA);
2197                         _offset += _mic_length;
2198
2199                         break;
2200                 }
2201
2202                 case 0x0a: /* inSecureContextReply */
2203                 {
2204
2205                         proto_item_append_text(_ti, "     inSecureContextReply");
2206
2207
2208                         proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2209                         _offset += 4;
2210
2211                         proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2212                         _offset += 2;
2213
2214                         proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA);
2215                         _offset += 6;
2216
2217                         proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2218                         _offset += 2;
2219
2220                         proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, ENC_NA);
2221                         _offset += 6;
2222
2223                         proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA);
2224                         _offset += 32;
2225
2226                         proto_tree_add_item(_tree, hf_wlccp_session_timeout, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2227                         _offset += 4;
2228
2229                         break;
2230                 } /* case 0x0a */
2231
2232
2233
2234                 default:
2235                 {
2236                 /* for unknown types, just add them to the tree as a blob */
2237                         proto_item_append_text(_ti, "     Unknown");
2238                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
2239                         _offset += _length;
2240
2241                         break;
2242                 } /* default case for switch (_type_id) */
2243
2244         } /* switch _type_id */
2245
2246         return(_offset);
2247 } /* dissect_wlccp_sec_tlv */
2248
2249
2250
2251 static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
2252 {
2253
2254         switch (_type_id)
2255         {
2256
2257                 case 0x02: /* aggrRmReq */
2258                 {
2259                         proto_item_append_text(_ti, "     aggrRmReq");
2260                         proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2261                         _offset += 2;
2262
2263                         proto_tree_add_item(_tree, hf_wlccp_interval, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2264                         _offset += 2;
2265
2266                         break;
2267
2268                 } /* case tlv_type_id = 0x02 */
2269
2270                 case 0x03 : /* rmReport */
2271                 {
2272                         proto_item_append_text(_ti, "     rmReport");
2273
2274                         proto_tree_add_item(_tree, hf_wlccp_sta_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2275                         _offset += 1;
2276
2277                         proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2278                         _offset += 6;
2279
2280                         proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA);
2281                         _offset += 6;
2282
2283                         break;
2284                 } /* case tlv_type_id = 0x03 */
2285
2286                 case 0x04: /* aggrRmReport */
2287                 {
2288                         proto_item_append_text(_ti, "     aggrRmReport");
2289
2290                         /* no fields */
2291
2292                         break;
2293                 } /* case tlv_type_id = 0x04 */
2294
2295                 case 0x12: /* beaconRequest */
2296                 {
2297                         proto_item_append_text(_ti, "     beaconRequest");
2298
2299                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2300                         _offset += 1;
2301
2302                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2303                         _offset += 1;
2304
2305                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2306                         _offset += 1;
2307
2308                         proto_tree_add_item(_tree, hf_wlccp_scan_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2309                         _offset += 1;
2310
2311                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2312                         _offset += 2;
2313
2314
2315                         break;
2316                 } /* case 0x12 */
2317
2318                 case 0x14: /* frameRequest */
2319                 {
2320
2321                         guint _count=0, _counter=0;
2322
2323                         proto_item_append_text(_ti, "     frameRequest");
2324
2325                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2326                         _offset += 1;
2327
2328                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2329                         _offset += 1;
2330
2331                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2332                         _offset += 1;
2333
2334                         proto_tree_add_item(_tree, hf_wlccp_count, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2335                         _count = tvb_get_guint8(_tvb,_offset);
2336                         _offset += 1;
2337
2338                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2339                         _offset += 2;
2340
2341                         for (_counter=0; _counter < _count; _counter++)
2342                         {
2343
2344                                 proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2345                                 _offset += 6;
2346
2347                         } /* for _counter=0 */
2348
2349
2350
2351                         break;
2352                 } /* case 0x14 */
2353
2354                 case 0x15: /* frameReport */
2355                 {
2356
2357                         proto_item *_fr_ti;
2358                         proto_tree *_fr_elems_tree;
2359
2360                         guint _counter=0, _arraylen=0;
2361
2362                         proto_item_append_text(_ti, "     frameReport");
2363
2364                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2365                         _offset += 1;
2366
2367                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2368                         _offset += 1;
2369
2370                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2371                         _offset += 1;
2372
2373                         /* skip some unused bytes */
2374                         _offset += 1;
2375
2376                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2377                         _offset += 2;
2378
2379                         _arraylen=(_length-10)/14;
2380
2381                         if (_arraylen > 0)
2382                         {
2383
2384                                 _fr_ti = proto_tree_add_item(_tree, hf_framereport_elements, _tvb, _offset, (_length-10), ENC_NA);
2385                                 _fr_elems_tree = proto_item_add_subtree(_fr_ti, ett_framereport_elements_tree);
2386
2387                                 for(_counter=0; _counter < _arraylen; _counter++)
2388                                 {
2389
2390                                         proto_tree_add_item(_fr_elems_tree, hf_wlccp_numframes, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2391                                         _offset += 1;
2392
2393                                         proto_tree_add_item(_fr_elems_tree, hf_wlccp_rss, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2394                                         _offset += 1;
2395
2396                                         proto_tree_add_item(_fr_elems_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2397                                         _offset += 6;
2398
2399                                         proto_tree_add_item(_fr_elems_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA);
2400                                         _offset += 6;
2401
2402                                 } /* for _counter=0 */
2403
2404                         } /* if _arraylen > 0 */
2405
2406
2407                         break;
2408                 } /* case 0x15 */
2409
2410
2411                 case 0x16: /* ccaRequest */
2412                 {
2413                         proto_item_append_text(_ti, "     ccaRequest");
2414
2415                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2416                         _offset += 1;
2417
2418                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2419                         _offset += 1;
2420
2421                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2422                         _offset += 1;
2423
2424                         /* skip some unused bytes */
2425                         _offset += 1;
2426
2427                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2428                         _offset += 2;
2429
2430                         break;
2431                 } /* case 0x16 */
2432
2433
2434                 case 0x17:  /* ccaReport */
2435                 {
2436                         proto_item_append_text(_ti, "     ccaReport");
2437
2438                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2439                         _offset += 1;
2440
2441                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2442                         _offset += 1;
2443
2444                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2445                         _offset += 1;
2446
2447                         /* skip some unused bytes */
2448                         _offset += 1;
2449
2450                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2451                         _offset += 2;
2452
2453                         proto_tree_add_item(_tree, hf_wlccp_ccabusy, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2454                         _offset += 1;
2455
2456                         break;
2457
2458                 } /* case tlv_type_id = 0x17 */
2459
2460                 case 0x18: /* rpiHistRequest */
2461                 {
2462                         proto_item_append_text(_ti, "     rpiHistRequest");
2463
2464                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2465                         _offset += 1;
2466
2467                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2468                         _offset += 1;
2469
2470                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2471                         _offset += 1;
2472
2473                         /* skip some unused bytes */
2474                         _offset += 1;
2475
2476                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2477                         _offset += 2;
2478
2479                         break;
2480                 } /* case 0x18 */
2481
2482                 case 0x19: /* rpiHistReport */
2483                 {
2484
2485                         guint _rpi_density_length=0;
2486
2487                         proto_item_append_text(_ti, "     rpiHistReport");
2488
2489                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2490                         _offset += 1;
2491
2492                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2493                         _offset += 1;
2494
2495                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2496                         _offset += 1;
2497
2498                         /* skip some unused bytes */
2499                         _offset += 1;
2500
2501                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2502                         _offset += 2;
2503
2504                         _rpi_density_length = _length - 6 - 4;
2505
2506                         proto_tree_add_item(_tree, hf_wlccp_rpidensity, _tvb, _offset, _rpi_density_length, ENC_NA);
2507                         _offset += _rpi_density_length;
2508
2509                         break;
2510
2511                 } /* case tlv_type_id = 0x19 */
2512
2513                 case 0x1c: /* nullRequest */
2514                 {
2515                         proto_item_append_text(_ti, "     nullRequest");
2516
2517                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2518                         _offset += 1;
2519
2520                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2521                         _offset += 1;
2522
2523                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2524                         _offset += 1;
2525
2526                         /* skip some unused bytes */
2527                         _offset += 1;
2528
2529                         proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2530                         _offset += 2;
2531
2532                         break;
2533                 } /* case 0x1c */
2534
2535
2536                 case 0x1e: /* commonBeaconReport */
2537                 {
2538
2539                         proto_tree *_80211_capabilities_tree;
2540                         proto_item *_new_ti;
2541
2542                         guint _tlv80211length=0;
2543
2544                         proto_item_append_text(_ti, "     commonBeaconReport");
2545
2546                         proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2547                         _offset += 1;
2548
2549                         proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2550                         _offset += 1;
2551
2552                         proto_tree_add_item(_tree, hf_wlccp_phy_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2553                         _offset += 1;
2554
2555                         proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2556                         _offset += 6;
2557
2558                         proto_tree_add_item(_tree, hf_wlccp_beacon_interval, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2559                         _offset += 2;
2560
2561
2562                         /*
2563                         if we assume the next field is the capabilities field from the 802.11 beacon,
2564                         then we have a 16-bit field thhf_wlccp_statusat contains the following (802.11-2007):
2565                         bit 0 = ESS
2566                         bit 1 = IBSS
2567                         bit 2 = CF pollable
2568                         bit 3 = CF Poll Request
2569                         bit 4 = privacy
2570                         bit 5 = Short Preamble
2571                         bit 6 = PBCC
2572                         bit 7 = Channel Agility
2573                         bit 8 = Spectrum Management
2574                         bit 9 = QoS
2575                         bit 10 = Short Slot Time
2576                         bit 11 = APSD
2577                         bit 12 = Reserved
2578                         bit 13 = DSSS-OFDM
2579                         bit 14 = Delayed Block Ack
2580                         bit 15 = Immediate Block Ack
2581                         */
2582
2583                         _new_ti = proto_tree_add_item(_tree, hf_wlccp_80211_capabilities,
2584                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2585                         _80211_capabilities_tree = proto_item_add_subtree(_new_ti, ett_80211_capability_flags_tree);
2586
2587                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_imm_block_ack,
2588                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2589                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_dlyd_block_ack,
2590                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2591                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_dsss_ofdm,
2592                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2593                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_reserved,
2594                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2595                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_apsd,
2596                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2597                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_time_slot,
2598                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2599                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_qos,
2600                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2601                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_spectrum_mgmt,
2602                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2603                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_chan_agility,
2604                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2605                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_pbcc,
2606                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2607                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_preamble,
2608                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2609                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_privacy,
2610                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2611                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_poll_req,
2612                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2613                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_pollable,
2614                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2615                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ibss,
2616                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);
2617                         proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ess,
2618                                         _tvb, _offset, 2, ENC_BIG_ENDIAN);;
2619
2620                         /* proto_tree_add_item(_tree, hf_wlccp_capabilities, _tvb, _offset, 2, ENC_BIG_ENDIAN); */
2621                         _offset += 2;
2622
2623
2624                         _tlv80211length = _length - 13 - 4;
2625
2626                         /* This TLV could be decoded per the 802.11 information element spec's */
2627                         proto_tree_add_item(_tree, hf_wlccp_tlv80211, _tvb, _offset, _tlv80211length, ENC_NA);
2628                         _offset += _tlv80211length;
2629
2630                         break;
2631
2632                 } /* case tlv_type_id = 0x1e */
2633
2634
2635                 case 0x1f: /* aggrBeaconReport */
2636                 {
2637                         proto_item_append_text(_ti, "     aggrBeaconReport");
2638
2639                         proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2640                         _offset += 1;
2641
2642                         proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2643                         _offset += 1;
2644
2645                         proto_tree_add_item(_tree, hf_wlccp_rss, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2646                         _offset += 1;
2647
2648                         proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2649                         _offset += 1;
2650
2651                         proto_tree_add_item(_tree, hf_wlccp_parent_tsf, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2652                         _offset += 4;
2653
2654                         proto_tree_add_item(_tree, hf_wlccp_target_tsf, _tvb, _offset, 8, ENC_BIG_ENDIAN);
2655                         _offset += 8;
2656
2657                         break;
2658                 } /* case tlv_type_id = 0x1f */
2659
2660
2661                 case 0x20: /* rmReqRoutingList */
2662                 {
2663
2664                         guint _counter=0, _arraylen=0;
2665
2666                         proto_item_append_text(_ti, "     rmReqRoutingList");
2667
2668                         _arraylen=(_length)/16;
2669
2670                         if (_arraylen > 0)
2671                         {
2672
2673                                 for(_counter=0; _counter < _arraylen; _counter++)
2674                                 {
2675
2676                                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2677                                         _offset += 4;
2678
2679                                         proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2680                                         _offset += 6;
2681
2682                                         proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA);
2683                                         _offset += 6;
2684
2685                                 } /* for _counter=0 */
2686
2687                         } /* if _arraylen > 0 */
2688                         break;
2689                 } /* case 0x20 */
2690
2691                 case 0x21: /* rmReqRoutingResp */
2692                 {
2693
2694                         guint _counter=0, _arraylen=0;
2695
2696                         proto_item_append_text(_ti, "     rmReqRoutingResp");
2697
2698                         proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2699                         _offset += 2;
2700
2701                         _arraylen=(_length)/11;
2702
2703                         if (_arraylen > 0)
2704                         {
2705
2706                                 for(_counter=0; _counter < _arraylen; _counter++)
2707                                 {
2708
2709                                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2710                                         _offset += 4;
2711
2712                                         proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2713                                         _offset += 6;
2714
2715                                         proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2716                                         _offset += 1;
2717
2718                                 } /* for _counter=0 */
2719
2720                         } /* if _arraylen > 0 */
2721
2722                         break;
2723                 } /* case 0x21 */
2724
2725                 case 0x22: /* rmReqAck */
2726                 {
2727                         proto_item_append_text(_ti, "     rmReqAck");
2728
2729                         proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2730                         _offset += 1;
2731
2732                         break;
2733                 } /* case 0x22 */
2734
2735
2736                 case 0x58: /* mfpCapability */
2737                 {
2738                         proto_item_append_text(_ti, "     mfpCapability");
2739
2740                         proto_tree_add_item(_tree, hf_wlccp_mfpcapability, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2741                         _offset += 2;
2742
2743                         break;
2744                 } /* case 0x58 */
2745
2746                 case 0x5b: /* mfpRouting */
2747                 {
2748                         proto_item_append_text(_ti, "     mfpRouting");
2749
2750                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2751                         _offset += 4;
2752
2753                         proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA);
2754                         _offset += 6;
2755
2756                         proto_tree_add_item(_tree, hf_wlccp_mfpflags, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2757                         _offset += 2;
2758
2759                         break;
2760                 } /* case 0x5b */
2761
2762                 case 0x5c: /* mfpConfig */
2763                 {
2764                         proto_item_append_text(_ti, "     mfpConfig");
2765
2766                         proto_tree_add_item(_tree, hf_wlccp_mfpconfig, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2767                         _offset += 2;
2768
2769                         break;
2770                 } /* case 0x5c */
2771
2772
2773                 default:
2774                 {
2775                 /* for unknown types, just add them to the tree as a blob */
2776                         proto_item_append_text(_ti, "     Unknown");
2777
2778                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
2779                         _offset += _length;
2780
2781                 break;
2782                 } /* case default  */
2783
2784         } /* switch type_id */
2785
2786         return(_offset);
2787
2788 } /* dissect_wlccp_rrm_tlv */
2789
2790 static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
2791 {
2792
2793         switch (_type_id)
2794         {
2795
2796                 default:
2797                 {
2798                 /* for unknown types, just add them to the tree as a blob */
2799                         proto_item_append_text(_ti, "     Unknown");
2800
2801                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
2802                         _offset += _length;
2803
2804                         break;
2805                 } /* default case for switch (_type_id) */
2806
2807         } /* switch _type_id */
2808
2809
2810         return(_offset);
2811
2812 } /* dissect_wlccp_qos_tlv */
2813
2814 static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
2815 {
2816
2817         switch (_type_id)
2818         {
2819
2820                 case 0x20: /* nmClientEventIntoWDS */
2821                 {
2822
2823                         guint _radius_user_name_length = 0;
2824
2825                         proto_item_append_text(_ti, "     nmClientEventIntoWDS");
2826
2827                         proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA);
2828                         _offset += 6;
2829
2830                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2831                         _offset += 2;
2832
2833                         proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA);
2834                         _offset += 6;
2835
2836                         proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2837                         _offset += 1;
2838
2839                         /* skip some unused bytes */
2840                         _offset += 1;
2841
2842                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2843                         _offset += 4;
2844
2845                         proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2846                         _offset += 1;
2847
2848                         proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2849                         _offset += 1;
2850
2851                         /* skip some unused bytes */
2852                         _offset += 1;
2853
2854                         _radius_user_name_length = _length - 23 - 4;
2855
2856                         proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, ENC_ASCII|ENC_NA);
2857                         _offset += _radius_user_name_length;
2858
2859
2860                         break;
2861                 } /* case 0x20 */
2862
2863                 case 0x21: /* nmClientEventOutOfWDS */
2864                 {
2865                         proto_item_append_text(_ti, "     nmClientEventOutOfWDS");
2866
2867                         proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA);
2868                         _offset += 6;
2869
2870                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2871                         _offset += 2;
2872
2873                         proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA);
2874                         _offset += 6;
2875
2876                         proto_tree_add_item(_tree, hf_wds_reason, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2877                         _offset += 1;
2878
2879                         /* skip some unused bytes */
2880                         _offset += 1;
2881
2882                         break;
2883                 } /* case 0x21 */
2884
2885                 case 0x22: /* nmClientEventIntraWDS */
2886                 {
2887                         proto_item_append_text(_ti, "     nmClientEventIntraWDS");
2888
2889                         proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA);
2890                         _offset += 6;
2891
2892                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2893                         _offset += 2;
2894
2895                         proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA);
2896                         _offset += 6;
2897
2898                         proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2899                         _offset += 1;
2900
2901                         proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2902                         _offset += 1;
2903
2904                         proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2905                         _offset += 1;
2906
2907                         /* skip some unused bytes */
2908                         _offset += 3;
2909
2910
2911                         break;
2912                 } /* case 0x22 */
2913
2914                 case 0x24: /* nmClientEventIPAddressUpdate */
2915                 {
2916                         proto_item_append_text(_ti, "     nmClientEventIPAddressUpdate");
2917
2918                         proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA);
2919                         _offset += 6;
2920
2921                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2922                         _offset += 2;
2923
2924                         proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA);
2925                         _offset += 6;
2926
2927                         /* skip some unused bytes */
2928                         _offset += 2;
2929
2930                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2931                         _offset += 4;
2932
2933
2934                         break;
2935                 } /* case 0x24 */
2936
2937                 case 0x26: /* nmClientEventRefresh */
2938                 {
2939
2940                         guint _radius_user_name_length = 0;
2941
2942                         proto_item_append_text(_ti, "     nmClientEventRefresh");
2943
2944                         proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA);
2945                         _offset += 6;
2946
2947                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2948                         _offset += 2;
2949
2950                         proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA);
2951                         _offset += 6;
2952
2953                         proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2954                         _offset += 1;
2955
2956                         /* skip some unused bytes */
2957                         _offset += 1;
2958
2959                         proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2960                         _offset += 4;
2961
2962                         proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2963                         _offset += 1;
2964
2965                         proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN);
2966                         _offset += 1;
2967
2968                         /* skip some unused bytes */
2969                         _offset += 1;
2970
2971                         _radius_user_name_length = _length - 23 - 4;
2972
2973                         proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, ENC_ASCII|ENC_NA);
2974                         _offset += _radius_user_name_length;
2975
2976                         break;
2977                 } /* case 0x26 */
2978
2979                 case 0x27: /* nmClientEventRefreshDone */
2980                 {
2981                         proto_item_append_text(_ti, "     nmClientEventRefreshDone");
2982
2983                         /* skip some unused bytes */
2984                         _offset += 6;
2985
2986                         proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN);
2987                         _offset += 2;
2988
2989                         proto_tree_add_item(_tree, hf_wlccp_refresh_req_id, _tvb, _offset, 4, ENC_BIG_ENDIAN);
2990                         _offset += 4;
2991
2992
2993                         break;
2994                 } /* case 0x27 */
2995
2996
2997                 default:
2998                 {
2999                 /* for unknown types, just add them to the tree as a blob */
3000                         proto_item_append_text(_ti, "     Unknown");
3001
3002                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
3003                         _offset += _length;
3004
3005                         break;
3006                 } /* default case for switch (_type_id) */
3007
3008         } /* switch _type_id */
3009
3010
3011         return(_offset);
3012
3013 } /* dissect_wlccp_nm_tlv */
3014
3015 static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti)
3016 {
3017
3018         switch (_type_id)
3019         {
3020
3021
3022                 default:
3023                 {
3024                 /* for unknown types, just add them to the tree as a blob */
3025                         proto_item_append_text(_ti, "     Unknown");
3026
3027                         proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA);
3028                         _offset += _length;
3029
3030                         break;
3031                 } /* default case for switch (_type_id) */
3032
3033         } /* switch _type_id */
3034
3035
3036         return(_offset);
3037
3038 } /* dissect_wlccp_mip_tlv */
3039
3040
3041 /* Register the protocol with Wireshark */
3042 void
3043 proto_register_wlccp(void)
3044 {
3045         /* Setup list of header fields  See Section 1.6.1 for details*/
3046         static hf_register_info hf[] = {
3047                 { &hf_wlccp_version,
3048                   { "Version", "wlccp.version",
3049                     FT_UINT8, BASE_HEX, NULL,
3050                     0x0, "Protocol ID/Version", HFILL }
3051                 },
3052
3053                 { &hf_wlccp_srcmac,
3054                   { "Src MAC", "wlccp.srcmac",
3055                     FT_ETHER, BASE_NONE, NULL,
3056                     0x0, "Source MAC address", HFILL }
3057                 },
3058
3059                 { &hf_wlccp_dstmac,
3060                   { "Dst MAC", "wlccp.dstmac",
3061                     FT_ETHER, BASE_NONE, NULL,
3062                     0x0, "Destination MAC address", HFILL }
3063                 },
3064
3065                 { &hf_wlccp_hostname,
3066                   { "Hostname", "wlccp.hostname",
3067                     FT_STRING, BASE_NONE, NULL,
3068                     0x0, "Hostname of device", HFILL }
3069                 },
3070
3071                 { &hf_wlccp_sap,
3072                   { "SAP", "wlccp.sap",
3073                     FT_UINT8, BASE_HEX, NULL,
3074                     0x0, "Service Access Point", HFILL }
3075                 },
3076
3077                 { &hf_wlccp_sap_version,
3078                   { "SAP Version", "wlccp.sap_version",
3079                     FT_UINT8, BASE_DEC, NULL,
3080                     SAP_VERSION_MASK, "Service Access Point Version", HFILL }
3081                 },
3082
3083                 { &hf_wlccp_sap_id,
3084                   { "SAP ID", "wlccp.sap_id",
3085                     FT_UINT8, BASE_DEC, VALS(wlccp_sap_vs),
3086                     SAP_VALUE_MASK, "Service Access Point ID", HFILL }
3087                 },
3088
3089                 { &hf_wlccp_destination_node_type,
3090                   { "Destination node type", "wlccp.destination_node_type",
3091                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3092                     0x0, "Node type of the hop destination", HFILL }
3093                 },
3094
3095                 { &hf_wlccp_length,
3096                   { "Length", "wlccp.length",
3097                     FT_UINT16, BASE_DEC, NULL,
3098                     0x0, "Length of WLCCP payload (bytes)", HFILL }
3099                 },
3100
3101
3102                 { &hf_wlccp_type,
3103                   { "Message Type", "wlccp.type",
3104                     FT_UINT8, BASE_HEX, NULL,
3105                     0x0, NULL, HFILL }
3106                 },
3107
3108                 { &hf_wlccp_subtype,
3109                   { "Subtype", "wlccp.subtype",
3110                     FT_UINT8, BASE_DEC, VALS(wlccp_subtype_vs),
3111                     MT_SUBTYPE, "Message Subtype", HFILL }
3112                 },
3113
3114                 { &hf_wlccp_base_message_type_0,
3115                   { "Base message type", "wlccp.base_message_type",
3116                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_0),
3117                     MT_BASE_MSG_TYPE, NULL, HFILL }
3118                 },
3119
3120                 { &hf_wlccp_base_message_type_1,
3121                   { "Base message type", "wlccp.base_message_type",
3122                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_1),
3123                     MT_BASE_MSG_TYPE, NULL, HFILL }
3124                 },
3125
3126                 { &hf_wlccp_base_message_type_2,
3127                   { "Base message type", "wlccp.base_message_type",
3128                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_2),
3129                     MT_BASE_MSG_TYPE, NULL, HFILL }
3130                 },
3131
3132                 { &hf_wlccp_base_message_type_3,
3133                   { "Base message type", "wlccp.base_message_type",
3134                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_3),
3135                     MT_BASE_MSG_TYPE, NULL, HFILL }
3136                 },
3137
3138                 { &hf_wlccp_base_message_type_4,
3139                   { "Base message type", "wlccp.base_message_type",
3140                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_4),
3141                     MT_BASE_MSG_TYPE, NULL, HFILL }
3142                 },
3143
3144                 { &hf_wlccp_base_message_type_5,
3145                   { "Base message type", "wlccp.base_message_type",
3146                     FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_5),
3147                     MT_BASE_MSG_TYPE, NULL, HFILL }
3148                 },
3149
3150                 { &hf_wlccp_base_message_type_unknown,
3151                   { "Base message type", "wlccp.base_message_type",
3152                     FT_UINT8, BASE_HEX_DEC, NULL,
3153                     MT_BASE_MSG_TYPE, NULL, HFILL }
3154                 },
3155
3156                 { &hf_wlccp_hops,
3157                   { "Hops", "wlccp.hops",
3158                     FT_UINT8, BASE_DEC, NULL,
3159                     0x0, "Number of WLCCP hops", HFILL }
3160                 },
3161
3162                 { &hf_wlccp_nm_version,
3163                   { "NM Version", "wlccp.nm_version",
3164                     FT_UINT8, BASE_DEC, NULL,
3165                     0x0, NULL, HFILL }
3166                 },
3167
3168                 { &hf_wlccp_msg_id,
3169                   { "Message ID", "wlccp.msg_id",
3170                     FT_UINT16, BASE_DEC, NULL,
3171                     0x0, "Sequence number used to match request/reply pairs",
3172                     HFILL }
3173                 },
3174
3175
3176                 { &hf_wlccp_flags,
3177                   { "Flags", "wlccp.flags",
3178                     FT_UINT16, BASE_HEX, NULL,
3179                     0x0, NULL, HFILL }
3180                 },
3181
3182                 { &hf_wlccp_rm_flags,
3183                   { "RM Flags", "wlccp.rm_flags",
3184                     FT_UINT8, BASE_HEX, NULL,
3185                     0x0, NULL, HFILL }
3186                 },
3187
3188                 { &hf_wlccp_retry_flag,
3189                   { "Retry flag", "wlccp.retry_flag",
3190                     FT_UINT16, BASE_DEC, NULL,
3191                     F_RETRY, "Set on for retransmissions", HFILL }
3192                 },
3193
3194                 { &hf_wlccp_response_request_flag,
3195                   { "Response request flag", "wlccp.response_request_flag",
3196                     FT_UINT16, BASE_DEC, NULL,
3197                     F_RESPONSE_REQUEST, "Set on to request a reply", HFILL }
3198                 },
3199
3200                 { &hf_wlccp_rm_request_reply_flag,
3201                   { "Request Reply flag", "wlccp.request_reply_flag",
3202                     FT_UINT8, BASE_DEC, NULL,
3203                     RM_F_REQUEST_REPLY, "Set on to request a reply", HFILL }
3204                 },
3205
3206                 { &hf_wlccp_ack_required_flag,
3207                   { "Ack Required flag", "wlccp.ack_required_flag",
3208                     FT_UINT16, BASE_DEC, NULL,
3209                     F_ACK_REQD, "Set on to require an acknowledgement", HFILL }
3210                 },
3211
3212                 { &hf_wlccp_tlv_flag,
3213                   { "TLV flag", "wlccp.tlv_flag",
3214                     FT_UINT16, BASE_DEC, NULL,
3215                     F_TLV, "Set to indicate that optional TLVs follow the fixed fields", HFILL }
3216                 },
3217
3218                 { &hf_wlccp_inbound_flag,
3219                   { "Inbound flag", "wlccp.inbound_flag",
3220                     FT_UINT16, BASE_DEC, NULL,
3221                     F_INBOUND, "Message is inbound to the top of the topology tree", HFILL }
3222                 },
3223
3224                 { &hf_wlccp_outbound_flag,
3225                   { "Outbound flag", "wlccp.outbound_flag",
3226                     FT_UINT16, BASE_DEC, NULL,
3227                     F_OUTBOUND, "Message is outbound from the top of the topology tree", HFILL }
3228                 },
3229
3230                 { &hf_wlccp_hopwise_routing_flag,
3231                   { "Hopwise-routing flag", "wlccp.hopwise_routing_flag",
3232                     FT_UINT16, BASE_DEC, NULL,
3233                     F_HOPWISE_ROUTING, "On to force intermediate access points to process the message also", HFILL }
3234                 },
3235
3236                 { &hf_wlccp_root_cm_flag,
3237                   { "Root context manager flag", "wlccp.root_cm_flag",
3238                     FT_UINT16, BASE_DEC, NULL,
3239                     F_ROOT_CM, "Set to on to send message to the root context manager of the topology tree", HFILL }
3240                 },
3241
3242                 { &hf_wlccp_relay_flag,
3243                   { "Relay flag", "wlccp.relay_flag",
3244                     FT_UINT16, BASE_DEC, NULL,
3245                     F_RELAY, "Signifies that this header is immediately followed by a relay node field", HFILL }
3246                 },
3247
3248                 { &hf_wlccp_mic_flag,
3249                   { "MIC flag", "wlccp.mic_flag",
3250                     FT_UINT16, BASE_DEC, NULL,
3251                     F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL }
3252                 },
3253
3254                 { &hf_wlccp_rm_mic_flag,
3255                   { "MIC flag", "wlccp.mic_flag",
3256                     FT_UINT8, BASE_DEC, NULL,
3257                     RM_F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL }
3258                 },
3259
3260                 { &hf_wlccp_originator_node_type,
3261                   { "Originator node type", "wlccp.originator_node_type",
3262                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3263                     0x0, "Originating device's node type", HFILL }
3264                 },
3265
3266                 { &hf_wlccp_originator,
3267                   { "Originator", "wlccp.originator",
3268                     FT_ETHER, BASE_NONE, NULL,
3269                     0x0, "Originating device's MAC address", HFILL }
3270                 },
3271
3272                 { &hf_wlccp_responder_node_type,
3273                   { "Responder node type", "wlccp.responder_node_type",
3274                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3275                     0x0, "Responding device's node type", HFILL }
3276                 },
3277
3278                 { &hf_wlccp_responder,
3279                   { "Responder", "wlccp.responder",
3280                     FT_ETHER, BASE_NONE, NULL,
3281                     0x0, "Responding device's MAC address", HFILL }
3282                 },
3283
3284                 { &hf_wlccp_requ_node_type,
3285                   { "Requestor node type", "wlccp.requ_node_type",
3286                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3287                     0x0, "Requesting device's node type", HFILL }
3288                 },
3289
3290                 { &hf_wlccp_requ_node_id,
3291                   { "Requestor", "wlccp.requestor",
3292                     FT_ETHER, BASE_NONE, NULL,
3293                     0x0, "Requestor device's MAC address", HFILL }
3294                 },
3295
3296                 { &hf_wlccp_status,
3297                   { "Status", "wlccp.status",
3298                     FT_UINT8, BASE_DEC, VALS(wlccp_status_vs),
3299                     0x0, NULL, HFILL }
3300                 },
3301
3302                 { &hf_wlccp_path_init_rsvd,
3303                   { "Reserved", "wlccp.path_init_reserved",
3304                     FT_UINT8, BASE_DEC, NULL,
3305                     0x0, NULL, HFILL }
3306                 },
3307
3308                 { &hf_wlccp_relay_node_type,
3309                   { "Relay node type", "wlccp.relay_node_type",
3310                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3311                     0x0, "Type of node which relayed this message", HFILL }
3312                 },
3313
3314                 { &hf_wlccp_relay_node_id,
3315                   { "Relay node ID", "wlccp.relay_node_id",
3316                     FT_ETHER, BASE_NONE, NULL,
3317                     0x0, "Node which relayed this message", HFILL }
3318                 },
3319
3320                 { &hf_wlccp_priority,
3321                   { "WDS priority", "wlccp.priority",
3322                     FT_UINT8, BASE_DEC, NULL, 0,
3323                     "WDS priority of this access point", HFILL }
3324                 },
3325
3326                 { &hf_wlccp_age,
3327                   { "Age", "wlccp.age",
3328                     FT_UINT32, BASE_DEC, NULL, 0,
3329                     "Time since AP became a WDS master", HFILL }
3330                 },
3331
3332                 { &hf_wlccp_period,
3333                   { "Period", "wlccp.period",
3334                     FT_UINT8, BASE_DEC, NULL, 0,
3335                     "Interval between announcements (seconds)", HFILL }
3336                 },
3337
3338                 { &hf_wlccp_ipv4_address,
3339                   { "IPv4 Address", "wlccp.ipv4_address",
3340                     FT_IPv4, BASE_NONE, NULL, 0,
3341                     NULL, HFILL }
3342                 },
3343
3344                 { &hf_wlccp_scm_hop_address,
3345                   { "Hop Address", "wlccp.scm_hop_address",
3346                     FT_ETHER, BASE_NONE, NULL,
3347                     0x0, "Source 802 Port Address", HFILL }
3348                 },
3349
3350                 { &hf_wlccp_scm_flags,
3351                   { "SCM flags", "wlccp.scm_flags",
3352                     FT_UINT16, BASE_HEX, NULL,
3353                     0x0, NULL, HFILL }
3354                 },
3355
3356                 { &hf_wlccp_scm_active_flag,
3357                   { "Active flag", "wlccp.scm_active_flag",
3358                     FT_UINT16, BASE_DEC, NULL,
3359                     F_SCM_ACTIVE, "Set to on in advertisements from the active SCM", HFILL }
3360                 },
3361
3362                 { &hf_wlccp_scm_unscheduled_flag,
3363                   { "Unscheduled flag", "wlccp.scm_unscheduled_flag",
3364                     FT_UINT16, BASE_DEC, NULL,
3365                     F_SCM_UNSCHEDULED, "Set to on in unscheduled advertisement messages", HFILL }
3366                 },
3367
3368                 { &hf_wlccp_scm_unattached_flag,
3369                   { "Unattached flag", "wlccp.scm_unattached_flag",
3370                     FT_UINT16, BASE_DEC, NULL,
3371                     F_SCM_UNATTACHED, "Set to on in advertisements from an unattached node", HFILL }
3372                 },
3373
3374                 { &hf_wlccp_scm_layer2update_flag,
3375                   { "Layer2 Update flag", "wlccp.scm_layer2update_flag",
3376                     FT_UINT16, BASE_DEC, NULL,
3377                     F_SCM_LAYER2UPDATE, "Set to on if WLCCP Layer 2 path updates are enabled", HFILL }
3378                 },
3379
3380                 { &hf_wlccp_scm_election_group,
3381                   { "SCM Election Group", "wlccp.scm_election_group",
3382                     FT_UINT8, BASE_DEC, NULL, 0,
3383                     NULL, HFILL }
3384                 },
3385
3386                 { &hf_wlccp_scm_attach_count,
3387                   { "Attach Count", "wlccp.scm_attach_count",
3388                     FT_UINT8, BASE_DEC, NULL, 0,
3389                     "Attach count of the hop source", HFILL }
3390                 },
3391
3392                 { &hf_wlccp_scm_priority_flags,
3393                   { "SCM Priority flags", "wlccp.scm_priority_flags",
3394                     FT_UINT8, BASE_HEX, NULL, 0,
3395                     NULL, HFILL }
3396                 },
3397
3398                 { &hf_wlccp_scm_priority,
3399                   { "SCM Priority", "wlccp.scm_priority",
3400                     FT_UINT8, BASE_DEC, NULL,
3401                     F_SCM_PRIORITY, NULL, HFILL }
3402                 },
3403
3404                 { &hf_wlccp_scm_preferred_flag,
3405                   { "Preferred flag", "wlccp.scm_preferred_flag",
3406                     FT_UINT8, BASE_DEC, NULL,
3407                     F_SCM_PREFERRED, "Set to off if the SCM is the preferred SCM", HFILL }
3408                 },
3409
3410                 { &hf_wlccp_scm_bridge_priority_flags,
3411                   { "Bridge Priority flags", "wlccp.scm_bridge_priority_flags",
3412                     FT_UINT8, BASE_DEC, NULL, 0,
3413                     NULL, HFILL }
3414                 },
3415
3416                 { &hf_wlccp_scm_bridge_priority,
3417                   { "Bridge priority", "wlccp.scm_bridge_priority",
3418                     FT_UINT8, BASE_DEC, NULL,
3419                     F_SCM_BRIDGE_PRIORITY, "Used to negotiate the designated bridge on a non-STP secondary Ethernet LAN", HFILL }
3420                 },
3421
3422                 { &hf_wlccp_scm_bridge_disable_flag,
3423                   { "Bridge disable flag", "wlccp.scm_bridge_disable_flag",
3424                     FT_UINT8, BASE_DEC, NULL,
3425                     F_SCM_BRIDGE_DISABLE, "Set to on to indicate that secondary briding is disabled", HFILL }
3426                 },
3427
3428                 { &hf_wlccp_scm_node_id,
3429                   { "SCM Node ID", "wlccp.scm_node_id",
3430                     FT_ETHER, BASE_NONE, NULL,
3431                     0x0, "Node ID of the SCM", HFILL }
3432                 },
3433
3434                 { &hf_wlccp_scm_unknown_short,
3435                   { "Unknown Short", "wlccp.scm_unknown_short",
3436                     FT_UINT16, BASE_HEX, NULL,
3437                     0x0, "SCM Unknown Short Value", HFILL }
3438                 },
3439
3440                 { &hf_wlccp_scm_instance_age,
3441                   { "Instance Age", "wlccp.scm_instance_age",
3442                     FT_UINT32, BASE_DEC, NULL, 0,
3443                     "Instance age of the SCM in seconds", HFILL }
3444                 },
3445
3446                 { &hf_wlccp_scm_path_cost,
3447                   { "Path cost", "wlccp.scm_path_cost",
3448                     FT_UINT16, BASE_DEC, NULL,
3449                     0x0, "Sum of port costs on the path to the SCM", HFILL }
3450                 },
3451
3452                 { &hf_wlccp_scm_hop_count,
3453                   { "Hop Count", "wlccp.scm_hop_count",
3454                     FT_UINT8, BASE_DEC, NULL, 0,
3455                     "Number of wireless hops on the path to SCM", HFILL }
3456                 },
3457
3458                 { &hf_wlccp_scm_advperiod,
3459                   { "Advertisement Period", "wlccp.scm_advperiod",
3460                     FT_UINT8, BASE_DEC, NULL, 0,
3461                     "Average number of seconds between SCM advertisements", HFILL }
3462                 },
3463
3464                 { &hf_wlccp_timestamp,
3465                   { "Timestamp", "wlccp.timestamp",
3466                     FT_UINT64, BASE_DEC, NULL, 0,
3467                     "Registration Timestamp", HFILL }
3468                 },
3469
3470                 { &hf_wlccp_apregstatus,
3471                   { "Registration Status", "wlccp.apregstatus",
3472                     FT_UINT8, BASE_HEX, NULL, 0,
3473                     "AP Registration Status", HFILL }
3474                 },
3475
3476                 { &hf_wlccp_ap_node_id,
3477                   { "AP Node ID", "wlccp.apnodeid",
3478                     FT_NONE, BASE_NONE, NULL, 0,
3479                     NULL, HFILL }
3480                 },
3481
3482                 { &hf_wlccp_ap_node_type,
3483                   { "AP Node Type", "wlccp.apnodetype",
3484                     FT_UINT16, BASE_HEX, NULL, 0,
3485                     NULL, HFILL }
3486                 },
3487
3488                 { &hf_wlccp_ap_node_id_address,
3489                   { "AP Node Address", "wlccp.apnodeidaddress",
3490                     FT_ETHER, BASE_NONE, NULL, 0,
3491                     NULL, HFILL }
3492                 },
3493
3494                 { &hf_wlccp_aaa_msg_type,
3495                   { "AAA Message Type", "wlccp.aaa_msg_type",
3496                     FT_UINT8, BASE_HEX, VALS(wlccp_aaa_msg_type_vs), 0,
3497                     NULL, HFILL }
3498                 },
3499
3500                 { &hf_wlccp_aaa_auth_type,
3501                   { "AAA Authentication Type", "wlccp.aaa_auth_type",
3502                     FT_UINT8, BASE_HEX, VALS(wlccp_eapol_auth_type_vs), 0,
3503                     NULL, HFILL }
3504                 },
3505
3506                 { &hf_wlccp_keymgmt_type,
3507                   { "AAA Key Management Type", "wlccp.aaa_keymgmt_type",
3508                     FT_UINT8, BASE_HEX, VALS(wlccp_key_mgmt_type_vs), 0,
3509                     NULL, HFILL }
3510                 },
3511
3512                 { &hf_wlccp_eapol_msg,
3513                   { "EAPOL Message", "wlccp.eapol_msg",
3514                     FT_NONE, BASE_NONE, NULL, 0,
3515                     NULL, HFILL }
3516                 },
3517
3518                 { &hf_wlccp_eapol_version,
3519                   { "EAPOL Version", "wlccp.eapol_version",
3520                     FT_UINT8, BASE_DEC, NULL, 0,
3521                     NULL, HFILL }
3522                 },
3523
3524                 { &hf_wlccp_eapol_type,
3525                   { "EAPOL Type", "wlccp.eapol_type",
3526                     FT_UINT8, BASE_HEX, VALS(eapol_type_vs), 0,
3527                     NULL, HFILL }
3528                 },
3529
3530                 { &hf_wlccp_eap_msg_length,
3531                   { "EAP Packet Length", "wlccp.eap_pkt_length",
3532                     FT_UINT16, BASE_DEC, NULL, 0,
3533                     "EAPOL Type", HFILL }
3534                 },
3535
3536                 { &hf_wlccp_eap_msg,
3537                   { "EAP Message", "wlccp.eap_msg",
3538                     FT_BYTES, BASE_NONE, NULL, 0,
3539                     NULL, HFILL }
3540                 },
3541
3542                 { &hf_wlccp_cisco_acctg_msg,
3543                   { "Cisco Accounting Message", "wlccp.cisco_acctg_msg",
3544                     FT_BYTES, BASE_NONE, NULL, 0,
3545                     NULL, HFILL }
3546                 },
3547
3548                 { &hf_wlccp_wids_msg_type,
3549                   { "WIDS Message Type", "wlccp.wids_msg_type",
3550                     FT_UINT8, BASE_DEC, NULL, 0,
3551                     NULL, HFILL }
3552                 },
3553
3554                 { &hf_wlccp_nmconfig,
3555                   { "NM Config", "wlccp.nmconfig",
3556                     FT_UINT8, BASE_DEC, NULL, 0,
3557                     NULL, HFILL }
3558                 },
3559
3560                 { &hf_wlccp_scmstate_change,
3561                   { "SCM State Change", "wlccp.scmstate_change",
3562                     FT_UINT8, BASE_DEC, NULL, 0,
3563                     NULL, HFILL }
3564                 },
3565
3566                 { &hf_wlccp_scmstate_change_reason,
3567                   { "SCM State Change Reason", "wlccp.scmstate_change_reason",
3568                     FT_UINT8, BASE_DEC, NULL, 0,
3569                     NULL, HFILL }
3570                 },
3571
3572                 { &hf_wlccp_scmattach_state,
3573                   { "SCM Attach State", "wlccp.scmattach_state",
3574                     FT_UINT8, BASE_DEC, NULL, 0,
3575                     NULL, HFILL }
3576                 },
3577
3578                 { &hf_wlccp_nmcapability,
3579                   { "NM Capability", "wlccp.nm_capability",
3580                     FT_UINT8, BASE_DEC, NULL, 0,
3581                     NULL, HFILL }
3582                 },
3583
3584                 { &hf_wlccp_refresh_req_id,
3585                   { "Refresh Request ID", "wlccp.refresh_request_id",
3586                     FT_UINT32, BASE_DEC, NULL, 0,
3587                     NULL, HFILL }
3588                 },
3589
3590                 { &hf_wlccp_tlv,
3591                   { "WLCCP TLV", "wlccp.tlv",
3592                     FT_NONE, BASE_NONE, NULL, 0,
3593                     NULL, HFILL }
3594                 },
3595
3596                 { &hf_tlv_flags,
3597                   { "TLV Flags", "wlccp.tlv_flags",
3598                     FT_UINT16, BASE_HEX, NULL, 0,
3599                     "TLV Flags, Group and Type", HFILL }
3600                 },
3601
3602                 { &hf_wlccp_null_tlv,
3603                   { "NULL TLV", "wlccp.null_tlv",
3604                     FT_BYTES, BASE_NONE, NULL ,
3605                     0, NULL, HFILL }
3606                 },
3607
3608
3609                 { &hf_wlccp_tlv_type,
3610                   { "TLV Type", "wlccp.tlv_type",
3611                     FT_UINT16, BASE_DEC, NULL ,
3612                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3613                 },
3614
3615                 { &hf_wlccp_tlv_type0,
3616                   { "TLV Type", "wlccp.tlv_type",
3617                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_0),
3618                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3619                 },
3620
3621                 { &hf_wlccp_tlv_type1,
3622                   { "TLV Type", "wlccp.tlv_type",
3623                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_1),
3624                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3625                 },
3626
3627                 { &hf_wlccp_tlv_type2,
3628                   { "TLV Type", "wlccp.tlv_type",
3629                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_2),
3630                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3631                 },
3632
3633                 { &hf_wlccp_tlv_type3,
3634                   { "TLV Type", "wlccp.tlv_type",
3635                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_3),
3636                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3637                 },
3638
3639                 { &hf_wlccp_tlv_type4,
3640                   { "TLV Type", "wlccp.tlv_type",
3641                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_4),
3642                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3643                 },
3644
3645                 { &hf_wlccp_tlv_type5,
3646                   { "TLV Type", "wlccp.tlv_type",
3647                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_5),
3648                     TLV_TYPE_ID, "TLV Type ID", HFILL }
3649                 },
3650
3651                 { &hf_wlccp_tlv_group,
3652                   { "TLV Group", "wlccp.tlv_group",
3653                     FT_UINT16, BASE_DEC, VALS(wlccp_tlv_group_vs) ,
3654                     TLV_GROUP_ID, "TLV Group ID", HFILL }
3655                 },
3656
3657                 { &hf_wlccp_tlv_container_flag,
3658                   { "TLV Container Flag", "wlccp.tlv_container_flag",
3659                     FT_UINT16, BASE_DEC, NULL,
3660                     TLV_F_CONTAINER, "Set on if the TLV is a container", HFILL }
3661                 },
3662
3663                 { &hf_wlccp_tlv_encrypted_flag,
3664                   { "TLV Encrypted Flag", "wlccp.tlv_encrypted_flag",
3665                     FT_UINT16, BASE_DEC, NULL,
3666                     TLV_F_ENCRYPTED, "Set on if the TLV is encrypted", HFILL }
3667                 },
3668
3669                 { &hf_wlccp_tlv_reserved_bit,
3670                   { "Reserved bits", "wlccp.tlv_reserved_bit",
3671                     FT_UINT16, BASE_DEC, NULL,
3672                     TLV_F_RESVD, "Reserved", HFILL }
3673                 },
3674
3675                 { &hf_wlccp_tlv_request_flag,
3676                   { "TLV Request Flag", "wlccp.tlv_request_flag",
3677                     FT_UINT16, BASE_DEC, NULL,
3678                     TLV_F_REQUEST, "Set on if the TLV is a request", HFILL }
3679                 },
3680
3681                 { &hf_wlccp_tlv_length,
3682                   { "TLV Length", "wlccp.tlv_length",
3683                     FT_UINT16, BASE_DEC, NULL, 0,
3684                     NULL, HFILL }
3685                 },
3686
3687                 { &hf_wlccp_path_length,
3688                   { "Path Length", "wlccp.path_length",
3689                     FT_UINT8, BASE_DEC, NULL, 0,
3690                     NULL, HFILL }
3691                 },
3692
3693                 { &hf_wlccp_mic_msg_seq_count,
3694                   { "MIC Message Sequence Count", "wlccp.mic_msg_seq_count",
3695                     FT_UINT64, BASE_DEC, NULL, 0,
3696                     NULL, HFILL }
3697                 },
3698
3699                 { &hf_wlccp_mic_length,
3700                   { "MIC Length", "wlccp.mic_length",
3701                     FT_UINT16, BASE_DEC, NULL, 0,
3702                     NULL, HFILL }
3703                 },
3704
3705                 { &hf_wlccp_mic_value,
3706                   { "MIC Value", "wlccp.mic_value",
3707                     FT_BYTES, BASE_NONE, NULL, 0,
3708                     NULL, HFILL }
3709                 },
3710
3711                 { &hf_wlccp_dest_node_type,
3712                   { "Destination node type", "wlccp.dest_node_type",
3713                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3714                     0x0, NULL, HFILL }
3715                 },
3716
3717                 { &hf_wlccp_dest_node_id,
3718                   { "Destination node ID", "wlccp.dest_node_id",
3719                     FT_ETHER, BASE_NONE, NULL,
3720                     0x0, NULL, HFILL }
3721                 },
3722
3723                 { &hf_wlccp_supp_node_type,
3724                   { "Destination node type", "wlccp.supp_node_type",
3725                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3726                     0x0, NULL, HFILL }
3727                 },
3728
3729                 { &hf_wlccp_supp_node_id,
3730                   { "Supporting node ID", "wlccp.supp_node_id",
3731                     FT_ETHER, BASE_NONE, NULL,
3732                     0x0, NULL, HFILL }
3733                 },
3734
3735                 { &hf_wlccp_src_node_type,
3736                   { "Source node type", "wlccp.source_node_type",
3737                     FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs),
3738                     0x0, NULL, HFILL }
3739                 },
3740
3741                 { &hf_wlccp_src_node_id,
3742                   { "Source node ID", "wlccp.source_node_id",
3743                     FT_ETHER, BASE_NONE, NULL,
3744                     0x0, NULL, HFILL }
3745                 },
3746
3747                 { &hf_wlccp_key_mgmt_type,
3748                   { "Key Management type", "wlccp.key_mgmt_type",
3749                     FT_UINT8, BASE_HEX, NULL,
3750                     0x0, NULL, HFILL }
3751                 },
3752
3753                 { &hf_wlccp_key_seq_count,
3754                   { "Key Sequence Count", "wlccp.key_seq_count",
3755                     FT_UINT32, BASE_DEC, NULL, 0,
3756                     NULL, HFILL }
3757                 },
3758
3759                 { &hf_wlccp_session_timeout,
3760                   { "Session Timeout", "wlccp.session_timeout",
3761                     FT_UINT32, BASE_DEC, NULL, 0,
3762                     NULL, HFILL }
3763                 },
3764
3765                 { &hf_wlccp_nonce,
3766                   { "Nonce Value", "wlccp.nonce_value",
3767                     FT_BYTES, BASE_NONE, NULL, 0,
3768                     NULL, HFILL }
3769                 },
3770
3771                 { &hf_wlccp_token,
3772                   { "Token", "wlccp.token",
3773                     FT_UINT8, BASE_HEX, NULL, 0,
3774                     NULL, HFILL }
3775                 },
3776
3777                 { &hf_wlccp_scan_mode,
3778                   { "Scan Mode", "wlccp.scan_mode",
3779                     FT_UINT8, BASE_HEX, NULL,
3780                     0, NULL, HFILL }
3781                 },
3782
3783                 { &hf_wlccp_mode,
3784                   { "Mode", "wlccp.mode",
3785                     FT_UINT8, BASE_HEX, VALS(wlccp_mode_vs),
3786                     0, NULL, HFILL }
3787                 },
3788
3789                 { &hf_wlccp_rss,
3790                   { "RSS", "wlccp.rss",
3791                     FT_INT8, BASE_DEC, NULL, 0,
3792                     "Received Signal Strength", HFILL }
3793                 },
3794
3795                 { &hf_wlccp_srcidx,
3796                   { "Source Index", "wlccp.srcidx",
3797                     FT_UINT8, BASE_HEX, NULL, 0,
3798                     NULL, HFILL }
3799                 },
3800
3801                 { &hf_wlccp_parent_tsf,
3802                   { "Parent TSF", "wlccp.parenttsf",
3803                     FT_UINT32, BASE_HEX, NULL, 0,
3804                     NULL, HFILL }
3805                 },
3806
3807                 { &hf_wlccp_target_tsf,
3808                   { "Target TSF", "wlccp.targettsf",
3809                     FT_UINT64, BASE_HEX, NULL, 0,
3810                     NULL, HFILL }
3811                 },
3812
3813                 { &hf_wlccp_channel,
3814                   { "Channel", "wlccp.channel",
3815                     FT_UINT8, BASE_DEC, NULL, 0,
3816                     NULL, HFILL }
3817                 },
3818
3819                 { &hf_wlccp_phy_type,
3820                   { "PHY Type", "wlccp.phy_type",
3821                     FT_UINT8, BASE_DEC, VALS(phy_type_80211_vs), 0,
3822                     NULL, HFILL }
3823                 },
3824
3825                 { &hf_wlccp_bssid,
3826                   { "BSS ID", "wlccp.bssid",
3827                     FT_ETHER, BASE_NONE, NULL, 0,
3828                     "Basic Service Set ID", HFILL }
3829                 },
3830
3831                 { &hf_wlccp_beacon_interval,
3832                   { "Beacon Interval", "wlccp.beacon_interval",
3833                     FT_UINT16, BASE_DEC, NULL, 0,
3834                     NULL, HFILL }
3835                 },
3836
3837                 /*
3838                 { &hf_wlccp_capabilities,
3839                   { "Capabilities", "wlccp.capabilities",
3840                     FT_UINT16, BASE_HEX, NULL, 0,
3841                     NULL, HFILL }
3842                 },
3843                 */
3844
3845                 { &hf_wlccp_80211_capabilities,
3846                   { "802.11 Capabilities Flags", "wlccp.80211_capabilities",
3847                     FT_UINT16, BASE_HEX, NULL,
3848                     0x0, NULL, HFILL }
3849                 },
3850
3851                 { &hf_80211_cap_ess,
3852                   { "ESS flag", "wlccp.80211_ess_flag",
3853                     FT_UINT16, BASE_DEC, NULL,
3854                     F_80211_ESS, "Set on by APs in Beacon or Probe Response", HFILL }
3855                 },
3856
3857
3858                 { &hf_80211_cap_ibss,
3859                   { "IBSS flag", "wlccp.80211_ibss_flag",
3860                     FT_UINT16, BASE_DEC, NULL,
3861                     F_80211_IBSS, "Set on by STAs in Beacon or Probe Response", HFILL }
3862                 },
3863
3864                 { &hf_80211_cap_cf_pollable,
3865                   { "CF Pollable flag", "wlccp.80211_cf_pollable_flag",
3866                     FT_UINT16, BASE_DEC, NULL,
3867                     F_80211_CFPOLL, NULL, HFILL }
3868                 },
3869
3870                 { &hf_80211_cap_cf_poll_req,
3871                   { "CF Poll Request flag", "wlccp.80211_cf_poll_req_flag",
3872                     FT_UINT16, BASE_DEC, NULL,
3873                     F_80211_CFPOLL_REQ, NULL, HFILL }
3874                 },
3875
3876                 { &hf_80211_cap_privacy,
3877                   { "Privacy flag", "wlccp.80211_cf_poll_req_flag",
3878                     FT_UINT16, BASE_DEC, NULL,
3879                     F_80211_PRIVACY, "Set on indicate confidentiality is required in the BSS", HFILL }
3880                 },
3881
3882                 { &hf_80211_short_preamble,
3883                   { "Short Preamble flag", "wlccp.80211_short_preamble_flag",
3884                     FT_UINT16, BASE_DEC, NULL,
3885                     F_80211_SHORT_PREAMBLE, NULL, HFILL }
3886                 },
3887
3888                 { &hf_80211_pbcc,
3889                   { "PBCC flag", "wlccp.80211_pbcc_flag",
3890                     FT_UINT16, BASE_DEC, NULL,
3891                     F_80211_PBCC, NULL, HFILL }
3892                 },
3893
3894                 { &hf_80211_chan_agility,
3895                   { "Channel Agility flag", "wlccp.80211_chan_agility_flag",
3896                     FT_UINT16, BASE_DEC, NULL,
3897                     F_80211_CH_AGILITY, NULL, HFILL }
3898                 },
3899
3900                 { &hf_80211_spectrum_mgmt,
3901                   { "Spectrum Management flag", "wlccp.80211_spectrum_mgmt_flag",
3902                     FT_UINT16, BASE_DEC, NULL,
3903                     F_80211_SPEC_MGMT, NULL, HFILL }
3904                 },
3905
3906                 { &hf_80211_qos,
3907                   { "QOS flag", "wlccp.80211_qos_flag",
3908                     FT_UINT16, BASE_DEC, NULL,
3909                     F_80211_QOS, NULL, HFILL }
3910                 },
3911
3912                 { &hf_80211_short_time_slot,
3913                   { "Short Time Slot flag", "wlccp.80211_short_time_slot_flag",
3914                     FT_UINT16, BASE_DEC, NULL,
3915                     F_80211_SHORT_TIME_SLOT, NULL, HFILL }
3916                 },
3917
3918                 { &hf_80211_apsd,
3919                   { "APSD flag", "wlccp.80211_apsd_flag",
3920                     FT_UINT16, BASE_DEC, NULL,
3921                     F_80211_APSD, NULL, HFILL }
3922                 },
3923
3924                 { &hf_80211_reserved,
3925                   { "Reserved", "wlccp.80211_reserved",
3926                     FT_UINT16, BASE_DEC, NULL,
3927                     F_80211_RESVD, NULL, HFILL }
3928                 },
3929
3930                 { &hf_80211_dsss_ofdm,
3931                   { "DSSS-OFDM Flag", "wlccp.dsss_ofdm_flag",
3932                     FT_UINT16, BASE_DEC, NULL,
3933                     F_80211_DSSS_OFDM, NULL, HFILL }
3934                 },
3935
3936                 { &hf_80211_dlyd_block_ack,
3937                   { "Delayed Block Ack Flag", "wlccp.dsss_dlyd_block_ack_flag",
3938                     FT_UINT16, BASE_DEC, NULL,
3939                     F_80211_DLYD_BLK_ACK, NULL, HFILL }
3940                 },
3941
3942                 { &hf_80211_imm_block_ack,
3943                   { "Immediate Block Ack Flag", "wlccp.dsss_imm_block_ack_flag",
3944                     FT_UINT16, BASE_DEC, NULL,
3945                     F_80211_IMM_BLK_ACK, NULL, HFILL }
3946                 },
3947
3948
3949                 { &hf_wlccp_tlv80211,
3950                   { "802.11 TLV Value", "wlccp.tlv80211",
3951                     FT_BYTES, BASE_NONE, NULL, 0,
3952                     NULL, HFILL }
3953                 },
3954
3955                 { &hf_wlccp_duration,
3956                   { "Duration", "wlccp.duration",
3957                     FT_UINT16, BASE_DEC, NULL, 0,
3958                     NULL, HFILL }
3959                 },
3960
3961                 { &hf_wlccp_rpidensity,
3962                   { "RPI Density", "wlccp.rpi_denisty",
3963                     FT_BYTES, BASE_NONE, NULL, 0,
3964                     NULL, HFILL }
3965                 },
3966
3967                 { &hf_wlccp_ccabusy,
3968                   { "CCA Busy", "wlccp.cca_busy",
3969                     FT_UINT8, BASE_HEX, NULL, 0,
3970                     NULL, HFILL }
3971                 },
3972
3973                 { &hf_wlccp_stamac,
3974                   { "Station MAC", "wlccp.station_mac",
3975                     FT_ETHER, BASE_NONE, NULL, 0,
3976                     NULL, HFILL }
3977                 },
3978
3979                 { &hf_wlccp_sta_type,
3980                   { "Station Type", "wlccp.station_type",
3981                     FT_UINT8, BASE_HEX, NULL, 0,
3982                     NULL, HFILL }
3983                 },
3984
3985                 { &hf_wlccp_token2,
3986                   { "2 Byte Token", "wlccp.token2",
3987                     FT_UINT16, BASE_HEX, NULL, 0,
3988                     NULL, HFILL }
3989                 },
3990
3991                 { &hf_wlccp_interval,
3992                   { "Interval", "wlccp.interval",
3993                     FT_UINT16, BASE_DEC, NULL, 0,
3994                     NULL, HFILL }
3995                 },
3996
3997                 { &hf_framereport_elements,
3998                   { "Frame Report Elements", "wlccp.framereport_elements",
3999                     FT_NONE, BASE_NONE, NULL, 0,
4000                     NULL, HFILL }
4001                 },
4002
4003                 { &hf_wlccp_count,
4004                   { "Element Count", "wlccp.element_count",
4005                     FT_UINT8, BASE_DEC, NULL, 0,
4006                     NULL, HFILL }
4007                 },
4008
4009                 { &hf_wlccp_numframes,
4010                   { "Number of frames", "wlccp.numframes",
4011                     FT_UINT8, BASE_DEC, NULL, 0,
4012                     NULL, HFILL }
4013                 },
4014
4015                 { &hf_wlccp_mfpcapability,
4016                   { "MFP Capability", "wlccp.mfp_capability",
4017                     FT_UINT16, BASE_HEX, NULL, 0,
4018                     NULL, HFILL }
4019                 },
4020
4021                 { &hf_wlccp_mfpflags,
4022                   { "MFP Flags", "wlccp.mfp_flags",
4023                     FT_UINT16, BASE_HEX, NULL, 0,
4024                     NULL, HFILL }
4025                 },
4026
4027                 { &hf_wlccp_mfpconfig,
4028                   { "MFP Config", "wlccp.mfp_config",
4029                     FT_UINT16, BASE_HEX, NULL, 0,
4030                     NULL, HFILL }
4031                 },
4032
4033                 { &hf_wlccp_clientmac,
4034                   { "Client MAC", "wlccp.client_mac",
4035                     FT_ETHER, BASE_NONE, NULL, 0,
4036                     NULL, HFILL }
4037                 },
4038
4039                 { &hf_reg_lifetime,
4040                   { "Reg. LifeTime", "wlccp.reg_lifetime",
4041                     FT_UINT8, BASE_DEC, NULL, 0,
4042                     NULL, HFILL }
4043                 },
4044
4045                 { &hf_time_elapsed,
4046                   { "Elapsed Time", "wlccp.time_elapsed",
4047                     FT_UINT16, BASE_DEC, NULL, 0,
4048                     NULL, HFILL }
4049                 },
4050
4051                 { &hf_wlccp_parent_ap_mac,
4052                   { "Parent AP MAC", "wlccp.parent_ap_mac",
4053                     FT_ETHER, BASE_NONE, NULL, 0,
4054                     NULL, HFILL }
4055                 },
4056
4057                 { &hf_wlccp_auth_type,
4058                   { "Authentication Type", "wlccp.auth_type",
4059                     FT_UINT8, BASE_HEX, NULL, 0,
4060                     NULL, HFILL }
4061                 },
4062
4063                 { &hf_wlccp_radius_user_name,
4064                   { "RADIUS Username", "wlccp.radius_username",
4065                     FT_STRING, BASE_NONE, NULL,
4066                     0x0, NULL, HFILL }
4067                 },
4068
4069                 { &hf_wds_reason,
4070                   { "Reason Code", "wlccp.wds_reason",
4071                     FT_UINT8, BASE_HEX, NULL, 0,
4072                     NULL, HFILL }
4073                 },
4074
4075
4076                 { &hf_wlccp_tlv_unknown_value,
4077                   { "Unknown TLV Contents", "wlccp.tlv_unknown_value",
4078                     FT_BYTES, BASE_NONE, NULL, 0,
4079                     NULL, HFILL }
4080                 }
4081
4082         }; /* hf_register_info hf */
4083
4084         /* Setup protocol subtree array */
4085         static gint *ett[] = {
4086                 &ett_wlccp,
4087                 &ett_wlccp_sap_tree,
4088                 &ett_wlccp_type,
4089                 &ett_wlccp_flags,
4090                 &ett_wlccp_cm_flags,
4091                 &ett_wlccp_scm_flags,
4092                 &ett_wlccp_scm_priority_flags,
4093                 &ett_wlccp_scm_bridge_priority_flags,
4094                 &ett_wlccp_rm_flags,
4095                 &ett_wlccp_nm_flags,
4096                 &ett_wlccp_ap_node_id,
4097                 &ett_wlccp_eapol_msg_tree,
4098                 &ett_wlccp_eap_tree,
4099                 &ett_wlccp_tlv_tree,
4100                 &ett_tlv_flags_tree,
4101                 &ett_tlv_sub_tree,
4102                 &ett_80211_capability_flags_tree,
4103                 &ett_framereport_elements_tree
4104         }; /* static gint *ett[] */
4105
4106         /* Register the protocol name and description */
4107         proto_wlccp = proto_register_protocol("Cisco Wireless LAN Context Control Protocol", "WLCCP", "wlccp");
4108
4109         /* Required function calls to register the header fields and subtrees used */
4110         proto_register_field_array(proto_wlccp, hf, array_length(hf));
4111         proto_register_subtree_array(ett, array_length(ett));
4112
4113 }
4114
4115
4116 void
4117 proto_reg_handoff_wlccp(void)
4118 {
4119         dissector_handle_t wlccp_handle;
4120
4121         wlccp_handle = create_dissector_handle(dissect_wlccp, proto_wlccp);
4122
4123         dissector_add_uint("ethertype", ETHERTYPE_WLCCP, wlccp_handle);
4124         dissector_add_uint("udp.port", WLCCP_UDP_PORT, wlccp_handle);
4125         dissector_add_uint("llc.wlccp_pid", 0x0000, wlccp_handle);
4126
4127 }
4128
4129
4130 void
4131 proto_register_wlccp_oui(void)
4132 {
4133         static hf_register_info hf[] = {
4134                 { &hf_llc_wlccp_pid,
4135                   { "PID", "llc.wlccp_pid",
4136                     FT_UINT16, BASE_HEX, VALS(cisco_pid_vals),
4137                     0x0, NULL, HFILL }
4138                 }
4139         };
4140
4141         llc_add_oui(OUI_CISCOWL, "llc.wlccp_pid", "Cisco WLCCP OUI PID", hf);
4142
4143 }