MSWSP: add ids for another unknown Property Set
[wireshark-wip.git] / epan / dissectors / packet-waveagent.c
blobbae56fd85686a800584cad07f57eba4f9e7d265c
1 /* packet-waveagent.c
2 * Routines for WaveAgent dissection
3 * Copyright 2009-2011, Tom Cook <tcook@ixiacom.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
10 * *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "config.h"
28 #include <glib.h>
30 #include <epan/packet.h>
31 #include <epan/wmem/wmem.h>
33 #define ETHERNET_INTERFACE 1
34 #define WLAN_INTERFACE 2
36 #define IPV4_TYPE 2
37 #define IPV6_TYPE 10
39 #define NUM_STATE_CHANGES 8
40 #define NUM_BSS 8
41 #define SHORT_STR 256
43 #define WA_V2_PAYLOAD_OFFSET 40
44 #define WA_V3_PAYLOAD_OFFSET 44
46 /* Initialize the protocol and registered fields */
47 static int proto_waveagent = -1;
48 static int hf_waveagent_controlword = -1;
49 static int hf_waveagent_payloadlen = -1;
50 static int hf_waveagent_transnum = -1;
51 static int hf_waveagent_rtoken = -1;
52 static int hf_waveagent_flowid = -1;
53 static int hf_waveagent_capstatus = -1;
54 static int hf_waveagent_protocolversion = -1;
55 static int hf_waveagent_capimpl = -1;
56 static int hf_waveagent_id = -1;
57 static int hf_waveagent_bindtag = -1;
58 static int hf_waveagent_version = -1;
59 static int hf_waveagent_brokerip = -1;
60 static int hf_waveagent_brokerport = -1;
61 static int hf_waveagent_bindlevel = -1;
62 static int hf_waveagent_bindport = -1;
63 static int hf_waveagent_numinterfaces = -1;
64 static int hf_waveagent_capabilities2 = -1;
65 static int hf_waveagent_ifmask = -1;
66 static int hf_waveagent_commandstatus = -1;
67 static int hf_waveagent_syserrno = -1;
68 static int hf_waveagent_statusstring = -1;
69 static int hf_waveagent_rxdatapckts = -1;
70 static int hf_waveagent_rxdatabytes = -1;
71 static int hf_waveagent_rxpcktrate = -1;
72 static int hf_waveagent_rxbyterate = -1;
73 static int hf_waveagent_txdatapckts = -1;
74 static int hf_waveagent_txdatabytes = -1;
75 static int hf_waveagent_txpcktrate = -1;
76 static int hf_waveagent_txbyterate = -1;
77 static int hf_waveagent_looppckts = -1;
78 static int hf_waveagent_loopbytes = -1;
79 static int hf_waveagent_rxctlpckts = -1;
80 static int hf_waveagent_rxctlbytes = -1;
81 static int hf_waveagent_txctlpckts = -1;
82 static int hf_waveagent_txctlbytes = -1;
83 static int hf_waveagent_unknowncmds = -1;
84 static int hf_waveagent_snap = -1;
85 static int hf_waveagent_state = -1;
86 static int hf_waveagent_appstate = -1;
87 static int hf_waveagent_rx1pl = -1;
88 static int hf_waveagent_rx2pl = -1;
89 static int hf_waveagent_rx3pl = -1;
90 static int hf_waveagent_rx4pl = -1;
91 static int hf_waveagent_rx5pl = -1;
92 static int hf_waveagent_rxoospkts = -1;
93 /* static int hf_waveagent_rxmeanlatency = -1; */
94 /* static int hf_waveagent_rxminlatency = -1; */
95 /* static int hf_waveagent_rxmaxlatency = -1; */
96 static int hf_waveagent_latencysum = -1;
97 static int hf_waveagent_latencycount = -1;
98 static int hf_waveagent_txflowstop = -1;
99 static int hf_waveagent_jitter = -1;
100 static int hf_waveagent_remoteport = -1;
101 static int hf_waveagent_remoteaddr = -1;
102 static int hf_waveagent_dscp = -1;
103 static int hf_waveagent_fsflags = -1;
104 static int hf_waveagent_fscbrflag = -1;
105 static int hf_waveagent_fscombinedsetupflag = -1;
106 /* static int hf_waveagent_totalbytes = -1; */
107 static int hf_waveagent_payfill = -1;
108 static int hf_waveagent_paysize = -1;
109 static int hf_waveagent_avgrate = -1;
110 static int hf_waveagent_rxflownum = -1;
111 static int hf_waveagent_mode = -1;
112 static int hf_waveagent_endpointtype = -1;
113 static int hf_waveagent_totalframes = -1;
114 static int hf_waveagent_bssidstartindex = -1;
115 static int hf_waveagent_bssidstopindex = -1;
116 static int hf_waveagent_ifindex = -1;
117 static int hf_waveagent_iftype = -1;
118 static int hf_waveagent_ifdescription = -1;
119 static int hf_waveagent_ifmacaddr = -1;
120 static int hf_waveagent_iflinkspeed = -1;
121 static int hf_waveagent_ifdhcp = -1;
122 static int hf_waveagent_ifwlanbssid = -1;
123 static int hf_waveagent_ifwlanssid = -1;
124 static int hf_waveagent_ifiptype = -1;
125 static int hf_waveagent_ifipv4 = -1;
126 static int hf_waveagent_ifipv6 = -1;
127 static int hf_waveagent_ifdhcpserver = -1;
128 static int hf_waveagent_ifgateway = -1;
129 static int hf_waveagent_ifdnsserver = -1;
130 static int hf_waveagent_ifethl2status = -1;
131 static int hf_waveagent_ifwlanl2status = -1;
132 static int hf_waveagent_ifl3status = -1;
133 static int hf_waveagent_totalbssid = -1;
134 static int hf_waveagent_returnedbssid = -1;
135 static int hf_waveagent_scanbssid = -1;
136 static int hf_waveagent_scanssid = -1;
137 static int hf_waveagent_ifwlanrssi = -1;
138 static int hf_waveagent_ifwlansupprates = -1;
139 static int hf_waveagent_ifwlancapabilities = -1;
140 static int hf_waveagent_ifwlanchannel = -1;
141 static int hf_waveagent_ifwlanprivacy = -1;
142 static int hf_waveagent_ifwlanbssmode = -1;
143 static int hf_waveagent_ifwlannoise = -1;
144 static int hf_waveagent_ifphytypes = -1;
145 static int hf_waveagent_ifphytypebit0 = -1;
146 static int hf_waveagent_ifphytypebit1 = -1;
147 static int hf_waveagent_ifphytypebit2 = -1;
148 static int hf_waveagent_ifphytypebit3 = -1;
149 /* static int hf_waveagent_ifphytypebit4 = -1; */
150 static int hf_waveagent_ifwlanauthentication = -1;
151 static int hf_waveagent_ifwlancipher = -1;
152 static int hf_waveagent_delayfactor = -1;
153 static int hf_waveagent_medialossrate = -1;
154 static int hf_waveagent_txstartts = -1;
155 static int hf_waveagent_txendts = -1;
156 static int hf_waveagent_rxstartts = -1;
157 static int hf_waveagent_rxendts = -1;
158 static int hf_waveagent_oidcode = -1;
159 static int hf_waveagent_oidvalue = -1;
160 static int hf_waveagent_destip = -1;
161 static int hf_waveagent_destport = -1;
162 static int hf_waveagent_connectflags = -1;
163 static int hf_waveagent_connecttype = -1;
164 static int hf_waveagent_minrssi = -1;
165 static int hf_waveagent_connecttimeout = -1;
166 static int hf_waveagent_connectattempts = -1;
167 static int hf_waveagent_reason = -1;
168 static int hf_waveagent_sigsequencenum = -1;
169 static int hf_waveagent_relaydestid = -1;
170 static int hf_waveagent_relaysrcid = -1;
171 static int hf_waveagent_relaymessagest = -1;
173 /* Initialize the subtree pointers */
174 static gint ett_waveagent = -1;
175 static gint ett_statechange = -1;
176 static gint ett_phytypes = -1;
177 static gint ett_fsflags = -1;
178 static gint ett_scindex[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; /* NUM_STATE_CHANGES */
179 static gint ett_bss[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; /* NUM_BSS */
180 static gint ett_relaymessage = -1;
183 static const value_string control_words[] = {
184 { 0x01, "Receive, Count, Discard"},
185 { 0x02, "Receive, Count, Loopback"},
186 { 0x03, "Receive, Count, Push timestamp, Discard"},
187 { 0x04, "Receive, Count, Push timestamp, Loopback"},
188 { 0x08, "Transmit"},
189 { 0x11, "Start Flow"},
190 { 0x12, "Stop Flow"},
191 { 0x20, "Stats Reset"},
192 { 0x21, "Stats Request"},
193 { 0x22, "Flow Stats Reset"},
194 { 0x23, "Scan Results Request"},
195 { 0x24, "Interface Info Request"},
196 { 0x25, "Interface Change Info Request"},
197 { 0x26, "OID Request"},
198 { 0x2e, "Scan Results Response"},
199 { 0x2f, "Stats Response"},
200 { 0x30, "Interface Info Response"},
201 { 0x31, "Interface Change Info Response"},
202 { 0x32, "OID Response"}, /* XXX: is this correct ? entry originally located after 0x41 */
203 { 0x3e, "Relay Message"},
204 { 0x3f, "Relay Response"},
205 { 0x40, "Client Connect Request"},
206 { 0x41, "Client Disconnect Request"},
207 { 0x80, "Capabilities Request"},
208 { 0x81, "Capabilities Response"},
209 { 0x82, "Reserve Request"},
210 { 0x84, "Release Request"},
211 { 0x85, "Flow Setup"},
212 { 0x86, "Flow Destroy"},
213 { 0x87, "Flow Connect"},
214 { 0x88, "Flow Disconnect"},
215 { 0x89, "Flow Listen"},
216 { 0x8a, "Scan Request"},
217 { 0x8b, "Learning Message"},
218 { 0x8f, "Command Response"},
219 { 0, NULL},
221 static value_string_ext control_words_ext = VALUE_STRING_EXT_INIT(control_words);
223 /* Dissects the WLAN interface stats structure */
224 static void dissect_wlan_if_stats(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb)
226 proto_item *phy_types;
227 proto_tree *phy_types_tree;
228 guint32 phy_types_bitfield, noise_floor;
230 proto_tree_add_item(parent_tree,
231 hf_waveagent_ifwlanbssid, tvb, starting_offset, 6, ENC_NA);
233 /* two bytes of pad go here */
235 proto_tree_add_item(parent_tree,
236 hf_waveagent_ifwlanssid, tvb, starting_offset + 8, 32, ENC_ASCII|ENC_NA);
238 /* 4 byte SSID length field not reported */
240 proto_tree_add_item(parent_tree,
241 hf_waveagent_ifwlanrssi, tvb, starting_offset + 44, 4, ENC_BIG_ENDIAN);
243 noise_floor = tvb_get_ntohl(tvb, starting_offset + 48);
245 if (noise_floor != 0x7fffffff) {
246 proto_tree_add_item(parent_tree,
247 hf_waveagent_ifwlannoise, tvb, starting_offset + 48, 4, ENC_BIG_ENDIAN);
249 else {
250 proto_tree_add_int_format_value(parent_tree,
251 hf_waveagent_ifwlannoise, tvb, starting_offset + 48, 4, noise_floor,
252 "Not Reported");
255 phy_types_bitfield = tvb_get_ntohl(tvb, starting_offset + 52);
257 phy_types = proto_tree_add_uint(parent_tree, hf_waveagent_ifphytypes,
258 tvb, starting_offset + 52, 4, phy_types_bitfield);
260 phy_types_tree = proto_item_add_subtree(phy_types, ett_phytypes);
262 proto_tree_add_item(phy_types_tree,
263 hf_waveagent_ifphytypebit0, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN);
265 proto_tree_add_item(phy_types_tree,
266 hf_waveagent_ifphytypebit1, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN);
268 proto_tree_add_item(phy_types_tree,
269 hf_waveagent_ifphytypebit2, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN);
271 proto_tree_add_item(phy_types_tree,
272 hf_waveagent_ifphytypebit3, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN);
274 proto_tree_add_item(parent_tree,
275 hf_waveagent_ifwlanauthentication, tvb, starting_offset + 56, 4, ENC_BIG_ENDIAN);
277 proto_tree_add_item(parent_tree,
278 hf_waveagent_ifwlancipher, tvb, starting_offset + 60, 4, ENC_BIG_ENDIAN);
281 static void dissect_wa_payload(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb, guint32 control_word, guint8 version)
283 switch (control_word)
285 case 0x11: /* Flow start message */
286 proto_tree_add_item(parent_tree,
287 hf_waveagent_payfill, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
289 proto_tree_add_item(parent_tree,
290 hf_waveagent_paysize, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN);
292 proto_tree_add_item(parent_tree,
293 hf_waveagent_avgrate, tvb, starting_offset+8, 4, ENC_BIG_ENDIAN);
295 proto_tree_add_item(parent_tree,
296 hf_waveagent_totalframes, tvb, starting_offset+12, 4, ENC_BIG_ENDIAN);
298 break;
300 case 0x23: /* Scan results request */
301 proto_tree_add_item(parent_tree,
302 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
304 proto_tree_add_item(parent_tree,
305 hf_waveagent_bssidstartindex, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN);
307 proto_tree_add_item(parent_tree,
308 hf_waveagent_bssidstopindex, tvb, starting_offset+8, 4, ENC_BIG_ENDIAN);
310 break;
312 case 0x24: /* Interface info request */
313 case 0x25: /* Interface change info request */
314 case 0x8a: /* Scan request */
315 proto_tree_add_item(parent_tree,
316 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
318 break;
320 case 0x26: /* OID request */
321 proto_tree_add_item(parent_tree,
322 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
324 proto_tree_add_item(parent_tree,
325 hf_waveagent_oidcode, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN);
327 break;
329 case 0x30: { /* Interface stats response */
330 guint32 if_type;
332 proto_tree_add_item(parent_tree,
333 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
335 if_type = tvb_get_ntohl(tvb, starting_offset + 4);
337 proto_tree_add_item(parent_tree,
338 hf_waveagent_iftype, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
340 proto_tree_add_item(parent_tree,
341 hf_waveagent_ifdhcp, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
343 proto_tree_add_item(parent_tree,
344 hf_waveagent_ifmacaddr, tvb, starting_offset + 12, 6, ENC_NA);
346 /* 2 bytes of pad go here */
348 proto_tree_add_item(parent_tree,
349 hf_waveagent_iflinkspeed, tvb, starting_offset + 20, 4, ENC_BIG_ENDIAN);
351 proto_tree_add_item(parent_tree,
352 hf_waveagent_ifdescription, tvb, starting_offset + 24, 128, ENC_ASCII|ENC_NA);
354 /* 4 byte length field goes here - skip it */
356 /* two bytes of pad go here */
358 /* If we have WLAN interface, then report the following */
359 if (if_type == WLAN_INTERFACE)
360 dissect_wlan_if_stats(starting_offset + 156, parent_tree, tvb);
362 /* Next come the BindingAddress fields (for each address):
363 2 bytes: IP type (v4 or v6)
364 2 bytes: address length
365 4 bytes: service number (not used)
366 16 bytes: IP address */
368 /* for the bound IP address, report both IP type and address */
370 proto_tree_add_item(parent_tree,
371 hf_waveagent_ifiptype, tvb, starting_offset + 252, 2, ENC_BIG_ENDIAN);
373 if (tvb_get_ntohs(tvb, starting_offset + 252) == IPV4_TYPE) {
374 proto_tree_add_item(parent_tree,
375 hf_waveagent_ifipv4, tvb, starting_offset + 260, 4, ENC_BIG_ENDIAN); /* grab the last 4 bytes of the IP address field */
377 else {
378 proto_tree_add_item(parent_tree,
379 hf_waveagent_ifipv6, tvb, starting_offset + 260, 16, ENC_NA);
382 proto_tree_add_item(parent_tree,
383 hf_waveagent_ifdhcpserver, tvb, starting_offset + 284, 4, ENC_BIG_ENDIAN);
385 proto_tree_add_item(parent_tree,
386 hf_waveagent_ifgateway, tvb, starting_offset + 308, 4, ENC_BIG_ENDIAN);
388 proto_tree_add_item(parent_tree,
389 hf_waveagent_ifdnsserver, tvb, starting_offset + 332, 4, ENC_BIG_ENDIAN);
391 break;
394 case 0x31: { /* Interface change info response */
395 guint32 offset;
396 guint32 if_type;
397 guint32 delta;
398 guint32 iLoop;
400 proto_tree_add_item(parent_tree,
401 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
403 if_type = tvb_get_ntohl(tvb, starting_offset + 4);
405 proto_tree_add_item(parent_tree,
406 hf_waveagent_iftype, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
408 offset = starting_offset + 8;
409 delta = 156;
411 for (iLoop = 0; iLoop < NUM_STATE_CHANGES; iLoop++) {
412 proto_item *stIndex;
413 proto_tree *st_change_index_tree;
414 guint32 if_status;
415 int current_offset;
417 current_offset = offset + iLoop * delta;
419 /* Check to see if the interface entry is valid */
420 if_status = tvb_get_ntohl(tvb, current_offset);
421 if (if_status == 0) continue; /* No entry at this index, keep going */
423 /* Add index specific trees to hide the details */
424 stIndex = proto_tree_add_uint_format_value(parent_tree,
425 hf_waveagent_ifwlanl2status, tvb, current_offset, 4, if_status, "Interface state change %d", iLoop);
427 st_change_index_tree = proto_item_add_subtree(stIndex, ett_scindex[iLoop]);
429 if (if_type == WLAN_INTERFACE) {
430 proto_tree_add_item(st_change_index_tree,
431 hf_waveagent_ifwlanl2status, tvb, current_offset, 4, ENC_BIG_ENDIAN);
432 } else {
433 proto_tree_add_item(st_change_index_tree,
434 hf_waveagent_ifethl2status, tvb, current_offset, 4, ENC_BIG_ENDIAN);
437 proto_tree_add_item(st_change_index_tree,
438 hf_waveagent_ifl3status, tvb, current_offset + 4, 4, ENC_BIG_ENDIAN);
440 proto_tree_add_item(st_change_index_tree,
441 hf_waveagent_iflinkspeed, tvb, current_offset + 8, 4, ENC_BIG_ENDIAN);
443 if (if_type == WLAN_INTERFACE) {
444 dissect_wlan_if_stats(current_offset + 12, st_change_index_tree, tvb);
447 proto_tree_add_item(st_change_index_tree,
448 hf_waveagent_snap, tvb, current_offset + 108, 8, ENC_BIG_ENDIAN);
450 proto_tree_add_item(st_change_index_tree,
451 hf_waveagent_ifiptype, tvb, current_offset + 116, 2, ENC_BIG_ENDIAN);
453 if (tvb_get_ntohs(tvb, current_offset + 116) == IPV4_TYPE) {
454 proto_tree_add_item(st_change_index_tree,
455 hf_waveagent_ifipv4, tvb, current_offset + 124, 4, ENC_BIG_ENDIAN); /* grab the last 4 bytes of the IP address field */
457 else {
458 proto_tree_add_item(st_change_index_tree,
459 hf_waveagent_ifipv6, tvb, current_offset + 124, 16, ENC_NA);
462 /* 16 bytes of padding */
465 break;
468 case 0x32: /* OID response */
469 proto_tree_add_item(parent_tree,
470 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
472 proto_tree_add_item(parent_tree,
473 hf_waveagent_oidcode, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
475 proto_tree_add_item(parent_tree,
476 hf_waveagent_oidvalue, tvb, starting_offset + 12, 1024, ENC_ASCII|ENC_NA);
478 break;
480 case 0x2e: { /* scan results response message */
481 guint32 offset;
482 proto_item *pi;
483 guint32 num_bss_entries;
484 guint32 tag_len;
485 guint32 delta;
486 guint32 iLoop;
487 wmem_strbuf_t *sb;
489 proto_tree_add_item(parent_tree,
490 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
493 proto_tree_add_item(parent_tree,
494 hf_waveagent_totalbssid, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
496 pi = proto_tree_add_item(parent_tree,
497 hf_waveagent_returnedbssid, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
499 num_bss_entries = tvb_get_ntohl(tvb, starting_offset + 8);
501 if (num_bss_entries > NUM_BSS) {
502 proto_item_append_text(pi, " [**Too large: Limiting to " G_STRINGIFY(NUM_BSS) "]");
503 num_bss_entries = NUM_BSS;
505 /* Add 4 bytes of pad for the offset */
507 offset = starting_offset + 16;
508 delta = 148;
510 sb = wmem_strbuf_sized_new(wmem_packet_scope(), 8, SHORT_STR);
512 for (iLoop = 0; iLoop < num_bss_entries; iLoop++)
514 proto_item *bssIndex;
515 proto_tree *bss_tree;
516 int current_offset;
518 wmem_strbuf_truncate(sb, 0);
520 current_offset = offset + iLoop * delta;
522 bssIndex = proto_tree_add_item(parent_tree,
523 hf_waveagent_scanssid, tvb, current_offset, 32, ENC_ASCII|ENC_NA);
525 bss_tree = proto_item_add_subtree(bssIndex, ett_bss[iLoop]);
527 tag_len = tvb_get_ntohl(tvb, current_offset + 52);
529 if (tag_len != 0) {
530 const guint8 *tag_data_ptr;
531 guint32 isr;
533 tag_data_ptr = tvb_get_ptr (tvb, offset + 36, tag_len);
535 for (isr = 0; isr < tag_len; isr++) {
536 if (tag_data_ptr[isr] == 0xFF){
537 proto_tree_add_string (bss_tree, hf_waveagent_ifwlansupprates, tvb, offset + 36 + isr,
539 "BSS requires support for mandatory features of HT PHY (IEEE 802.11"
540 " - Clause 20)");
541 } else {
542 wmem_strbuf_append_printf(sb, "%2.1f%s ",
543 (tag_data_ptr[isr] & 0x7F) * 0.5,
544 (tag_data_ptr[isr] & 0x80) ? "(B)" : "");
548 wmem_strbuf_append(sb, " [Mbit/sec]");
550 else {
551 wmem_strbuf_append(sb, "Not defined");
554 proto_tree_add_string (bss_tree, hf_waveagent_ifwlansupprates, tvb, offset + 36,
555 tag_len, wmem_strbuf_get_str(sb));
557 proto_tree_add_item(bss_tree,
558 hf_waveagent_scanbssid, tvb, current_offset + 56, 6, ENC_NA);
560 proto_tree_add_item(bss_tree,
561 hf_waveagent_ifwlancapabilities, tvb, current_offset + 62, 2, ENC_BIG_ENDIAN);
563 proto_tree_add_item(bss_tree,
564 hf_waveagent_ifwlanrssi, tvb, current_offset + 64, 4, ENC_BIG_ENDIAN);
566 /* For now this is just a 4 byte pad, so comment it out... */
567 #if 0
568 proto_tree_add_item(bss_tree,
569 hf_waveagent_ifwlansigquality, tvb, current_offset + 68, 4, ENC_BIG_ENDIAN);
570 #endif
571 proto_tree_add_item(bss_tree,
572 hf_waveagent_ifwlanchannel, tvb, current_offset + 72, 4, ENC_BIG_ENDIAN);
574 proto_tree_add_item(bss_tree,
575 hf_waveagent_ifwlanprivacy, tvb, current_offset + 76, 4, ENC_BIG_ENDIAN);
577 proto_tree_add_item(bss_tree,
578 hf_waveagent_ifwlanbssmode, tvb, current_offset + 80, 4, ENC_BIG_ENDIAN);
580 break;
583 case 0x2f: /* Stats response message */
584 if (version < 3) {
585 /* For version 2 WA protocol the capability status is not in the header but in the CAP
586 RESPONSE. Need to read it here and then advance the payload offset. This is a
587 packet that had a structure change in the beginning of the packet when moving
588 to v3 */
589 proto_tree_add_item(parent_tree,
590 hf_waveagent_capstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
592 proto_tree_add_item(parent_tree,
593 hf_waveagent_protocolversion, tvb, starting_offset, 1, ENC_BIG_ENDIAN);
595 starting_offset += 4;
598 proto_tree_add_item(parent_tree,
599 hf_waveagent_capimpl, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
601 proto_tree_add_item(parent_tree,
602 hf_waveagent_state, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
604 proto_tree_add_item(parent_tree,
605 hf_waveagent_appstate, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
607 proto_tree_add_item(parent_tree,
608 hf_waveagent_rxdatapckts, tvb, starting_offset + 12, 8, ENC_BIG_ENDIAN);
610 proto_tree_add_item(parent_tree,
611 hf_waveagent_rxdatabytes, tvb, starting_offset + 20, 8, ENC_BIG_ENDIAN);
613 proto_tree_add_item(parent_tree,
614 hf_waveagent_rxpcktrate, tvb, starting_offset + 28, 8, ENC_BIG_ENDIAN);
616 proto_tree_add_item(parent_tree,
617 hf_waveagent_rxbyterate, tvb, starting_offset + 36, 8, ENC_BIG_ENDIAN);
619 proto_tree_add_item(parent_tree,
620 hf_waveagent_txdatapckts, tvb, starting_offset + 44, 8, ENC_BIG_ENDIAN);
622 proto_tree_add_item(parent_tree,
623 hf_waveagent_txdatabytes, tvb, starting_offset + 52, 8, ENC_BIG_ENDIAN);
625 proto_tree_add_item(parent_tree,
626 hf_waveagent_txpcktrate, tvb, starting_offset + 60, 8, ENC_BIG_ENDIAN);
628 proto_tree_add_item(parent_tree,
629 hf_waveagent_txbyterate, tvb, starting_offset + 68, 8, ENC_BIG_ENDIAN);
631 proto_tree_add_item(parent_tree,
632 hf_waveagent_looppckts, tvb, starting_offset + 76, 8, ENC_BIG_ENDIAN);
634 proto_tree_add_item(parent_tree,
635 hf_waveagent_loopbytes, tvb, starting_offset + 84, 8, ENC_BIG_ENDIAN);
637 proto_tree_add_item(parent_tree,
638 hf_waveagent_rxctlpckts, tvb, starting_offset + 92, 8, ENC_BIG_ENDIAN);
640 proto_tree_add_item(parent_tree,
641 hf_waveagent_rxctlbytes, tvb, starting_offset + 100, 8, ENC_BIG_ENDIAN);
643 proto_tree_add_item(parent_tree,
644 hf_waveagent_txctlpckts, tvb, starting_offset + 108, 8, ENC_BIG_ENDIAN);
646 proto_tree_add_item(parent_tree,
647 hf_waveagent_txctlbytes, tvb, starting_offset + 116, 8, ENC_BIG_ENDIAN);
649 proto_tree_add_item(parent_tree,
650 hf_waveagent_unknowncmds, tvb, starting_offset + 124, 8, ENC_BIG_ENDIAN);
652 proto_tree_add_item(parent_tree,
653 hf_waveagent_snap, tvb, starting_offset + 132, 8, ENC_BIG_ENDIAN);
655 #if 0
656 proto_tree_add_item(parent_tree,
657 hf_waveagent_tstamp1, tvb, 140, 4, ENC_BIG_ENDIAN);
659 proto_tree_add_item(parent_tree,
660 hf_waveagent_tstamp2, tvb, 144, 4, ENC_BIG_ENDIAN);
662 proto_tree_add_item(parent_tree,
663 hf_waveagent_tstamp3, tvb, 148, 4, ENC_BIG_ENDIAN);
665 proto_tree_add_item(parent_tree,
666 hf_waveagent_tstamp4, tvb, 152, 4, ENC_BIG_ENDIAN);
668 proto_tree_add_item(parent_tree,
669 hf_waveagent_tstamp5, tvb, 156, 4, ENC_BIG_ENDIAN);
671 proto_tree_add_item(parent_tree,
672 hf_waveagent_tstamp6, tvb, 160, 4, ENC_BIG_ENDIAN);
674 proto_tree_add_item(parent_tree,
675 hf_waveagent_tstamp7, tvb, 164, 4, ENC_BIG_ENDIAN);
677 proto_tree_add_item(parent_tree,
678 hf_waveagent_tstamp8, tvb, 168, 4, ENC_BIG_ENDIAN);
680 proto_tree_add_item(parent_tree,
681 hf_waveagent_minlcldelta, tvb, 172, 4, ENC_BIG_ENDIAN);
683 proto_tree_add_item(parent_tree,
684 hf_waveagent_maxlcldelta, tvb, 176, 4, ENC_BIG_ENDIAN);
686 proto_tree_add_item(parent_tree,
687 hf_waveagent_avglcldelta, tvb, 180, 4, ENC_BIG_ENDIAN);
689 proto_tree_add_item(parent_tree,
690 hf_waveagent_minremdelta, tvb, 184, 4, ENC_BIG_ENDIAN);
692 proto_tree_add_item(parent_tree,
693 hf_waveagent_maxremdelta, tvb, 188, 4, ENC_BIG_ENDIAN);
695 proto_tree_add_item(parent_tree,
696 hf_waveagent_avgremdelta, tvb, 192, 4, ENC_BIG_ENDIAN);
697 #endif
698 proto_tree_add_item(parent_tree,
699 hf_waveagent_rx1pl, tvb, starting_offset + 284, 8, ENC_BIG_ENDIAN);
701 proto_tree_add_item(parent_tree,
702 hf_waveagent_rx2pl, tvb, starting_offset + 292, 8, ENC_BIG_ENDIAN);
704 proto_tree_add_item(parent_tree,
705 hf_waveagent_rx3pl, tvb, starting_offset + 300, 8, ENC_BIG_ENDIAN);
707 proto_tree_add_item(parent_tree,
708 hf_waveagent_rx4pl, tvb, starting_offset + 308, 8, ENC_BIG_ENDIAN);
710 proto_tree_add_item(parent_tree,
711 hf_waveagent_rx5pl, tvb, starting_offset + 316, 8, ENC_BIG_ENDIAN);
713 proto_tree_add_item(parent_tree,
714 hf_waveagent_rxoospkts, tvb, starting_offset + 324, 8, ENC_BIG_ENDIAN);
716 proto_tree_add_item(parent_tree,
717 hf_waveagent_jitter, tvb, starting_offset + 356, 8, ENC_BIG_ENDIAN);
719 if (version >= 3) {
720 proto_tree_add_item(parent_tree,
721 hf_waveagent_delayfactor, tvb, starting_offset + 364, 8, ENC_BIG_ENDIAN);
723 proto_tree_add_item(parent_tree,
724 hf_waveagent_medialossrate, tvb, starting_offset + 372, 8, ENC_BIG_ENDIAN);
726 proto_tree_add_item(parent_tree,
727 hf_waveagent_txstartts, tvb, starting_offset + 380, 8, ENC_BIG_ENDIAN);
729 proto_tree_add_item(parent_tree,
730 hf_waveagent_txendts, tvb, starting_offset + 388, 8, ENC_BIG_ENDIAN);
732 proto_tree_add_item(parent_tree,
733 hf_waveagent_rxstartts, tvb, starting_offset + 396, 8, ENC_BIG_ENDIAN);
735 proto_tree_add_item(parent_tree,
736 hf_waveagent_rxendts, tvb, starting_offset + 404, 8, ENC_BIG_ENDIAN);
738 proto_tree_add_item(parent_tree,
739 hf_waveagent_latencysum, tvb, starting_offset + 412, 8, ENC_BIG_ENDIAN);
741 proto_tree_add_item(parent_tree,
742 hf_waveagent_latencycount, tvb, starting_offset + 420, 8, ENC_BIG_ENDIAN);
744 proto_tree_add_item(parent_tree,
745 hf_waveagent_txflowstop, tvb, starting_offset + 428, 8, ENC_BIG_ENDIAN);
748 break;
750 case 0x40: {
751 guint32 offset;
752 guint32 delta;
753 guint32 iLoop;
754 guint32 num_bss_entries;
756 proto_tree_add_item(parent_tree,
757 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
759 proto_tree_add_item(parent_tree,
760 hf_waveagent_connectflags, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
762 proto_tree_add_item(parent_tree,
763 hf_waveagent_connecttype, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
765 proto_tree_add_item(parent_tree,
766 hf_waveagent_scanssid, tvb, starting_offset + 12, 32, ENC_ASCII|ENC_NA);
768 num_bss_entries = tvb_get_ntohl(tvb, starting_offset + 142);
770 offset = starting_offset + 46;
771 delta = 6;
772 for (iLoop = 0; iLoop < num_bss_entries; iLoop++)
774 int current_offset;
775 current_offset = offset + iLoop * delta;
777 proto_tree_add_item(parent_tree,
778 hf_waveagent_scanbssid, tvb, current_offset, 6, ENC_NA);
781 proto_tree_add_item(parent_tree,
782 hf_waveagent_minrssi, tvb, starting_offset + 146, 4, ENC_BIG_ENDIAN);
784 proto_tree_add_item(parent_tree,
785 hf_waveagent_connecttimeout, tvb, starting_offset + 150, 4, ENC_BIG_ENDIAN);
787 proto_tree_add_item(parent_tree,
788 hf_waveagent_connectattempts, tvb, starting_offset + 154, 4, ENC_BIG_ENDIAN);
790 break;
793 case 0x41:
794 proto_tree_add_item(parent_tree,
795 hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
797 proto_tree_add_item(parent_tree,
798 hf_waveagent_reason, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
800 break;
802 case 0x81: /* Capabilities response */
803 if (version < 3) {
804 /* For version 2 WA protocol the capability status is not in the header but in the CAP
805 RESPONSE. Need to read it here and then advance the payload offset. This is a
806 packet that had a structure change in the beginning of the packet when moving
807 to v3 */
808 proto_tree_add_item(parent_tree,
809 hf_waveagent_capstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
811 proto_tree_add_item(parent_tree,
812 hf_waveagent_protocolversion, tvb, starting_offset, 1, ENC_BIG_ENDIAN);
814 starting_offset += 4;
817 proto_tree_add_item(parent_tree,
818 hf_waveagent_capimpl, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
820 proto_tree_add_item(parent_tree,
821 hf_waveagent_id, tvb, starting_offset + 4, 128, ENC_ASCII|ENC_NA);
823 proto_tree_add_item(parent_tree,
824 hf_waveagent_bindtag, tvb, starting_offset + 136, 128, ENC_ASCII|ENC_NA);
826 proto_tree_add_item(parent_tree,
827 hf_waveagent_version, tvb, starting_offset + 268, 128, ENC_ASCII|ENC_NA);
829 proto_tree_add_item(parent_tree,
830 hf_waveagent_brokerip, tvb, starting_offset + 400, 4, ENC_BIG_ENDIAN);
832 proto_tree_add_item(parent_tree,
833 hf_waveagent_brokerport, tvb, starting_offset + 404, 4, ENC_BIG_ENDIAN);
835 proto_tree_add_item(parent_tree,
836 hf_waveagent_bindlevel, tvb, starting_offset + 408, 4, ENC_BIG_ENDIAN);
838 proto_tree_add_item(parent_tree,
839 hf_waveagent_bindport, tvb, starting_offset + 412, 4, ENC_BIG_ENDIAN);
841 if (version >= 3) {
842 proto_tree_add_item(parent_tree,
843 hf_waveagent_capabilities2, tvb, starting_offset + 416, 4, ENC_BIG_ENDIAN);
845 proto_tree_add_item(parent_tree,
846 hf_waveagent_numinterfaces, tvb, starting_offset + 420, 4, ENC_BIG_ENDIAN);
848 proto_tree_add_item(parent_tree,
849 hf_waveagent_ifmask, tvb, starting_offset + 424, 4, ENC_BIG_ENDIAN);
852 break;
854 case 0x82: /* Reserve request */
855 proto_tree_add_item(parent_tree,
856 hf_waveagent_bindtag, tvb, starting_offset, 128, ENC_ASCII|ENC_NA);
858 proto_tree_add_item(parent_tree,
859 hf_waveagent_brokerip, tvb, starting_offset + 132, 4, ENC_BIG_ENDIAN);
861 proto_tree_add_item(parent_tree,
862 hf_waveagent_brokerport, tvb, starting_offset + 136, 4, ENC_BIG_ENDIAN);
864 break;
866 case 0x85: { /* Flow setup */
867 proto_tree *fs_flags;
868 proto_tree *fs_flags_tree;
869 guint32 flags_bitfield;
871 if (version < 3) {
872 proto_tree_add_item(parent_tree,
873 hf_waveagent_rxflownum, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
876 proto_tree_add_item(parent_tree,
877 hf_waveagent_mode, tvb, starting_offset + 7, 1, ENC_BIG_ENDIAN);
879 proto_tree_add_item(parent_tree,
880 hf_waveagent_endpointtype, tvb, starting_offset + 7, 1, ENC_BIG_ENDIAN);
882 proto_tree_add_item(parent_tree,
883 hf_waveagent_bindport, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
885 proto_tree_add_item(parent_tree,
886 hf_waveagent_bindlevel, tvb, starting_offset + 12, 4, ENC_BIG_ENDIAN);
888 proto_tree_add_item(parent_tree,
889 hf_waveagent_remoteport, tvb, starting_offset + 16, 4, ENC_BIG_ENDIAN);
891 proto_tree_add_item(parent_tree,
892 hf_waveagent_remoteaddr, tvb, starting_offset + 24, 4, ENC_BIG_ENDIAN);
894 proto_tree_add_item(parent_tree,
895 hf_waveagent_dscp, tvb, starting_offset + 40, 4, ENC_BIG_ENDIAN);
897 flags_bitfield = tvb_get_ntohl(tvb, starting_offset + 44);
899 fs_flags = proto_tree_add_uint(parent_tree, hf_waveagent_fsflags,
900 tvb, starting_offset + 44, 4, flags_bitfield);
902 fs_flags_tree = proto_item_add_subtree(fs_flags, ett_fsflags);
904 proto_tree_add_item(fs_flags_tree,
905 hf_waveagent_fscbrflag, tvb, starting_offset + 47, 1, ENC_LITTLE_ENDIAN);
907 proto_tree_add_item(fs_flags_tree,
908 hf_waveagent_fscombinedsetupflag, tvb, starting_offset + 47, 1, ENC_LITTLE_ENDIAN);
910 if (version >= 3) {
911 proto_tree_add_item(parent_tree,
912 hf_waveagent_ifindex, tvb, starting_offset + 48, 4, ENC_BIG_ENDIAN);
914 proto_tree_add_item(parent_tree,
915 hf_waveagent_payfill, tvb, starting_offset + 52, 4, ENC_BIG_ENDIAN);
917 proto_tree_add_item(parent_tree,
918 hf_waveagent_paysize, tvb, starting_offset + 56, 4, ENC_BIG_ENDIAN);
920 proto_tree_add_item(parent_tree,
921 hf_waveagent_avgrate, tvb, starting_offset + 60, 4, ENC_BIG_ENDIAN);
923 proto_tree_add_item(parent_tree,
924 hf_waveagent_totalframes, tvb, starting_offset + 64, 4, ENC_BIG_ENDIAN);
927 break;
930 case 0x8b:
931 proto_tree_add_item(parent_tree,
932 hf_waveagent_destip, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
934 proto_tree_add_item(parent_tree,
935 hf_waveagent_destport, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
937 proto_tree_add_item(parent_tree,
938 hf_waveagent_connectflags, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN);
940 break;
942 case 0x3f: /* Relay response */
943 case 0x8f: /* Command Response */
944 proto_tree_add_item(parent_tree,
945 hf_waveagent_commandstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN);
947 proto_tree_add_item(parent_tree,
948 hf_waveagent_syserrno, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN);
950 proto_tree_add_item(parent_tree,
951 hf_waveagent_statusstring, tvb, starting_offset + 8, 128, ENC_ASCII|ENC_NA);
953 break;
959 static guint32 dissect_wa_header(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb, guint8 version)
961 guint32 wa_payload_offset;
963 proto_tree_add_item(parent_tree,
964 hf_waveagent_controlword, tvb, 30+starting_offset, 2, ENC_BIG_ENDIAN);
966 proto_tree_add_item(parent_tree,
967 hf_waveagent_payloadlen, tvb, 20+starting_offset, 4, ENC_BIG_ENDIAN);
969 proto_tree_add_item(parent_tree,
970 hf_waveagent_transnum, tvb, 24+starting_offset, 4, ENC_BIG_ENDIAN);
972 proto_tree_add_item(parent_tree,
973 hf_waveagent_rtoken, tvb, 32+starting_offset, 4, ENC_BIG_ENDIAN);
975 proto_tree_add_item(parent_tree,
976 hf_waveagent_flowid, tvb, 36+starting_offset, 4, ENC_BIG_ENDIAN);
978 if (version >= 3) {
979 proto_tree_add_item(parent_tree,
980 hf_waveagent_capstatus, tvb, 40+starting_offset, 4, ENC_BIG_ENDIAN);
982 proto_tree_add_item(parent_tree,
983 hf_waveagent_protocolversion, tvb, 40+starting_offset, 1, ENC_BIG_ENDIAN);
985 wa_payload_offset = WA_V3_PAYLOAD_OFFSET + starting_offset;
987 else {
988 wa_payload_offset = WA_V2_PAYLOAD_OFFSET + starting_offset;
991 proto_tree_add_item(parent_tree,
992 hf_waveagent_sigsequencenum, tvb, 4+starting_offset, 1, ENC_BIG_ENDIAN);
994 return wa_payload_offset;
997 /* Dissect the packets */
998 static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1000 proto_item *ti, *rmi;
1001 proto_tree *waveagent_tree, *relay_message_tree, *payload_tree;
1002 guint8 signature_start, signature_end;
1003 guint8 version;
1004 guint32 magic_number;
1005 guint32 control_word, paylen;
1006 guint32 wa_payload_offset;
1008 /* Check that there's enough data */
1009 if (tvb_length(tvb) < 52 )
1010 return 0;
1012 magic_number = tvb_get_ntohl(tvb, 16) & 0x0FFFFFFF; /* Mask magic number off */
1013 if(magic_number != 0x0F87C3A5){
1014 return 0;
1017 signature_start = tvb_get_guint8(tvb, 0);
1018 signature_end = tvb_get_guint8(tvb, 15);
1020 if ( ((signature_start != 0xcc) && (signature_start !=0xdd)) ||
1021 (signature_end != 0xE2))
1022 /* This packet does not appear to belong to WaveAgent.
1023 * Return 0 to give another dissector a chance to dissect it.
1025 return 0;
1027 version = ((tvb_get_ntohl(tvb, 16) & 0xF0000000) >> 28 == 1) ? 3 : 2; /* Mask version bit off */
1029 col_set_str(pinfo->cinfo, COL_PROTOCOL, "WA");
1030 col_clear(pinfo->cinfo, COL_INFO);
1032 /* Grab the control word, parse the WaveAgent payload accordingly */
1034 control_word = tvb_get_ntohl(tvb, 28);
1035 paylen = tvb_get_ntohl(tvb, 20);
1037 col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%x)",
1038 val_to_str_ext_const(control_word, &control_words_ext, "Unknown"), control_word);
1040 if (tree) {
1041 /* create display subtree for the protocol */
1042 ti = proto_tree_add_protocol_format(tree, proto_waveagent, tvb, 0, -1,
1043 "WaveAgent, %s (0x%x), Payload Length %u Bytes",
1044 val_to_str_ext_const(control_word, &control_words_ext, "Unknown"), control_word, paylen);
1046 waveagent_tree = proto_item_add_subtree(ti, ett_waveagent);
1048 wa_payload_offset = dissect_wa_header(0, waveagent_tree, tvb, version);
1050 payload_tree = waveagent_tree;
1052 /* Need to check for a relay message. If so, parse the extra fields and then parse the WA packet */
1053 if (control_word == 0x3e)
1055 proto_tree_add_item(waveagent_tree,
1056 hf_waveagent_relaydestid, tvb, wa_payload_offset, 4, ENC_BIG_ENDIAN);
1057 proto_tree_add_item(waveagent_tree,
1058 hf_waveagent_relaysrcid, tvb, wa_payload_offset+4, 4, ENC_BIG_ENDIAN);
1060 /* Parse control_word of the relay message */
1061 control_word = tvb_get_ntohl(tvb, wa_payload_offset+12+28);
1062 rmi = proto_tree_add_none_format(waveagent_tree, hf_waveagent_relaymessagest,
1063 tvb, wa_payload_offset+12+28, 0,
1064 "Relayed WaveAgent Message, %s (0x%x)",
1065 val_to_str_ext_const(control_word, &control_words_ext, "Unknown"),
1066 control_word);
1068 relay_message_tree = proto_item_add_subtree(rmi, ett_relaymessage);
1070 wa_payload_offset = dissect_wa_header(wa_payload_offset+12, relay_message_tree, tvb, version);
1071 payload_tree = relay_message_tree;
1074 dissect_wa_payload(wa_payload_offset, payload_tree, tvb, control_word, version);
1077 /* Return the amount of data this dissector was able to dissect */
1078 return tvb_length(tvb);
1081 static gboolean dissect_waveagent_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1083 return (dissect_waveagent(tvb, pinfo, tree) > 0) ? TRUE : FALSE;
1087 #if 0
1088 static const value_string status_values[] = {
1089 { 0, "OK" },
1090 { 1, "In Use" },
1091 { 0, NULL }
1093 #endif
1095 /* Register the protocol with Wireshark */
1097 void proto_register_waveagent(void)
1099 static const value_string tcp_states[] = {
1100 { 0, "Closed" },
1101 { 1, "Listen" },
1102 { 2, "SYN Sent" },
1103 { 3, "SYN received" },
1104 { 4, "Established" },
1105 { 5, "FIN Wait 1" },
1106 { 6, "FIN Wait 2" },
1107 { 7, "Close Wait" },
1108 { 8, "Closing" },
1109 { 9, "Last ACK" },
1110 { 10, "Time Wait" },
1111 { 0, NULL },
1114 static const value_string app_states[] = {
1115 { 0, "IDLE" },
1116 { 1, "READY" },
1117 { 0, NULL },
1120 static const value_string wa_modes[] = {
1121 { 0, "In-band" },
1122 { 1, "Source" },
1123 { 2, "Sink" },
1124 { 3, "Loopback" },
1125 { 0, NULL },
1128 static const value_string wa_endpointtypes[] = {
1129 { 0, "Undefined" },
1130 { 1, "Server" },
1131 { 2, "Client" },
1132 { 0, NULL },
1135 static const value_string binding_levels[] = {
1136 { 0, "WLAN" },
1137 { 1, "Ethernet" },
1138 { 2, "IP" },
1139 { 3, "UDP" },
1140 { 4, "TCP" },
1141 { 5, "FIN Wait 1" },
1142 { 6, "FIN Wait 2" },
1143 { 7, "Close Wait" },
1144 { 8, "Closing" },
1145 { 9, "Last ACK" },
1146 { 10, "Time Wait" },
1147 { 0, NULL },
1150 static const value_string if_types[] = {
1151 { ETHERNET_INTERFACE, "Ethernet" },
1152 { WLAN_INTERFACE, "WLAN" },
1153 { 0, NULL },
1156 static const value_string no_yes[] = {
1157 { 0, "No" },
1158 { 1, "Yes" },
1159 { 0, NULL },
1162 static const value_string ip_types[] = {
1163 { 0, "Unspecified" },
1164 { IPV4_TYPE, "IPv4" },
1165 { IPV6_TYPE, "IPv6" },
1166 { 0, NULL },
1169 static const value_string if_l3_states[] = {
1170 { 0, "Uninitialized" },
1171 { 1, "Disconnected" },
1172 { 2, "Connected" },
1173 { 3, "Error" },
1174 { 0, NULL },
1177 static const value_string if_wlan_states[] = {
1178 { 0, "Uninitialized" },
1179 { 1, "Not ready" },
1180 { 2, "Connected" },
1181 { 3, "Ad Hoc network formed" },
1182 { 4, "Disconnecting" },
1183 { 5, "Disconnected" },
1184 { 6, "Associating" },
1185 { 7, "Discovering" },
1186 { 8, "Authenticating" },
1187 { 0, NULL },
1190 static const value_string if_eth_states[] = {
1191 { 0, "Uninitialized" },
1192 { 1, "Not Operational" },
1193 { 2, "Unreachable" },
1194 { 3, "Disconnected" },
1195 { 4, "Connecting" },
1196 { 5, "Connected" },
1197 { 6, "Operational" },
1198 { 7, "Error" },
1199 { 0, NULL },
1202 static const value_string bss_modes[] = {
1203 { 0, "Infrastructure" },
1204 { 1, "IBSS" },
1205 { 2, "Unknown" },
1206 { 0, NULL },
1209 static const value_string auth_algs[] = {
1210 { 0, "Open" },
1211 { 1, "Shared Key" },
1212 { 2, "WPA" },
1213 { 4, "WPA PSK" },
1214 { 8, "WPA2" },
1215 { 16, "WPA2 PSK" },
1216 { 0, NULL },
1219 static const value_string cipher_algs[] = {
1220 { 0, "None" },
1221 { 1, "WEP 40" },
1222 { 2, "WEP 104" },
1223 { 4, "WEP" },
1224 { 8, "TKIP" },
1225 { 16, "CCMP" },
1226 { 0, NULL },
1229 /* Setup list of header fields See Section 1.6.1 for details*/
1230 static hf_register_info hf[] = {
1232 /* START: General purpose message fields - used in multiple messages */
1233 { &hf_waveagent_controlword,
1234 { "Control Word", "waveagent.cword",
1235 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &control_words_ext, 0x0,
1236 NULL, HFILL } },
1238 { &hf_waveagent_payloadlen,
1239 { "Payload Length", "waveagent.paylen",
1240 FT_UINT32, BASE_DEC, NULL, 0x0,
1241 NULL, HFILL } },
1243 { &hf_waveagent_transnum,
1244 { "Transaction Number", "waveagent.transnum",
1245 FT_UINT32, BASE_DEC, NULL, 0x0,
1246 NULL, HFILL } },
1248 { &hf_waveagent_rtoken,
1249 { "Reservation Token", "waveagent.rtoken",
1250 FT_UINT32, BASE_HEX, NULL, 0x0,
1251 NULL, HFILL } },
1253 { &hf_waveagent_flowid,
1254 { "Flow ID", "waveagent.flowid",
1255 FT_UINT32, BASE_DEC, NULL, 0x0,
1256 NULL, HFILL } },
1258 { &hf_waveagent_capstatus,
1259 { "Capabilities Status", "waveagent.capstatus",
1260 FT_UINT32, BASE_HEX, NULL, 0x0,
1261 NULL, HFILL } },
1263 { &hf_waveagent_protocolversion,
1264 { "Protocol Version", "waveagent.protocolversion",
1265 FT_UINT8, BASE_DEC, NULL, 0x0,
1266 NULL, HFILL } },
1268 { &hf_waveagent_capimpl,
1269 { "Capabilities Implementation", "waveagent.capimpl",
1270 FT_UINT32, BASE_HEX, NULL, 0x0,
1271 NULL, HFILL } },
1273 { &hf_waveagent_sigsequencenum,
1274 { "Signature Sequence Number", "waveagent.sigsequencenum",
1275 FT_UINT8, BASE_DEC, NULL, 0x0,
1276 NULL, HFILL } },
1278 { &hf_waveagent_id,
1279 { "ID", "waveagent.id",
1280 FT_STRING, 0, NULL, 0x0,
1281 NULL, HFILL } },
1283 { &hf_waveagent_bindtag,
1284 { "Binding Tag", "waveagent.bindtag",
1285 FT_STRING, 0, NULL, 0x0,
1286 NULL, HFILL } },
1288 { &hf_waveagent_version,
1289 { "Version", "waveagent.version",
1290 FT_STRING, 0, NULL, 0x0,
1291 NULL, HFILL } },
1293 { &hf_waveagent_brokerip,
1294 { "Broker IP address", "waveagent.brokerip",
1295 FT_IPv4, BASE_NONE, NULL, 0x0,
1296 NULL, HFILL } },
1298 { &hf_waveagent_brokerport,
1299 { "Broker Port", "waveagent.brokerport",
1300 FT_UINT32, BASE_DEC, NULL, 0x0,
1301 NULL, HFILL } },
1303 { &hf_waveagent_bindlevel,
1304 { "Binding Level", "waveagent.bindlevel",
1305 FT_UINT32, BASE_DEC, VALS(binding_levels), 0x0,
1306 NULL, HFILL } },
1308 { &hf_waveagent_bindport,
1309 { "Binding Port", "waveagent.bindport",
1310 FT_UINT32, BASE_DEC, NULL, 0x0,
1311 NULL, HFILL } },
1313 { &hf_waveagent_ifindex,
1314 { "Interface Index", "waveagent.ifindex",
1315 FT_UINT32, BASE_DEC, NULL, 0x0,
1316 NULL, HFILL } },
1317 /* END: General purpose message fields - used in multiple messages */
1319 /* START: Capabilities response fields (specific to this message, other general fields are also used) */
1320 { &hf_waveagent_capabilities2,
1321 { "Additional Capabilities", "waveagent.capabilities2",
1322 FT_UINT32, BASE_HEX, NULL, 0x0,
1323 NULL, HFILL } },
1325 { &hf_waveagent_numinterfaces,
1326 { "Number of WA Interfaces", "waveagent.numinterfaces",
1327 FT_UINT32, BASE_DEC, NULL, 0x0,
1328 NULL, HFILL } },
1330 { &hf_waveagent_ifmask,
1331 { "Mask of Active Interfaces", "waveagent.ifmask",
1332 FT_UINT32, BASE_HEX, NULL, 0x0,
1333 NULL, HFILL } },
1334 /* END: Capabilities response fields (specific to this message, other general fields are also used) */
1336 /* START: Command response message fields */
1337 { &hf_waveagent_commandstatus,
1338 { "Status of Previous Command", "waveagent.cmdstat",
1339 FT_INT32, BASE_DEC, NULL, 0x0,
1340 NULL, HFILL } },
1342 { &hf_waveagent_syserrno,
1343 { "System Error Number", "waveagent.syserrno",
1344 FT_INT32, BASE_DEC, NULL, 0x0,
1345 NULL, HFILL } },
1347 { &hf_waveagent_statusstring,
1348 { "Status Message", "waveagent.statmsg",
1349 FT_STRING, 0, NULL, 0x0,
1350 NULL, HFILL } },
1351 /* END: Command response message fields */
1353 /* START: Stats response message fields */
1354 { &hf_waveagent_rxdatapckts,
1355 { "Received Data Packets", "waveagent.rxdpkts",
1356 FT_UINT64, BASE_DEC, NULL, 0x0,
1357 NULL, HFILL } },
1359 { &hf_waveagent_rxdatabytes,
1360 { "Received Data Bytes", "waveagent.rxdbytes",
1361 FT_UINT64, BASE_DEC, NULL, 0x0,
1362 NULL, HFILL } },
1364 { &hf_waveagent_rxpcktrate,
1365 { "Received Data Packet Rate (pps)", "waveagent.rxpktrate",
1366 FT_UINT64, BASE_DEC, NULL, 0x0,
1367 NULL, HFILL } },
1369 { &hf_waveagent_rxbyterate,
1370 { "Received Byte Rate", "waveagent.rxbyterate",
1371 FT_UINT64, BASE_DEC, NULL, 0x0,
1372 NULL, HFILL } },
1374 { &hf_waveagent_txdatapckts,
1375 { "Transmitted Data Packets", "waveagent.txdpkts",
1376 FT_UINT64, BASE_DEC, NULL, 0x0,
1377 NULL, HFILL } },
1379 { &hf_waveagent_txdatabytes,
1380 { "Transmitted Data Bytes", "waveagent.txdbytes",
1381 FT_UINT64, BASE_DEC, NULL, 0x0,
1382 NULL, HFILL } },
1384 { &hf_waveagent_txpcktrate,
1385 { "Transmitted Data Packet Rate (pps)", "waveagent.txpktrate",
1386 FT_UINT64, BASE_DEC, NULL, 0x0,
1387 NULL, HFILL } },
1389 { &hf_waveagent_txbyterate,
1390 { "Transmitted Byte Rate", "waveagent.txbyterate",
1391 FT_UINT64, BASE_DEC, NULL, 0x0,
1392 NULL, HFILL } },
1394 { &hf_waveagent_looppckts,
1395 { "Loopback Packets", "waveagent.looppckts",
1396 FT_UINT64, BASE_DEC, NULL, 0x0,
1397 NULL, HFILL } },
1399 { &hf_waveagent_loopbytes,
1400 { "Loopback Bytes", "waveagent.loopbytes",
1401 FT_UINT64, BASE_DEC, NULL, 0x0,
1402 NULL, HFILL } },
1404 { &hf_waveagent_rxctlpckts,
1405 { "Received Control Packets", "waveagent.rxctlpkts",
1406 FT_UINT64, BASE_DEC, NULL, 0x0,
1407 NULL, HFILL } },
1409 { &hf_waveagent_rxctlbytes,
1410 { "Received Control Bytes", "waveagent.rxctlbytes",
1411 FT_UINT64, BASE_DEC, NULL, 0x0,
1412 NULL, HFILL } },
1414 { &hf_waveagent_txctlpckts,
1415 { "Transmitted Control Packets", "waveagent.txctlpkts",
1416 FT_UINT64, BASE_DEC, NULL, 0x0,
1417 NULL, HFILL } },
1419 { &hf_waveagent_txctlbytes,
1420 { "Transmitted Control Bytes", "waveagent.txctlbytes",
1421 FT_UINT64, BASE_DEC, NULL, 0x0,
1422 NULL, HFILL } },
1424 { &hf_waveagent_unknowncmds,
1425 { "Unknown Commands", "waveagent.unkcmds",
1426 FT_UINT64, BASE_DEC, NULL, 0x0,
1427 NULL, HFILL } },
1429 { &hf_waveagent_snap,
1430 { "Time Snap for Counters", "waveagent.snap",
1431 FT_UINT64, BASE_DEC, NULL, 0x0,
1432 NULL, HFILL } },
1434 { &hf_waveagent_appstate,
1435 { "TCP State", "waveagent.state",
1436 FT_UINT32, BASE_DEC, VALS(tcp_states), 0x0,
1437 NULL, HFILL } },
1439 { &hf_waveagent_state,
1440 { "Application State", "waveagent.appstate",
1441 FT_UINT32, BASE_DEC, VALS(app_states), 0x0,
1442 NULL, HFILL } },
1444 { &hf_waveagent_rx1pl,
1445 { "Instances of single packet loss", "waveagent.rx1pl",
1446 FT_UINT64, BASE_DEC, NULL, 0x0,
1447 NULL, HFILL } },
1449 { &hf_waveagent_rx2pl,
1450 { "Instances of 2 sequential packets lost", "waveagent.rx2pl",
1451 FT_UINT64, BASE_DEC, NULL, 0x0,
1452 NULL, HFILL } },
1454 { &hf_waveagent_rx3pl,
1455 { "Instances of 3 sequential packets lost", "waveagent.rx3pl",
1456 FT_UINT64, BASE_DEC, NULL, 0x0,
1457 NULL, HFILL } },
1459 { &hf_waveagent_rx4pl,
1460 { "Instances of 4 sequential packets lost", "waveagent.rx4pl",
1461 FT_UINT64, BASE_DEC, NULL, 0x0,
1462 NULL, HFILL } },
1464 { &hf_waveagent_rx5pl,
1465 { "Instances of 5 sequential packets lost", "waveagent.rx5pl",
1466 FT_UINT64, BASE_DEC, NULL, 0x0,
1467 NULL, HFILL } },
1469 { &hf_waveagent_rxoospkts,
1470 { "Instances of out-of-sequence packets", "waveagent.rxoospkts",
1471 FT_UINT64, BASE_DEC, NULL, 0x0,
1472 NULL, HFILL } },
1474 #if 0
1475 { &hf_waveagent_rxmeanlatency,
1476 { "Rx Mean latency", "waveagent.rxmeanlatency",
1477 FT_UINT64, BASE_DEC, NULL, 0x0,
1478 NULL, HFILL } },
1479 #endif
1481 #if 0
1482 { &hf_waveagent_rxminlatency,
1483 { "Rx Minimum latency", "waveagent.rxminlatency",
1484 FT_UINT64, BASE_DEC, NULL, 0x0,
1485 NULL, HFILL } },
1486 #endif
1488 #if 0
1489 { &hf_waveagent_rxmaxlatency,
1490 { "Rx Maximum latency", "waveagent.rxmaxlatency",
1491 FT_UINT64, BASE_DEC, NULL, 0x0,
1492 NULL, HFILL } },
1493 #endif
1495 { &hf_waveagent_jitter,
1496 { "Jitter (microseconds)", "waveagent.jitter",
1497 FT_UINT64, BASE_DEC, NULL, 0x0,
1498 NULL, HFILL } },
1500 { &hf_waveagent_delayfactor,
1501 { "Delay Factor", "waveagent.delayfactor",
1502 FT_UINT64, BASE_DEC, NULL, 0x0,
1503 NULL, HFILL } },
1505 { &hf_waveagent_medialossrate,
1506 { "Media Loss Rate", "waveagent.medialossrate",
1507 FT_UINT64, BASE_DEC, NULL, 0x0,
1508 NULL, HFILL } },
1510 { &hf_waveagent_txstartts,
1511 { "Timestamp for first Tx flow packet", "waveagent.txstartts",
1512 FT_UINT64, BASE_DEC, NULL, 0x0,
1513 NULL, HFILL } },
1515 { &hf_waveagent_txendts,
1516 { "Timestamp for last Tx flow packet", "waveagent.txendts",
1517 FT_UINT64, BASE_DEC, NULL, 0x0,
1518 NULL, HFILL } },
1520 { &hf_waveagent_rxstartts,
1521 { "Timestamp for first Rx flow packet", "waveagent.rxstartts",
1522 FT_UINT64, BASE_DEC, NULL, 0x0,
1523 NULL, HFILL } },
1525 { &hf_waveagent_rxendts,
1526 { "Timestamp for last Rx flow packet", "waveagent.rxendts",
1527 FT_UINT64, BASE_DEC, NULL, 0x0,
1528 NULL, HFILL } },
1530 { &hf_waveagent_latencysum,
1531 { "Sum of latencies across all received packets", "waveagent.latencysum",
1532 FT_UINT64, BASE_DEC, NULL, 0x0,
1533 NULL, HFILL } },
1535 { &hf_waveagent_latencycount,
1536 { "Count of packets included in the latency sum", "waveagent.latencycount",
1537 FT_UINT64, BASE_DEC, NULL, 0x0,
1538 NULL, HFILL } },
1540 { &hf_waveagent_txflowstop,
1541 { "Timestamp for Tx flow stop message", "waveagent.txflowstop",
1542 FT_UINT64, BASE_DEC, NULL, 0x0,
1543 NULL, HFILL } },
1544 /* END Stats response message fields */
1546 /* START: Flow setup message */
1547 { &hf_waveagent_rxflownum,
1548 { "Received Flow Number", "waveagent.rxflownum",
1549 FT_UINT32, BASE_DEC, NULL, 0x0,
1550 NULL, HFILL } },
1552 { &hf_waveagent_mode,
1553 { "WaveAgent Mode", "waveagent.trafficmode",
1554 FT_UINT8, BASE_DEC, VALS(wa_modes), 0x03,
1555 NULL, HFILL } },
1557 { &hf_waveagent_endpointtype,
1558 { "WaveAgent Endpoint Type", "waveagent.endpointtype",
1559 FT_UINT8, BASE_DEC, VALS(wa_endpointtypes), 0x0c,
1560 NULL, HFILL } },
1562 { &hf_waveagent_remoteport,
1563 { "Remote port", "waveagent.remoteport",
1564 FT_UINT32, BASE_DEC, NULL, 0x0,
1565 NULL, HFILL } },
1567 { &hf_waveagent_remoteaddr,
1568 { "Remote address", "waveagent.remoteaddr",
1569 FT_IPv4, BASE_NONE, NULL, 0x0,
1570 NULL, HFILL } },
1572 { &hf_waveagent_dscp,
1573 { "DSCP Setting", "waveagent.dscp",
1574 FT_UINT32, BASE_DEC, NULL, 0x0,
1575 NULL, HFILL } },
1577 { &hf_waveagent_fsflags,
1578 { "Flow Setup Flags", "waveagent.fsflags",
1579 FT_UINT32, BASE_HEX, NULL, 0x0,
1580 NULL, HFILL } },
1582 { &hf_waveagent_fscbrflag,
1583 { "CBR Transmit Mode", "waveagent.fscbrflag",
1584 FT_BOOLEAN, 4, NULL, 0x01, NULL, HFILL } },
1586 { &hf_waveagent_fscombinedsetupflag,
1587 { "Setup, Connect/Listen, Start Combined", "waveagent.fscombinedsetupflag",
1588 FT_BOOLEAN, 4, NULL, 0x02, NULL, HFILL } },
1590 /* END: Flow setup message */
1592 /* START: Flow start message fields */
1593 { &hf_waveagent_payfill,
1594 { "Payload Fill", "waveagent.payfill",
1595 FT_UINT32, BASE_DEC, NULL, 0x0,
1596 NULL, HFILL } },
1598 { &hf_waveagent_paysize,
1599 { "WaveAgent Payload Size (bytes)", "waveagent.paysize",
1600 FT_UINT32, BASE_DEC, NULL, 0x0,
1601 NULL, HFILL } },
1603 { &hf_waveagent_avgrate,
1604 { "Average Rate (header + payload + trailer bytes/s)", "waveagent.avgrate",
1605 FT_UINT32, BASE_DEC, NULL, 0x0,
1606 NULL, HFILL } },
1608 { &hf_waveagent_totalframes,
1609 { "Total Frames", "waveagent.totalframes",
1610 FT_UINT32, BASE_DEC, NULL, 0x0,
1611 NULL, HFILL } },
1613 /* END: Flow start message fields */
1615 /* START: Scan results request (0x23) fields */
1616 { &hf_waveagent_bssidstartindex,
1617 { "Starting Index of BSSID list for reporting", "waveagent.bssidstartindex",
1618 FT_UINT32, BASE_DEC, NULL, 0x0,
1619 NULL, HFILL } },
1621 { &hf_waveagent_bssidstopindex,
1622 { "Ending Index of BSSID list for reporting", "waveagent.bssidstopindex",
1623 FT_UINT32, BASE_DEC, NULL, 0x0,
1624 NULL, HFILL } },
1626 /* END: Scan results request (0x23) fields */
1628 /* START: WLAN Interface stats fields */
1629 { &hf_waveagent_ifwlanbssid,
1630 { "WLAN Interface Connected to BSSID", "waveagent.ifwlanbssid",
1631 FT_ETHER, 0, NULL, 0x0,
1632 NULL, HFILL } },
1634 { &hf_waveagent_ifwlanssid,
1635 { "WLAN Interface Connected to SSID", "waveagent.ifwlanssid",
1636 FT_STRING, 0, NULL, 0x0,
1637 NULL, HFILL } },
1639 { &hf_waveagent_ifwlanrssi,
1640 { "WLAN Interface RSSI", "waveagent.ifwlanrssi",
1641 FT_INT32, BASE_DEC, NULL, 0x0,
1642 NULL, HFILL } },
1644 { &hf_waveagent_ifwlannoise,
1645 { "WLAN Interface Noise Floor (dBm)", "waveagent.ifwlannoise",
1646 FT_INT32, BASE_DEC, NULL, 0x0,
1647 NULL, HFILL } },
1649 { &hf_waveagent_ifphytypes,
1650 { "WLAN Interface Supported PHY Types", "waveagent.ifphytypes",
1651 FT_UINT32, BASE_DEC, NULL, 0x0,
1652 NULL, HFILL } },
1654 { &hf_waveagent_ifphytypebit0,
1655 { "11b", "waveagent.ifphytypebit0",
1656 FT_BOOLEAN, 4, NULL, 0x01, NULL, HFILL } },
1658 { &hf_waveagent_ifphytypebit1,
1659 { "11g", "waveagent.ifphytypebit1",
1660 FT_BOOLEAN, 4, NULL, 0x02, NULL, HFILL } },
1662 { &hf_waveagent_ifphytypebit2,
1663 { "11a", "waveagent.ifphytypebit2",
1664 FT_BOOLEAN, 4, NULL, 0x04, NULL, HFILL } },
1666 { &hf_waveagent_ifphytypebit3,
1667 { "11n", "waveagent.ifphytypebit3",
1668 FT_BOOLEAN, 4, NULL, 0x08, NULL, HFILL } },
1670 { &hf_waveagent_ifwlanauthentication,
1671 { "WLAN Interface Authentication Algorithm", "waveagent.ifwlanauthentication",
1672 FT_UINT32, BASE_DEC, VALS(auth_algs), 0x0,
1673 NULL, HFILL } },
1675 { &hf_waveagent_ifwlancipher,
1676 { "WLAN Interface Encryption/Cipher Algorithm", "waveagent.ifwlancipher",
1677 FT_UINT32, BASE_DEC, VALS(cipher_algs), 0x0,
1678 NULL, HFILL } },
1679 /* END: WLAN Interface stats fields */
1681 /* START: Interface stats response (0x2d) fields */
1682 { &hf_waveagent_iftype,
1683 { "Interface type", "waveagent.iftype",
1684 FT_UINT32, BASE_DEC, VALS(if_types), 0x0,
1685 NULL, HFILL } },
1687 { &hf_waveagent_ifdescription,
1688 { "Name/Description of the adapter", "waveagent.ifdescription",
1689 FT_STRING, 0, NULL, 0x0,
1690 NULL, HFILL } },
1692 { &hf_waveagent_ifmacaddr,
1693 { "Interface MAC Address", "waveagent.ifmacaddr",
1694 FT_ETHER, 0, NULL, 0x0,
1695 NULL, HFILL } },
1697 { &hf_waveagent_iflinkspeed,
1698 { "Interface Link Speed (kbps)", "waveagent.iflinkspeed",
1699 FT_UINT32, BASE_DEC, NULL, 0x0,
1700 NULL, HFILL } },
1702 { &hf_waveagent_ifdhcp,
1703 { "Interface DHCP Enabled", "waveagent.ifdhcp",
1704 FT_UINT32, BASE_DEC, VALS(no_yes), 0x0,
1705 NULL, HFILL } },
1707 { &hf_waveagent_ifiptype,
1708 { "Interface IP Type", "waveagent.ifiptype",
1709 FT_UINT32, BASE_DEC, VALS(ip_types), 0x0,
1710 NULL, HFILL } },
1712 { &hf_waveagent_ifipv4,
1713 { "Interface Bound to IP Address", "waveagent.ifipv4",
1714 FT_IPv4, BASE_NONE, NULL, 0x0,
1715 NULL, HFILL } },
1717 { &hf_waveagent_ifipv6,
1718 { "Interface Bound to IP Address", "waveagent.ifipv6",
1719 FT_IPv6, BASE_NONE, NULL, 0x0,
1720 NULL, HFILL } },
1722 { &hf_waveagent_ifdhcpserver,
1723 { "Interface DHCP Server Address", "waveagent.ifdhcpserver",
1724 FT_IPv4, BASE_NONE, NULL, 0x0,
1725 NULL, HFILL } },
1727 { &hf_waveagent_ifgateway,
1728 { "Interface Gateway", "waveagent.ifgateway",
1729 FT_IPv4, BASE_NONE, NULL, 0x0,
1730 NULL, HFILL } },
1732 { &hf_waveagent_ifdnsserver,
1733 { "Interface DNS Server Address", "waveagent.ifdnsserver",
1734 FT_IPv4, BASE_NONE, NULL, 0x0,
1735 NULL, HFILL } },
1737 { &hf_waveagent_ifethl2status,
1738 { "Ethernet L2 Interface Status", "waveagent.ifethl2status",
1739 FT_UINT32, BASE_DEC, VALS(if_eth_states), 0x0,
1740 NULL, HFILL } },
1742 { &hf_waveagent_ifwlanl2status,
1743 { "WLAN L2 Interface Status", "waveagent.ifwlanl2status",
1744 FT_UINT32, BASE_DEC, VALS(if_wlan_states), 0x0,
1745 NULL, HFILL } },
1747 { &hf_waveagent_ifl3status,
1748 { "L3 Interface Status", "waveagent.ifl3status",
1749 FT_UINT32, BASE_DEC, VALS(if_l3_states), 0x0,
1750 NULL, HFILL } },
1752 /* END: Interface stats response (0x2d) fields */
1754 /* START: Scan results response (0x2e) fields */
1755 { &hf_waveagent_totalbssid,
1756 { "Number of Found BSSID", "waveagent.totalbssid",
1757 FT_UINT32, BASE_DEC, NULL, 0x0,
1758 NULL, HFILL } },
1760 { &hf_waveagent_returnedbssid,
1761 { "Number of BSSID Reported in This Response", "waveagent.returnedbssid",
1762 FT_UINT32, BASE_DEC, NULL, 0x0,
1763 NULL, HFILL } },
1765 { &hf_waveagent_scanbssid,
1766 { "BSSID", "waveagent.scanbssid",
1767 FT_ETHER, 0, NULL, 0x0,
1768 NULL, HFILL } },
1770 { &hf_waveagent_scanssid,
1771 { "SSID", "waveagent.scanssid",
1772 FT_STRING, 0, NULL, 0x0,
1773 NULL, HFILL } },
1775 { &hf_waveagent_ifwlansupprates,
1776 { "Supported Rates", "waveagent.ifwlansupportedrates",
1777 FT_STRING, BASE_NONE, NULL, 0x0,
1778 NULL, HFILL } },
1780 { &hf_waveagent_ifwlancapabilities,
1781 { "Capabilities field", "waveagent.ifwlancapabilities",
1782 FT_UINT16, BASE_HEX, NULL, 0x0,
1783 NULL, HFILL } },
1785 { &hf_waveagent_ifwlanchannel,
1786 { "Channel", "waveagent.ifwlanchannel",
1787 FT_UINT32, BASE_DEC, NULL, 0x0,
1788 NULL, HFILL } },
1790 { &hf_waveagent_ifwlanprivacy,
1791 { "Privacy Enabled", "waveagent.ifwlanprivacy",
1792 FT_UINT32, BASE_DEC, VALS(no_yes), 0x0,
1793 NULL, HFILL } },
1795 { &hf_waveagent_ifwlanbssmode,
1796 { "BSS Mode", "waveagent.ifwlanbssmode",
1797 FT_UINT32, BASE_DEC, VALS(bss_modes), 0x0,
1798 NULL, HFILL } },
1799 /* END: Scan results response (0x2e) fields */
1801 /* START: OID fields */
1802 { &hf_waveagent_oidcode,
1803 { "OID Code", "waveagent.oidcode",
1804 FT_UINT32, BASE_DEC, NULL, 0x0,
1805 NULL, HFILL } },
1807 { &hf_waveagent_oidvalue,
1808 { "OID Value", "waveagent.oidvalue",
1809 FT_STRING, 0, NULL, 0x0,
1810 NULL, HFILL } },
1811 /* END: OID fields */
1813 /* START: Learning Message fields */
1814 { &hf_waveagent_destip,
1815 { "Destination IP", "waveagent.destip",
1816 FT_IPv4, BASE_NONE, NULL, 0x0,
1817 NULL, HFILL } },
1819 { &hf_waveagent_destport,
1820 { "Destination Port", "waveagent.destport",
1821 FT_UINT32, BASE_DEC, NULL, 0x0,
1822 NULL, HFILL } },
1824 { &hf_waveagent_connectflags,
1825 { "Connect Flags", "waveagent.connectflags",
1826 FT_UINT32, BASE_HEX, NULL, 0x0,
1827 NULL, HFILL } },
1828 /* END: Learning Message fields */
1830 /* START: client connect fields */
1831 { &hf_waveagent_connecttype,
1832 { "Connect Type", "waveagent.connecttype",
1833 FT_UINT32, BASE_HEX, NULL, 0x0,
1834 NULL, HFILL } },
1836 { &hf_waveagent_minrssi,
1837 { "Minimum RSSI", "waveagent.minrssi",
1838 FT_INT32, BASE_DEC, NULL, 0x0,
1839 NULL, HFILL } },
1841 { &hf_waveagent_connecttimeout,
1842 { "Connect timeout (s)", "waveagent.connecttimeout",
1843 FT_UINT32, BASE_DEC, NULL, 0x0,
1844 NULL, HFILL } },
1846 { &hf_waveagent_connectattempts,
1847 { "Connect attempts", "waveagent.connectattempt",
1848 FT_UINT32, BASE_DEC, NULL, 0x0,
1849 NULL, HFILL } },
1851 { &hf_waveagent_reason,
1852 { "Reason", "waveagent.reason",
1853 FT_UINT32, BASE_DEC, NULL, 0x0,
1854 NULL, HFILL } },
1855 /* END: client connect fields */
1857 /* START: relay server fields */
1858 { &hf_waveagent_relaydestid,
1859 { "ID of destination client (assigned by relay server)", "waveagent.relaydestid",
1860 FT_UINT32, BASE_DEC, NULL, 0x0,
1861 NULL, HFILL } },
1863 { &hf_waveagent_relaysrcid,
1864 { "ID of source client (assigned by relay server)", "waveagent.relaysrcid",
1865 FT_UINT32, BASE_DEC, NULL, 0x0,
1866 NULL, HFILL } },
1868 { &hf_waveagent_relaymessagest,
1869 { "Relayed WaveAgent Message", "waveagent.relaymessagest",
1870 FT_NONE, BASE_NONE, NULL, 0x0,
1871 "This is a relayed WaveAgent message", HFILL } },
1873 /* END: relay server fields */
1877 /* Setup protocol subtree array */
1878 static gint *ett[] = {
1879 &ett_waveagent,
1880 &ett_statechange,
1881 &ett_phytypes,
1882 &ett_fsflags,
1883 &ett_scindex[0],
1884 &ett_scindex[1],
1885 &ett_scindex[2],
1886 &ett_scindex[3],
1887 &ett_scindex[4],
1888 &ett_scindex[5],
1889 &ett_scindex[6],
1890 &ett_scindex[7],
1891 &ett_bss[0],
1892 &ett_bss[1],
1893 &ett_bss[2],
1894 &ett_bss[3],
1895 &ett_bss[4],
1896 &ett_bss[5],
1897 &ett_bss[6],
1898 &ett_bss[7],
1899 &ett_relaymessage,
1902 proto_waveagent = proto_register_protocol(
1903 "WaveAgent", "waveagent", "waveagent");
1905 proto_register_field_array(proto_waveagent, hf, array_length(hf));
1906 proto_register_subtree_array(ett, array_length(ett));
1910 void proto_reg_handoff_waveagent(void)
1912 heur_dissector_add("udp", dissect_waveagent_heur, proto_waveagent);