MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-homeplug.c
blobdd621c3b9cd076d728b354386acf4f3fa1f26b62
1 /* packet-homeplug.c
2 * Routines for homeplug dissection
4 * Copyright 2006, Sebastien Tandel <sebastien[AT]tandel.be>
5 * Copyright 2009, Luca Ceresoli <luca[AT]lucaceresoli.net>
7 * $Id$
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <glib.h>
32 #include <epan/packet.h>
34 #include <epan/etypes.h>
36 #include <epan/ptvcursor.h>
38 static int proto_homeplug = -1;
40 static int hf_homeplug_mctrl = -1;
41 static int hf_homeplug_mctrl_reserved = -1;
42 static int hf_homeplug_mctrl_ne = -1;
43 static int hf_homeplug_mehdr = -1;
44 static int hf_homeplug_mehdr_mev = -1;
45 static int hf_homeplug_mehdr_metype = -1;
46 static int hf_homeplug_melen = -1;
47 /* static int hf_homeplug_mme = -1; */
48 /* Request Channel Estimation */
49 static int hf_homeplug_rce = -1;
50 static int hf_homeplug_rce_cev = -1;
51 static int hf_homeplug_rce_rsvd = -1;
52 /* Channel Estimation Response */
53 static int hf_homeplug_cer = -1;
54 static int hf_homeplug_cer_cerv = -1;
55 static int hf_homeplug_cer_rsvd1 = -1;
56 static int hf_homeplug_cer_rxtmi = -1;
57 static int hf_homeplug_cer_vt = -1;
58 static int hf_homeplug_cer_rate = -1;
59 static int hf_homeplug_cer_bp = -1;
60 static int hf_homeplug_cer_mod = -1;
61 static int hf_homeplug_cer_vt11 = -1;
62 static int hf_homeplug_cer_rsvd2 = -1;
63 static int hf_homeplug_cer_nbdas = -1;
64 static int hf_homeplug_cer_bda = -1;
65 /* Replace Bridge Address */
66 static int hf_homeplug_rba = -1;
67 /* Vendor Specific */
68 static int hf_homeplug_vs = -1;
69 static int hf_homeplug_vs_oui = -1;
70 static int hf_homeplug_vs_dir = -1;
71 static int hf_homeplug_vs_mid = -1;
72 /* Set Network Encryption Key */
73 static int hf_homeplug_snk = -1;
74 static int hf_homeplug_snk_eks = -1;
75 static int hf_homeplug_snk_nek = -1;
76 /* Multicast With Response */
77 static int hf_homeplug_mwr = -1;
78 /* Confirm Network Encryption Key */
79 static int hf_homeplug_cnk = -1;
80 /* Host Tag */
81 static int hf_homeplug_htag = -1;
82 /* Request Parameters and Statistics */
83 static int hf_homeplug_rps = -1;
84 /* Parameters and Statistics Response */
85 static int hf_homeplug_psr = -1;
86 static int hf_homeplug_psr_txack = -1;
87 static int hf_homeplug_psr_txnack = -1;
88 static int hf_homeplug_psr_txfail = -1;
89 static int hf_homeplug_psr_txcloss = -1;
90 static int hf_homeplug_psr_txcoll = -1;
91 static int hf_homeplug_psr_txca3lat = -1;
92 static int hf_homeplug_psr_txca2lat = -1;
93 static int hf_homeplug_psr_txca1lat = -1;
94 static int hf_homeplug_psr_txca0lat = -1;
95 static int hf_homeplug_psr_rxbp40 = -1;
96 /* Set Local Parameters */
97 static int hf_homeplug_slp = -1;
98 static int hf_homeplug_slp_ma = -1;
99 /* Loader */
100 static int hf_homeplug_loader = -1;
101 static int hf_homeplug_loader_mid = -1;
102 static int hf_homeplug_loader_length = -1;
103 static int hf_homeplug_loader_status = -1;
104 static int hf_homeplug_loader_version = -1;
105 static int hf_homeplug_loader_gdfv = -1;
106 static int hf_homeplug_loader_lsf = -1;
107 static int hf_homeplug_loader_lwm = -1;
108 static int hf_homeplug_loader_lrm = -1;
109 static int hf_homeplug_loader_lrnvm = -1;
110 static int hf_homeplug_loader_lwnvm = -1;
111 static int hf_homeplug_loader_lreset = -1;
112 static int hf_homeplug_loader_gmd = -1;
113 static int hf_homeplug_loader_smd = -1;
114 static int hf_homeplug_loader_module_id = -1;
115 static int hf_homeplug_loader_module_offset = -1;
116 static int hf_homeplug_loader_module_size = -1;
117 static int hf_homeplug_loader_data_length = -1;
118 static int hf_homeplug_loader_data_address = -1;
119 static int hf_homeplug_loader_data = -1;
120 static int hf_homeplug_loader_cm = -1;
121 static int hf_homeplug_loader_lemd = -1;
122 static int hf_homeplug_loader_lenvms = -1;
123 static int hf_homeplug_loader_gnvmp = -1;
124 static int hf_homeplug_loader_snvmp = -1;
125 static int hf_homeplug_loader_nvmp_type = -1;
126 static int hf_homeplug_loader_nvmp_pagesize = -1;
127 static int hf_homeplug_loader_nvmp_blocksize = -1;
128 static int hf_homeplug_loader_nvmp_memorysize = -1;
129 /* Host Request */
130 static int hf_homeplug_hreq = -1;
131 static int hf_homeplug_hreq_mid = -1;
132 static int hf_homeplug_hreq_gdv = -1;
133 static int hf_homeplug_hreq_gfv = -1;
134 static int hf_homeplug_hreq_gnek = -1;
135 static int hf_homeplug_hreq_gclbpl = -1;
136 static int hf_homeplug_hreq_nvds = -1;
137 static int hf_homeplug_hreq_grbt = -1;
138 static int hf_homeplug_hreq_gslnm = -1;
139 static int hf_homeplug_hreq_gsss = -1;
140 static int hf_homeplug_hreq_rsl = -1;
141 static int hf_homeplug_hreq_reset = -1;
142 static int hf_homeplug_hreq_reset_type = -1;
143 static int hf_homeplug_hreq_reset_delay = -1;
144 /* Host Response */
145 static int hf_homeplug_hrsp = -1;
146 static int hf_homeplug_hrsp_mid = -1;
147 static int hf_homeplug_hrsp_gdvr = -1;
148 static int hf_homeplug_hrsp_gfvr = -1;
149 static int hf_homeplug_hrsp_gnekr = -1;
150 static int hf_homeplug_hrsp_gnekr_select = -1;
151 static int hf_homeplug_hrsp_gnekr_key = -1;
152 static int hf_homeplug_hrsp_invalid = -1;
153 static int hf_homeplug_hrsp_version = -1;
154 /* Network Statistics */
155 static int hf_homeplug_ns = -1;
156 static int hf_homeplug_ns_extended = -1;
157 /* Basic */
158 static int hf_homeplug_ns_netw_ctrl_ac = -1;
159 static int hf_homeplug_ns_netw_ctrl_icid = -1;
160 static int hf_homeplug_ns_bytes40_robo = -1;
161 static int hf_homeplug_ns_fails_robo = -1;
162 static int hf_homeplug_ns_drops_robo = -1;
163 static int hf_homeplug_ns_netw_da = -1;
164 static int hf_homeplug_ns_bytes40 = -1;
165 static int hf_homeplug_ns_fails = -1;
166 static int hf_homeplug_ns_drops = -1;
167 /* Extended */
168 /* static int hf_homeplug_ns_tx_bfr_state = -1; */
169 static int hf_homeplug_ns_buf_in_use = -1;
170 static int hf_homeplug_ns_prio = -1;
171 static int hf_homeplug_ns_msdu_len = -1;
172 static int hf_homeplug_ns_seqn = -1;
173 static int hf_homeplug_ns_toneidx = -1;
174 /* Bridging Characteristics Network */
175 static int hf_homeplug_bcn = -1;
176 static int hf_homeplug_bcn_network = -1;
177 static int hf_homeplug_bcn_return = -1;
178 static int hf_homeplug_bcn_rsvd = -1;
179 static int hf_homeplug_bcn_fbn = -1;
180 static int hf_homeplug_bcn_brda = -1;
181 static int hf_homeplug_bcn_bp_das = -1;
182 static int hf_homeplug_bcn_bp_da = -1;
183 /* Bridging Characteristics Local */
184 static int hf_homeplug_bcl = -1;
185 static int hf_homeplug_bcl_network = -1;
186 static int hf_homeplug_bcl_return = -1;
187 static int hf_homeplug_bcl_rsvd = -1;
188 static int hf_homeplug_bcl_hprox_das = -1;
189 static int hf_homeplug_bcl_hpbda = -1;
190 /* Set Transmit Characteristics */
191 static int hf_homeplug_stc = -1;
192 static int hf_homeplug_stc_lco = -1;
193 static int hf_homeplug_stc_encf = -1;
194 static int hf_homeplug_stc_txprio = -1;
195 static int hf_homeplug_stc_rexp = -1;
196 static int hf_homeplug_stc_txcf = -1;
197 static int hf_homeplug_stc_cftop = -1;
198 static int hf_homeplug_stc_rsvd1 = -1;
199 static int hf_homeplug_stc_retry = -1;
200 static int hf_homeplug_stc_rsvd2 = -1;
201 static int hf_homeplug_stc_dder = -1;
202 static int hf_homeplug_stc_dur = -1;
203 static int hf_homeplug_stc_ebp = -1;
204 static int hf_homeplug_stc_dees = -1;
205 static int hf_homeplug_stc_txeks = -1;
206 static int hf_homeplug_data = -1;
208 static gint ett_homeplug = -1;
209 static gint ett_homeplug_mctrl = -1;
210 static gint ett_homeplug_mehdr = -1;
211 static gint ett_homeplug_vs_mid = -1;
212 static gint ett_homeplug_rce = -1;
213 static gint ett_homeplug_cer = -1;
214 static gint ett_homeplug_vs = -1;
215 static gint ett_homeplug_snk = -1;
216 static gint ett_homeplug_rps = -1;
217 static gint ett_homeplug_psr = -1;
218 static gint ett_homeplug_slp = -1;
219 static gint ett_homeplug_loader = -1;
220 static gint ett_homeplug_hreq = -1;
221 static gint ett_homeplug_hrsp = -1;
222 static gint ett_homeplug_ns = -1;
223 static gint ett_homeplug_tone = -1;
224 static gint ett_homeplug_tx_bfr_state = -1;
225 static gint ett_homeplug_bridge = -1;
226 static gint ett_homeplug_bcn = -1;
227 static gint ett_homeplug_bcl = -1;
228 static gint ett_homeplug_stc = -1;
231 static guint8 homeplug_ne = 0;
232 static guint8 homeplug_melen = 0;
233 static guint8 homeplug_metype = 0;
235 static guint32 homeplug_offset = 0;
238 /* METYPE Values */
239 #define HOMEPLUG_MME_RCE 0x00
240 #define HOMEPLUG_MME_CER 0x01
241 #define HOMEPLUG_MME_VS 0x02
242 #define HOMEPLUG_MME_RBA 0x03
243 #define HOMEPLUG_MME_SNK 0x04
244 #define HOMEPLUG_MME_MWR 0x05
245 #define HOMEPLUG_MME_CNK 0x06
246 #define HOMEPLUG_MME_RPS 0x07
247 #define HOMEPLUG_MME_PSR 0x08
248 #define HOMEPLUG_MME_SLP 0x19
249 #define HOMEPLUG_MME_LOADER 0x10
250 #define HOMEPLUG_MME_HREQ 0x12
251 #define HOMEPLUG_MME_HRSP 0x13
252 #define HOMEPLUG_MME_HTAG 0x14
253 #define HOMEPLUG_MME_NS 0x1A
254 #define HOMEPLUG_MME_RES 0x1B
255 #define HOMEPLUG_MME_PS 0x1C
256 #define HOMEPLUG_MME_SLO 0x1D
257 #define HOMEPLUG_MME_BC 0x1E
258 #define HOMEPLUG_MME_STC 0x1F
259 static const value_string homeplug_metype_vals[] = {
260 { HOMEPLUG_MME_RCE, "Request Channel Estimation" },
261 { HOMEPLUG_MME_CER, "Channel Estimation Response" },
262 { HOMEPLUG_MME_VS , "Vendor Specific" },
263 { HOMEPLUG_MME_RBA, "Replace Bridge Address" },
264 { HOMEPLUG_MME_SNK, "Set Network Encryption Key" },
265 { HOMEPLUG_MME_MWR, "Multicast With Response" },
266 { HOMEPLUG_MME_CNK, "Confirm Network Encryption Key" },
267 { HOMEPLUG_MME_RPS, "Request Parameters and Statistics" },
268 { HOMEPLUG_MME_PSR, "Parameters and Statistics Response" },
269 { HOMEPLUG_MME_SLP, "Set Local Parameters" },
270 { HOMEPLUG_MME_NS , "Network Statistics" },
271 { HOMEPLUG_MME_RES, "Reserved" },
272 { HOMEPLUG_MME_PS , "Performance Statistics" },
273 { HOMEPLUG_MME_SLO, "Set Local Overrides" },
274 { HOMEPLUG_MME_BC , "Bridging Characteristics" },
275 { HOMEPLUG_MME_STC, "Set Transmit Characteristics" },
276 { 0, NULL }
279 /* MID Values, second field is METYPE they occur in */
280 #define HOMEPLUG_MID_GDD 16 /* 0x02 */
281 #define HOMEPLUG_MID_GCC 24 /* 0x02 */
282 #define HOMEPLUG_MID_GEC 25 /* 0x02 */
283 #define HOMEPLUG_MID_PRE 96 /* 0x02 */
284 #define HOMEPLUG_MID_PSI 97 /* 0x02 */
286 #define HOMEPLUG_MID_LGDFV 1 /* 0x10 */
287 #define HOMEPLUG_MID_LSF 2 /* 0x10 */
288 #define HOMEPLUG_MID_LWM 4 /* 0x10 */
289 #define HOMEPLUG_MID_LRM 9 /* 0x10 */
290 #define HOMEPLUG_MID_LRNVM 21 /* 0x10 */
291 #define HOMEPLUG_MID_LWNVM 22 /* 0x10 */
292 #define HOMEPLUG_MID_LRESET 127 /* 0x10 */
293 #define HOMEPLUG_MID_GMD 128 /* 0x10 */
294 #define HOMEPLUG_MID_SMD 129 /* 0x10 */
295 #define HOMEPLUG_MID_CM 130 /* 0x10 */
296 #define HOMEPLUG_MID_LEMD 132 /* 0x10 */
297 #define HOMEPLUG_MID_LENVMS 140 /* 0x10 */
298 #define HOMEPLUG_MID_GNVMP 141 /* 0x10 */
299 #define HOMEPLUG_MID_SNVMP 142 /* 0x10 */
301 #define HOMEPLUG_MID_GDV 1 /* 0x12 */
302 #define HOMEPLUG_MID_GFV 32 /* 0x12 */
303 #define HOMEPLUG_MID_GNEK 33 /* 0x12 */
304 #define HOMEPLUG_MID_GCLBPL 39 /* 0x12 */
305 #define HOMEPLUG_MID_NVDS 64 /* 0x12 */
306 #define HOMEPLUG_MID_GRBT 66 /* 0x12 */
307 #define HOMEPLUG_MID_GSLNM 68 /* 0x12 */
308 #define HOMEPLUG_MID_GSSS 72 /* 0x12 */
309 #define HOMEPLUG_MID_RSL 103 /* 0x12 */
310 #define HOMEPLUG_MID_RESET 127 /* 0x12 */
312 #define HOMEPLUG_MID_GDVR 1 /* 0x13 */
313 #define HOMEPLUG_MID_GFVR 32 /* 0x13 */
314 #define HOMEPLUG_MID_GNEKR 33 /* 0x13 */
315 #define HOMEPLUG_MID_INVALID 128 /* 0x13 */
317 #define HOMEPLUG_MID_EKT 1 /* 0x14 */
321 /* Bit mask Operation */
322 #define HOMEPLUG_MCTRL_RSVD 0x80
323 #define HOMEPLUG_MCTRL_NE 0x7F
325 #define HOMEPLUG_MEHDR_MEV 0xE0
326 #define HOMEPLUG_MEHDR_METYPE 0x1F
328 #define HOMEPLUG_VS_DIR 0x80
329 #define HOMEPLUG_VS_MID 0x3F
331 #define HOMEPLUG_NS_AC 0x80
332 #define HOMEPLUG_NS_ICID 0x7F
333 #define HOMEPLUG_NS_BUF_IN_USE 0x80
334 #define HOMEPLUG_NS_PRIO 0x60
335 #define HOMEPLUG_NS_MSDU_LEN 0x1F
336 #define HOMEPLUG_NS_SEQN 0xF0
337 #define HOMEPLUG_NS_TONEIDX 0x0F
339 /* string values in function of AC */
340 static const true_false_string homeplug_ns_ac_vals = {
341 "(from host) Return basic network statistics",
342 "(from host) Clear basic network statistics"
345 /* string values in function of BUF_IN_USE */
346 static const true_false_string homeplug_ns_buf_in_use_vals = {
347 "Buffer is in use",
348 "Buffer is available"
351 #define HOMEPLUG_RCE_CEV 0xF0
352 #define HOMEPLUG_RCE_RSVD 0x0F
354 #define HOMEPLUG_CER_CERV 0xF0
355 #define HOMEPLUG_CER_RSVD 0x0FE0
356 #define HOMEPLUG_CER_RXTMI 0x1F
357 #define HOMEPLUG_CER_RATE 0x80
358 #define HOMEPLUG_CER_BP 0x40
359 #define HOMEPLUG_CER_VT11 0x0F
360 #define HOMEPLUG_CER_RSVD2 0x80
361 #define HOMEPLUG_CER_NBDAS 0x7F
363 #define HOMEPLUG_BC_NETWORK 0x80
364 #define HOMEPLUG_BC_RETURN 0x40
365 #define HOMEPLUG_BCL_RSVD 0x3F
366 #define HOMEPLUG_BCN_RSVD 0x30
367 #define HOMEPLUG_BCN_FBN 0x0F
369 /* string values in function of BC_NETWORK */
370 static const true_false_string homeplug_bc_network_vals = {
371 "Network bridge information",
372 "Local bridge information"
375 /* string values in function of BC_RETURN */
376 static const true_false_string homeplug_bc_return_vals = {
377 "Return bridging characteristics",
378 "Set bridging characteristics"
381 #define HOMEPLUG_STC_LCO 0x80
382 #define HOMEPLUG_STC_ENCF 0x40
383 #define HOMEPLUG_STC_TXPRIO 0x30
384 #define HOMEPLUG_STC_REXP 0x08
385 #define HOMEPLUG_STC_TXCF 0x04
386 #define HOMEPLUG_STC_CFTOP 0x02
387 #define HOMEPLUG_STC_RSVD1 0x01
388 #define HOMEPLUG_STC_RETRY 0xC0
389 #define HOMEPLUG_STC_RSVD2 0x30
390 #define HOMEPLUG_STC_DDER 0x08
391 #define HOMEPLUG_STC_DUR 0x04
392 #define HOMEPLUG_STC_EBP 0x02
393 #define HOMEPLUG_STC_DEES 0x01
395 /* string values in function of CFTOP */
396 static const true_false_string homeplug_stc_cftop_vals = {
397 "CA2",
398 "CA3"
401 /* string values in function of RETRY */
402 static const value_string homeplug_stc_retry_vals[] = {
403 { 0, "No retries"},
404 { 1, "One retry only"},
405 { 2, "Normal retries based on specification"},
406 { 3, "Reserved"},
407 { 0, NULL}
410 /* Length of Network Statistics Response defines whether it is the Basic or
411 * the Extended Response */
412 #define HOMEPLUG_NS_BASIC_LEN 187
413 #define HOMEPLUG_NS_EXT_LEN 199
415 /* IC_ID Values */
416 #define HOMEPLUG_NS_ICID5130A1 0x00
417 #define HOMEPLUG_NS_ICID51X1USB 0x01
418 #define HOMEPLUG_NS_ICID51X1PHY 0x02
419 #define HOMEPLUG_NS_ICID51X1HOST 0x03
420 #define HOMEPLUG_NS_ICID5130A2 0x04
421 #define HOMEPLUG_NS_ICID_RSVD_MIN 0x05
422 #define HOMEPLUG_NS_ICID_RSVD_MAX 0x7F
423 /* string values in function of IC_ID values */
424 static const range_string homeplug_ns_icid_vals[] = {
425 { HOMEPLUG_NS_ICID5130A1, HOMEPLUG_NS_ICID5130A1, "INT5130A1" },
426 { HOMEPLUG_NS_ICID51X1USB, HOMEPLUG_NS_ICID51X1USB, "INT51X1 (USB Option)" },
427 { HOMEPLUG_NS_ICID51X1PHY, HOMEPLUG_NS_ICID51X1PHY, "INT51X1 (PHY Option)" },
428 { HOMEPLUG_NS_ICID51X1HOST, HOMEPLUG_NS_ICID51X1HOST, "INT51X1 (Host/DTE Option)" },
429 { HOMEPLUG_NS_ICID5130A2, HOMEPLUG_NS_ICID5130A2, "INT5130A2" },
430 { HOMEPLUG_NS_ICID_RSVD_MIN, HOMEPLUG_NS_ICID_RSVD_MAX, "Reserved"},
431 { 0, 0, NULL }
434 /* Modulation Method Bit Mask */
435 #define HOMEPLUG_CER_MOD_MASK 0x30
436 /* Modulation Method Values */
437 #define HOMEPLUG_CER_MOD_ROBO 0x00
438 #define HOMEPLUG_CER_MOD_DBPSK 0x01
439 #define HOMEPLUG_CER_MOD_DQPSK 0x02
440 #define HOMEPLUG_CER_MOD_RSVD 0x03
441 /* string values in function of Modulation Method Values */
442 static const value_string homeplug_cer_mod_vals[] = {
443 { HOMEPLUG_CER_MOD_ROBO, "ROBO Modulation"},
444 { HOMEPLUG_CER_MOD_DBPSK, "DBPSK Modulation"},
445 { HOMEPLUG_CER_MOD_DQPSK, "DQPSK Modulation"},
446 { HOMEPLUG_CER_MOD_RSVD, "Reserved"},
447 { 0, NULL}
450 /* Constants used by various MMEs */
452 #define HOMEPLUG_ADDR_INEXISTANT G_GINT64_CONSTANT(010000000000U)
454 /* string values in function of TXPRIO */
455 static const value_string homeplug_txprio_vals[] = {
456 { 0, "CA0"},
457 { 1, "CA1"},
458 { 2, "CA2"},
459 { 3, "CA3"},
460 { 0, NULL}
463 #define HOMEPLUG_MCTRL_LEN 1
464 #define HOMEPLUG_MEHDR_LEN 1
465 #define HOMEPLUG_MELEN_LEN 1
468 /* Dissection of MCTRL */
469 static void dissect_homeplug_mctrl(ptvcursor_t * cursor)
471 proto_item * it = NULL;
473 if (!ptvcursor_tree(cursor))
474 return;
476 it = ptvcursor_add_no_advance(cursor, hf_homeplug_mctrl, 1, ENC_NA);
477 /* Extract Number Of MAC Data Entries */
478 homeplug_ne = tvb_get_guint8(ptvcursor_tvbuff(cursor),
479 ptvcursor_current_offset(cursor)) & HOMEPLUG_MCTRL_NE;
481 ptvcursor_push_subtree(cursor, it, ett_homeplug_mctrl);
483 ptvcursor_add_no_advance(cursor, hf_homeplug_mctrl_reserved, 1, ENC_BIG_ENDIAN);
484 ptvcursor_add(cursor, hf_homeplug_mctrl_ne, 1, ENC_BIG_ENDIAN);
486 ptvcursor_pop_subtree(cursor);
489 /* Dissection of MEHDR */
490 static void dissect_homeplug_mehdr(ptvcursor_t * cursor)
492 proto_item * it = NULL;
494 if (!ptvcursor_tree(cursor))
495 return;
497 it = ptvcursor_add_no_advance(cursor, hf_homeplug_mehdr, 1, ENC_NA);
498 homeplug_metype = tvb_get_guint8(ptvcursor_tvbuff(cursor),
499 ptvcursor_current_offset(cursor)) & HOMEPLUG_MEHDR_METYPE;
501 ptvcursor_push_subtree(cursor, it, ett_homeplug_mehdr);
503 ptvcursor_add_no_advance(cursor, hf_homeplug_mehdr_mev, 1, ENC_BIG_ENDIAN);
504 ptvcursor_add(cursor, hf_homeplug_mehdr_metype, 1, ENC_BIG_ENDIAN);
506 ptvcursor_pop_subtree(cursor);
509 /* dissection of MELEN */
510 static void dissect_homeplug_melen(ptvcursor_t * cursor)
512 if (!ptvcursor_tree(cursor))
513 return;
515 homeplug_melen = tvb_get_guint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
516 ptvcursor_add(cursor, hf_homeplug_melen, 1, ENC_BIG_ENDIAN);
520 /* Dissection of Request Channel Estimation MME */
521 static void dissect_homeplug_rce(ptvcursor_t * cursor)
523 proto_item * it = NULL;
525 if (!ptvcursor_tree(cursor))
526 return;
528 it = ptvcursor_add_no_advance(cursor, hf_homeplug_rce, homeplug_melen, ENC_NA);
530 ptvcursor_push_subtree(cursor, it, ett_homeplug_rce);
532 ptvcursor_add_no_advance(cursor, hf_homeplug_rce_cev, 1, ENC_BIG_ENDIAN);
533 ptvcursor_add(cursor, hf_homeplug_rce_rsvd, 1, ENC_BIG_ENDIAN);
535 ptvcursor_pop_subtree(cursor);
538 /* Dissection of Channel Estimation Response MME */
539 static void dissect_homeplug_cer(ptvcursor_t * cursor)
541 proto_item * it = NULL;
542 guint8 iTone = 0;
543 guint8 BP = 0;
544 guint8 iNBDA = 0;
546 if (!ptvcursor_tree(cursor))
547 return;
549 it = ptvcursor_add_no_advance(cursor, hf_homeplug_cer, homeplug_melen, ENC_NA);
551 ptvcursor_push_subtree(cursor, it, ett_homeplug_cer);
553 ptvcursor_add_no_advance(cursor, hf_homeplug_cer_cerv, 1, ENC_BIG_ENDIAN);
554 ptvcursor_add(cursor, hf_homeplug_cer_rsvd1, 2, ENC_BIG_ENDIAN);
555 ptvcursor_add(cursor, hf_homeplug_cer_rxtmi, 1, ENC_BIG_ENDIAN);
557 for (;iTone < 10; iTone++) {
558 ptvcursor_add(cursor, hf_homeplug_cer_vt, 1, ENC_BIG_ENDIAN);
561 ptvcursor_add_no_advance(cursor, hf_homeplug_cer_rate, 1, ENC_BIG_ENDIAN);
562 ptvcursor_add_no_advance(cursor, hf_homeplug_cer_bp, 1, ENC_BIG_ENDIAN);
563 BP = tvb_get_guint8(ptvcursor_tvbuff(cursor),
564 ptvcursor_current_offset(cursor)) & HOMEPLUG_CER_BP;
565 ptvcursor_add_no_advance(cursor, hf_homeplug_cer_mod, 1, ENC_BIG_ENDIAN);
566 ptvcursor_add(cursor, hf_homeplug_cer_vt11, 1, ENC_BIG_ENDIAN);
567 ptvcursor_add_no_advance(cursor, hf_homeplug_cer_rsvd2, 1, ENC_BIG_ENDIAN);
569 if (BP) {
570 iNBDA = tvb_get_guint8(ptvcursor_tvbuff(cursor),
571 ptvcursor_current_offset(cursor)) & HOMEPLUG_CER_NBDAS;
572 ptvcursor_add(cursor, hf_homeplug_cer_nbdas, 1, ENC_BIG_ENDIAN);
573 /* TODO : Check on iNBDA! INT51X1 up to 16 dba. But up to 32 for INT51X1 (Host/DTE) */
574 for (;iNBDA > 0; iNBDA--) {
575 ptvcursor_add(cursor, hf_homeplug_cer_bda, 6, ENC_NA);
579 ptvcursor_pop_subtree(cursor);
582 /* Dissection of Vendor Specific MME */
583 static void dissect_homeplug_vs(ptvcursor_t * cursor)
585 proto_item * it = NULL;
587 if (!ptvcursor_tree(cursor))
588 return;
590 it = ptvcursor_add_no_advance(cursor, hf_homeplug_vs, homeplug_melen, ENC_NA);
592 ptvcursor_push_subtree(cursor, it, ett_homeplug_vs);
594 ptvcursor_add(cursor, hf_homeplug_vs_oui, 3, ENC_BIG_ENDIAN);
596 it = ptvcursor_add_no_advance(cursor, hf_homeplug_vs_mid, 1, ENC_BIG_ENDIAN);
598 ptvcursor_push_subtree(cursor, it, ett_homeplug_vs_mid);
600 ptvcursor_add_no_advance(cursor, hf_homeplug_vs_dir, 1, ENC_BIG_ENDIAN);
601 ptvcursor_add(cursor, hf_homeplug_vs_mid, 1, ENC_BIG_ENDIAN);
603 ptvcursor_pop_subtree(cursor);
605 #if 0 /* XXX: ToDo ?? */
606 switch(mid) {
608 #endif
610 ptvcursor_pop_subtree(cursor);
613 /* Dissection of Replace Bridge Address MME */
614 static void dissect_homeplug_rba(ptvcursor_t * cursor)
616 if (!ptvcursor_tree(cursor))
617 return;
619 ptvcursor_add_no_advance(cursor, hf_homeplug_rba, homeplug_melen, ENC_NA);
622 /* Dissection of Request Parameters and Statistics MME */
623 static void dissect_homeplug_rps(ptvcursor_t * cursor)
625 if (!ptvcursor_tree(cursor))
626 return;
628 ptvcursor_add(cursor, hf_homeplug_rps, homeplug_melen, ENC_NA);
631 /* Dissection of Set Network Encryption Key MME */
632 static void dissect_homeplug_snk(ptvcursor_t * cursor)
634 proto_item * it = NULL;
636 if (!ptvcursor_tree(cursor))
637 return;
639 it = ptvcursor_add_no_advance(cursor, hf_homeplug_snk, homeplug_melen, ENC_NA);
641 ptvcursor_push_subtree(cursor, it, ett_homeplug_snk);
643 ptvcursor_add(cursor, hf_homeplug_snk_eks, 1, ENC_BIG_ENDIAN);
644 ptvcursor_add(cursor, hf_homeplug_snk_nek, 8, ENC_NA);
646 ptvcursor_pop_subtree(cursor);
649 /* Dissection of Multicast with Response MME */
650 static void dissect_homeplug_mwr(ptvcursor_t * cursor)
652 if (!ptvcursor_tree(cursor))
653 return;
655 ptvcursor_add_no_advance(cursor, hf_homeplug_mwr, homeplug_melen, ENC_NA);
658 /* Dissection of Confirm Network Encryption Key MME */
659 static void dissect_homeplug_cnk(ptvcursor_t * cursor)
661 if (!ptvcursor_tree(cursor))
662 return;
664 ptvcursor_add_no_advance(cursor, hf_homeplug_cnk, homeplug_melen, ENC_NA);
667 /* Dissection of Parameters and Statistics Response MME */
668 static void dissect_homeplug_psr(ptvcursor_t * cursor)
670 proto_item * it = NULL;
672 if (!ptvcursor_tree(cursor))
673 return;
675 it = ptvcursor_add_no_advance(cursor, hf_homeplug_psr, homeplug_melen, ENC_NA);
677 ptvcursor_push_subtree(cursor, it, ett_homeplug_psr);
679 ptvcursor_add(cursor, hf_homeplug_psr_txack, 2, ENC_BIG_ENDIAN);
680 ptvcursor_add(cursor, hf_homeplug_psr_txnack, 2, ENC_BIG_ENDIAN);
681 ptvcursor_add(cursor, hf_homeplug_psr_txfail, 2, ENC_BIG_ENDIAN);
682 ptvcursor_add(cursor, hf_homeplug_psr_txcloss, 2, ENC_BIG_ENDIAN);
683 ptvcursor_add(cursor, hf_homeplug_psr_txcoll, 2, ENC_BIG_ENDIAN);
684 ptvcursor_add(cursor, hf_homeplug_psr_txca3lat, 2, ENC_BIG_ENDIAN);
685 ptvcursor_add(cursor, hf_homeplug_psr_txca2lat, 2, ENC_BIG_ENDIAN);
686 ptvcursor_add(cursor, hf_homeplug_psr_txca1lat, 2, ENC_BIG_ENDIAN);
687 ptvcursor_add(cursor, hf_homeplug_psr_txca0lat, 2, ENC_BIG_ENDIAN);
688 ptvcursor_add(cursor, hf_homeplug_psr_rxbp40, 4, ENC_BIG_ENDIAN);
690 ptvcursor_pop_subtree(cursor);
693 /* Dissection of the Set Local Parameters MME */
694 static void dissect_homeplug_slp(ptvcursor_t * cursor)
696 proto_item * it = NULL;
698 if (!ptvcursor_tree(cursor))
699 return;
701 it = ptvcursor_add_no_advance(cursor, hf_homeplug_slp, homeplug_melen, ENC_NA);
703 ptvcursor_push_subtree(cursor, it, ett_homeplug_slp);
705 ptvcursor_add(cursor, hf_homeplug_slp_ma, 6, ENC_NA);
707 ptvcursor_pop_subtree(cursor);
710 /* Dissection of Load MME */
711 static void dissect_homeplug_loader(ptvcursor_t * cursor, packet_info * pinfo)
713 int mid, length, dlen;
714 proto_item * it = NULL;
716 if (!ptvcursor_tree(cursor))
717 return;
719 it = ptvcursor_add_no_advance(cursor, hf_homeplug_loader, -1, ENC_NA);
721 ptvcursor_push_subtree(cursor, it, ett_homeplug_loader);
723 mid = tvb_get_guint8(ptvcursor_tvbuff(cursor),
724 ptvcursor_current_offset(cursor));
726 length = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
727 ptvcursor_current_offset(cursor) + 1);
729 switch(mid) {
730 case HOMEPLUG_MID_LGDFV:
731 col_set_str(pinfo->cinfo, COL_INFO, "Loader Get Firmware Version");
732 ptvcursor_add(cursor, hf_homeplug_loader_gdfv, 1, ENC_BIG_ENDIAN);
733 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
734 if (length != 0) {
735 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
736 ptvcursor_add(cursor, hf_homeplug_loader_version, -1, ENC_ASCII|ENC_NA);
738 break;
739 case HOMEPLUG_MID_LSF:
740 col_set_str(pinfo->cinfo, COL_INFO, "Loader Start Firmware");
741 ptvcursor_add(cursor, hf_homeplug_loader_lsf, 1, ENC_BIG_ENDIAN);
742 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
743 break;
744 case HOMEPLUG_MID_LWM:
745 col_set_str(pinfo->cinfo, COL_INFO, "Loader Write Memory");
746 ptvcursor_add(cursor, hf_homeplug_loader_lwm, 1, ENC_BIG_ENDIAN);
747 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
748 if (length == 7)
749 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
750 ptvcursor_add(cursor, hf_homeplug_loader_data_address, 4, ENC_BIG_ENDIAN);
752 dlen = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
753 ptvcursor_current_offset(cursor));
754 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
755 if (length != 7)
756 ptvcursor_add(cursor, hf_homeplug_loader_data, dlen, ENC_NA);
757 break;
758 case HOMEPLUG_MID_LRM:
759 col_set_str(pinfo->cinfo, COL_INFO, "Loader Read Memory");
760 ptvcursor_add(cursor, hf_homeplug_loader_lrm, 1, ENC_BIG_ENDIAN);
761 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
762 if (length != 6)
763 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
764 ptvcursor_add(cursor, hf_homeplug_loader_data_address, 4, ENC_BIG_ENDIAN);
765 dlen = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
766 ptvcursor_current_offset(cursor));
767 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
768 if (length != 6)
769 ptvcursor_add(cursor, hf_homeplug_loader_data, dlen, ENC_NA);
770 break;
771 case HOMEPLUG_MID_LRNVM:
772 col_set_str(pinfo->cinfo, COL_INFO, "Loader Read NVM");
773 ptvcursor_add(cursor, hf_homeplug_loader_lrnvm, 1, ENC_BIG_ENDIAN);
774 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
775 if (length != 7)
776 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
777 ptvcursor_add(cursor, hf_homeplug_loader_data_address, 4, ENC_BIG_ENDIAN);
778 dlen = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
779 ptvcursor_current_offset(cursor));
780 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
781 if (length != 7)
782 ptvcursor_add(cursor, hf_homeplug_loader_data, dlen, ENC_NA);
783 break;
784 case HOMEPLUG_MID_LWNVM:
785 col_set_str(pinfo->cinfo, COL_INFO, "Loader Write NVM");
786 ptvcursor_add(cursor, hf_homeplug_loader_lwnvm, 1, ENC_BIG_ENDIAN);
787 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
788 if (length == 7)
789 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
790 ptvcursor_add(cursor, hf_homeplug_loader_data_address, 4, ENC_BIG_ENDIAN);
791 dlen = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
792 ptvcursor_current_offset(cursor));
793 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
794 if (length != 7)
795 ptvcursor_add(cursor, hf_homeplug_loader_data, dlen, ENC_NA);
796 break;
797 case HOMEPLUG_MID_LRESET:
798 col_set_str(pinfo->cinfo, COL_INFO, "Loader Reset");
799 ptvcursor_add(cursor, hf_homeplug_loader_lreset, 1, ENC_BIG_ENDIAN);
800 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
801 break;
802 case HOMEPLUG_MID_GMD:
803 col_set_str(pinfo->cinfo, COL_INFO, "Loader Get Module Data");
804 ptvcursor_add(cursor, hf_homeplug_loader_gmd, 1, ENC_BIG_ENDIAN);
805 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
806 if (length != 10)
807 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
808 ptvcursor_add(cursor, hf_homeplug_loader_module_id, 4, ENC_BIG_ENDIAN);
809 ptvcursor_add(cursor, hf_homeplug_loader_module_offset, 4, ENC_BIG_ENDIAN);
810 if (length == 10) {
811 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
812 } else {
813 ptvcursor_add(cursor, hf_homeplug_loader_module_size, 4, ENC_BIG_ENDIAN);
814 ptvcursor_add(cursor, hf_homeplug_loader_data, length - 13, ENC_NA);
816 break;
817 case HOMEPLUG_MID_SMD:
818 col_set_str(pinfo->cinfo, COL_INFO, "Loader Set Module Data");
819 ptvcursor_add(cursor, hf_homeplug_loader_smd, 1, ENC_BIG_ENDIAN);
820 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
821 if (length == 13)
822 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
823 ptvcursor_add(cursor, hf_homeplug_loader_module_id, 4, ENC_BIG_ENDIAN);
824 ptvcursor_add(cursor, hf_homeplug_loader_module_offset, 4, ENC_BIG_ENDIAN);
825 dlen = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
826 ptvcursor_current_offset(cursor));
827 if (length != 13) {
828 ptvcursor_add(cursor, hf_homeplug_loader_data_length, 2, ENC_BIG_ENDIAN);
829 ptvcursor_add(cursor, hf_homeplug_loader_data, dlen, ENC_NA);
830 } else
831 ptvcursor_add(cursor, hf_homeplug_loader_module_size, 4, ENC_BIG_ENDIAN);
832 break;
833 case HOMEPLUG_MID_CM:
834 col_set_str(pinfo->cinfo, COL_INFO, "Loader Commit Module");
835 ptvcursor_add(cursor, hf_homeplug_loader_cm, 1, ENC_BIG_ENDIAN);
836 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
837 if (length == 5)
838 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
839 ptvcursor_add(cursor, hf_homeplug_loader_module_id, 4, ENC_BIG_ENDIAN);
840 break;
841 case HOMEPLUG_MID_LEMD:
842 col_set_str(pinfo->cinfo, COL_INFO, "Loader Erase Module Data");
843 ptvcursor_add(cursor, hf_homeplug_loader_lemd, 1, ENC_BIG_ENDIAN);
844 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
845 if (length == 9)
846 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
847 ptvcursor_add(cursor, hf_homeplug_loader_module_id, 4, ENC_BIG_ENDIAN);
848 break;
849 case HOMEPLUG_MID_LENVMS:
850 col_set_str(pinfo->cinfo, COL_INFO, "Loader Erase NVM Sectors");
851 ptvcursor_add(cursor, hf_homeplug_loader_lenvms, 1, ENC_BIG_ENDIAN);
852 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
853 if (length == 9)
854 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
855 ptvcursor_add(cursor, hf_homeplug_loader_data_address, 4, ENC_BIG_ENDIAN);
856 ptvcursor_add(cursor, hf_homeplug_loader_module_size, 4, ENC_BIG_ENDIAN);
857 break;
858 case HOMEPLUG_MID_GNVMP:
859 col_set_str(pinfo->cinfo, COL_INFO, "Loader Get NVM Parameters");
860 ptvcursor_add(cursor, hf_homeplug_loader_gnvmp, 1, ENC_BIG_ENDIAN);
861 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
862 if (length == 17) {
863 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
864 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_type, 4, ENC_BIG_ENDIAN);
865 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_pagesize, 4, ENC_BIG_ENDIAN);
866 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_blocksize, 4, ENC_BIG_ENDIAN);
867 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_memorysize, 4, ENC_BIG_ENDIAN);
869 break;
870 case HOMEPLUG_MID_SNVMP:
871 col_set_str(pinfo->cinfo, COL_INFO, "Loader Set NVM Parameters");
872 ptvcursor_add(cursor, hf_homeplug_loader_snvmp, 1, ENC_BIG_ENDIAN);
873 ptvcursor_add(cursor, hf_homeplug_loader_length, 2, ENC_BIG_ENDIAN);
874 if (length == 17)
875 ptvcursor_add(cursor, hf_homeplug_loader_status, 1, ENC_BIG_ENDIAN);
876 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_type, 4, ENC_BIG_ENDIAN);
877 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_pagesize, 4, ENC_BIG_ENDIAN);
878 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_blocksize, 4, ENC_BIG_ENDIAN);
879 ptvcursor_add(cursor, hf_homeplug_loader_nvmp_memorysize, 4, ENC_BIG_ENDIAN);
880 break;
881 default:
882 ptvcursor_add(cursor, hf_homeplug_loader_mid, 1, ENC_BIG_ENDIAN);
883 break;
886 ptvcursor_pop_subtree(cursor);
889 /* Dissection of Host Request MME */
890 static void dissect_homeplug_hreq(ptvcursor_t * cursor, packet_info * pinfo)
892 int mid, length;
893 proto_item * it = NULL;
895 if (!ptvcursor_tree(cursor))
896 return;
898 it = ptvcursor_add_no_advance(cursor, hf_homeplug_hreq, homeplug_melen, ENC_NA);
900 ptvcursor_push_subtree(cursor, it, ett_homeplug_hreq);
902 mid = tvb_get_guint8(ptvcursor_tvbuff(cursor),
903 ptvcursor_current_offset(cursor));
904 length = tvb_get_ntohs(ptvcursor_tvbuff(cursor),
905 ptvcursor_current_offset(cursor) + 1);
907 switch(mid) {
908 case HOMEPLUG_MID_GDV:
909 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get Device Version");
910 ptvcursor_add(cursor, hf_homeplug_hreq_gdv, 1, ENC_BIG_ENDIAN);
911 break;
912 case HOMEPLUG_MID_GFV:
913 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get Firmware Version");
914 ptvcursor_add(cursor, hf_homeplug_hreq_gfv, 1, ENC_BIG_ENDIAN);
915 break;
916 case HOMEPLUG_MID_GNEK:
917 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get Network Encryption Key Request");
918 ptvcursor_add(cursor, hf_homeplug_hreq_gnek, 1, ENC_BIG_ENDIAN);
919 break;
920 case HOMEPLUG_MID_GCLBPL:
921 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get/ Clear Local Bridge Proxy List");
922 ptvcursor_add(cursor, hf_homeplug_hreq_gclbpl, 1, ENC_BIG_ENDIAN);
923 break;
924 case HOMEPLUG_MID_NVDS:
925 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Non-volatile Database Status");
926 ptvcursor_add(cursor, hf_homeplug_hreq_nvds, 1, ENC_BIG_ENDIAN);
927 break;
928 case HOMEPLUG_MID_GRBT:
929 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get Remote Bridge Table");
930 ptvcursor_add(cursor, hf_homeplug_hreq_grbt, 1, ENC_BIG_ENDIAN);
931 break;
932 case HOMEPLUG_MID_GSLNM:
933 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get/Set Logical Network Mappings");
934 ptvcursor_add(cursor, hf_homeplug_hreq_gslnm, 1, ENC_BIG_ENDIAN);
935 break;
936 case HOMEPLUG_MID_GSSS:
937 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: Get/Set Spectral Scaling");
938 ptvcursor_add(cursor, hf_homeplug_hreq_gsss, 1, ENC_BIG_ENDIAN);
939 break;
940 case HOMEPLUG_MID_RSL:
941 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: MAC Reset to Secondary Loader");
942 ptvcursor_add(cursor, hf_homeplug_hreq_rsl, 1, ENC_BIG_ENDIAN);
943 break;
944 case HOMEPLUG_MID_RESET:
945 col_set_str(pinfo->cinfo, COL_INFO, "Host Request: MAC Reset");
946 ptvcursor_add(cursor, hf_homeplug_hreq_reset, 1, ENC_BIG_ENDIAN);
947 ptvcursor_add(cursor, hf_homeplug_hreq_reset_type, 1, ENC_BIG_ENDIAN);
948 if (length == 4)
949 ptvcursor_add(cursor, hf_homeplug_hreq_reset_delay, 2, ENC_BIG_ENDIAN);
950 break;
951 default:
952 ptvcursor_add(cursor, hf_homeplug_hreq_mid, 1, ENC_BIG_ENDIAN);
953 break;
956 ptvcursor_pop_subtree(cursor);
959 /* Dissection of Host Response MME */
960 static void dissect_homeplug_hrsp(ptvcursor_t * cursor, packet_info * pinfo)
962 int mid;
963 proto_item * it = NULL;
965 if (!ptvcursor_tree(cursor))
966 return;
968 it = ptvcursor_add_no_advance(cursor, hf_homeplug_hrsp, homeplug_melen, ENC_NA);
970 ptvcursor_push_subtree(cursor, it, ett_homeplug_hrsp);
972 mid = tvb_get_guint8(ptvcursor_tvbuff(cursor),
973 ptvcursor_current_offset(cursor));
974 switch(mid) {
975 case HOMEPLUG_MID_GDVR:
976 col_set_str(pinfo->cinfo, COL_INFO, "Host Response: Get Device Version");
977 ptvcursor_add(cursor, hf_homeplug_hrsp_gdvr, 1, ENC_BIG_ENDIAN);
978 ptvcursor_add(cursor, hf_homeplug_hrsp_version, -1, ENC_ASCII|ENC_NA);
979 break;
980 case HOMEPLUG_MID_GFVR:
981 col_set_str(pinfo->cinfo, COL_INFO, "Host Response: Get Firmware Version");
982 ptvcursor_add(cursor, hf_homeplug_hrsp_gfvr, 1, ENC_BIG_ENDIAN);
983 ptvcursor_add(cursor, hf_homeplug_hrsp_version, -1, ENC_ASCII|ENC_NA);
984 break;
985 case HOMEPLUG_MID_GNEKR:
986 col_set_str(pinfo->cinfo, COL_INFO, "Get Network Encryption Key");
987 ptvcursor_add(cursor, hf_homeplug_hrsp_gnekr, 1, ENC_BIG_ENDIAN);
988 ptvcursor_add(cursor, hf_homeplug_hrsp_gnekr_select, 1, ENC_BIG_ENDIAN);
989 ptvcursor_add(cursor, hf_homeplug_hrsp_gnekr_key, 8, ENC_BIG_ENDIAN);
990 break;
991 case HOMEPLUG_MID_INVALID:
992 col_set_str(pinfo->cinfo, COL_INFO, "Host Response: Invalid MME");
993 ptvcursor_add(cursor, hf_homeplug_hrsp_invalid, 1, ENC_BIG_ENDIAN);
994 break;
995 default:
996 ptvcursor_add(cursor, hf_homeplug_hrsp_mid, 1, ENC_BIG_ENDIAN);
997 break;
1000 ptvcursor_pop_subtree(cursor);
1003 /* Dissection of Host Tag MME */
1004 static void dissect_homeplug_htag(ptvcursor_t * cursor)
1006 if (!ptvcursor_tree(cursor))
1007 return;
1009 ptvcursor_add_no_advance(cursor, hf_homeplug_htag, homeplug_melen, ENC_NA);
1012 /* Dissection of the Network Statistics MME */
1013 static void dissect_homeplug_ns(ptvcursor_t * cursor, packet_info * pinfo)
1015 guint8 iTone = 0;
1016 guint8 i_buffer = 0;
1018 guint16 ns_bytes40 = 0;
1019 guint64 newt_da = 0;
1020 gboolean extended = (homeplug_melen >= HOMEPLUG_NS_EXT_LEN);
1021 proto_item * ti;
1023 /* Append Basic/Extender specifier to info column */
1024 col_append_str(pinfo->cinfo, COL_INFO, extended ? " Extended" : " Basic");
1026 if (!ptvcursor_tree(cursor))
1027 return;
1029 ptvcursor_add_with_subtree(cursor, hf_homeplug_ns, homeplug_melen, ENC_BIG_ENDIAN,
1030 ett_homeplug_ns);
1032 ti = proto_tree_add_boolean(ptvcursor_tree(cursor), hf_homeplug_ns_extended,
1033 ptvcursor_tvbuff(cursor), 0, 0, extended);
1034 PROTO_ITEM_SET_GENERATED(ti);
1036 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_netw_ctrl_ac, 1, ENC_BIG_ENDIAN);
1037 ptvcursor_add(cursor, hf_homeplug_ns_netw_ctrl_icid, 1, ENC_BIG_ENDIAN);
1039 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_bytes40_robo, 2, ENC_LITTLE_ENDIAN);
1040 ns_bytes40 = tvb_get_letohs(ptvcursor_tvbuff(cursor),
1041 ptvcursor_current_offset(cursor));
1042 proto_tree_add_text(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor),
1043 ptvcursor_current_offset(cursor), 2, "MHz : %.3f", (float)(ns_bytes40)/42);
1044 ptvcursor_advance(cursor, 2);
1046 ptvcursor_add(cursor, hf_homeplug_ns_fails_robo, 2, ENC_LITTLE_ENDIAN);
1047 ptvcursor_add(cursor, hf_homeplug_ns_drops_robo, 2, ENC_LITTLE_ENDIAN);
1049 while (iTone < 15) {
1050 newt_da = ((gint64)tvb_get_ntoh24(ptvcursor_tvbuff(cursor),
1051 ptvcursor_current_offset(cursor))) << 24;
1052 newt_da |= tvb_get_ntoh24(ptvcursor_tvbuff(cursor),
1053 ptvcursor_current_offset(cursor)+3);
1055 if (newt_da != HOMEPLUG_ADDR_INEXISTANT) {
1056 ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
1057 ett_homeplug_tone, "Tone Map #%d", iTone+1);
1059 ptvcursor_add(cursor, hf_homeplug_ns_netw_da, 6, ENC_NA);
1061 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_bytes40, 2, ENC_LITTLE_ENDIAN);
1062 ns_bytes40 = tvb_get_letohs(ptvcursor_tvbuff(cursor),
1063 ptvcursor_current_offset(cursor));
1064 proto_tree_add_text(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor),
1065 ptvcursor_current_offset(cursor), 2, "MHz : %.3f", (float)(ns_bytes40)/42);
1066 ptvcursor_advance(cursor, 2);
1068 ptvcursor_add(cursor, hf_homeplug_ns_fails, 2, ENC_LITTLE_ENDIAN);
1069 ptvcursor_add(cursor, hf_homeplug_ns_drops, 2, ENC_LITTLE_ENDIAN);
1071 ptvcursor_pop_subtree(cursor);
1072 } else {
1073 proto_tree_add_text(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor),
1074 ptvcursor_current_offset(cursor), 12, "Tone Map #%d does not exist", iTone+1);
1077 iTone++;
1079 if (extended) {
1080 while (i_buffer < 6) {
1081 ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
1082 ett_homeplug_tx_bfr_state, "TX_BFR_%d_STATE", i_buffer);
1084 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_buf_in_use, 1, ENC_BIG_ENDIAN);
1085 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_prio, 1, ENC_BIG_ENDIAN);
1086 ptvcursor_add(cursor, hf_homeplug_ns_msdu_len, 1, ENC_BIG_ENDIAN);
1087 ptvcursor_add_no_advance(cursor, hf_homeplug_ns_seqn, 1, ENC_BIG_ENDIAN);
1088 ptvcursor_add(cursor, hf_homeplug_ns_toneidx, 1, ENC_BIG_ENDIAN);
1090 ptvcursor_pop_subtree(cursor);
1091 i_buffer++;
1095 ptvcursor_pop_subtree(cursor);
1098 /* Dissection of the Bridging Characteristics Network MME */
1099 static void dissect_homeplug_bcn(ptvcursor_t * cursor)
1101 proto_item * it = NULL;
1102 guint8 i_bridge = 0;
1103 guint8 num_das;
1104 guint8 i_da;
1105 guint8 fbn;
1107 it = ptvcursor_add_no_advance(cursor, hf_homeplug_bcn, homeplug_melen, ENC_NA);
1109 ptvcursor_push_subtree(cursor, it, ett_homeplug_bcn);
1111 ptvcursor_add_no_advance(cursor, hf_homeplug_bcn_network, 1, ENC_BIG_ENDIAN);
1112 ptvcursor_add_no_advance(cursor, hf_homeplug_bcn_return, 1, ENC_BIG_ENDIAN);
1113 ptvcursor_add_no_advance(cursor, hf_homeplug_bcn_rsvd, 1, ENC_BIG_ENDIAN);
1114 fbn = tvb_get_guint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor))
1115 & HOMEPLUG_BCN_FBN;
1116 ptvcursor_add(cursor, hf_homeplug_bcn_fbn, 1, ENC_BIG_ENDIAN);
1117 while (i_bridge < 2) {
1118 ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
1119 ett_homeplug_bridge, "Bridge #%d", fbn + i_bridge);
1121 ptvcursor_add(cursor, hf_homeplug_bcn_brda, 6, ENC_NA);
1122 num_das = tvb_get_guint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
1123 ptvcursor_add(cursor, hf_homeplug_bcn_bp_das, 1, ENC_BIG_ENDIAN);
1124 for (i_da = 0; i_da < num_das; i_da++) {
1125 ptvcursor_add(cursor, hf_homeplug_bcn_bp_da, 6, ENC_NA);
1128 ptvcursor_pop_subtree(cursor);
1129 i_bridge++;
1132 ptvcursor_pop_subtree(cursor);
1135 /* Dissection of the Bridging Characteristics Local MME */
1136 static void dissect_homeplug_bcl(ptvcursor_t * cursor)
1138 proto_item * it = NULL;
1139 guint8 num_das;
1140 guint8 i_da = 0;
1142 it = ptvcursor_add_no_advance(cursor, hf_homeplug_bcl, homeplug_melen, ENC_NA);
1144 ptvcursor_push_subtree(cursor, it, ett_homeplug_bcl);
1146 ptvcursor_add_no_advance(cursor, hf_homeplug_bcl_network, 1, ENC_BIG_ENDIAN);
1147 ptvcursor_add_no_advance(cursor, hf_homeplug_bcl_return, 1, ENC_BIG_ENDIAN);
1148 ptvcursor_add(cursor, hf_homeplug_bcl_rsvd, 1, ENC_BIG_ENDIAN);
1150 num_das = tvb_get_guint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
1151 ptvcursor_add(cursor, hf_homeplug_bcl_hprox_das, 1, ENC_BIG_ENDIAN);
1153 while (i_da < num_das) {
1154 ptvcursor_add(cursor, hf_homeplug_bcl_hpbda, 6, ENC_NA);
1155 i_da++;
1158 ptvcursor_pop_subtree(cursor);
1161 /* Dissection of the Bridging Characteristics MME */
1162 static void dissect_homeplug_bc(ptvcursor_t * cursor, packet_info * pinfo)
1164 gboolean network;
1166 if (!ptvcursor_tree(cursor))
1167 return;
1169 network = tvb_get_guint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor))
1170 & HOMEPLUG_BC_NETWORK;
1172 /* Append Network/Local specifier to info column */
1173 col_append_str(pinfo->cinfo, COL_INFO, network ? " Network" : " Local");
1175 /* Call specific dissector */
1176 if (network)
1177 dissect_homeplug_bcn(cursor);
1178 else
1179 dissect_homeplug_bcl(cursor);
1182 /* Dissection of the Set Transmit Characteristics MME */
1183 static void dissect_homeplug_stc(ptvcursor_t * cursor)
1185 proto_item * it = NULL;
1187 if (!ptvcursor_tree(cursor))
1188 return;
1190 it = ptvcursor_add_no_advance(cursor, hf_homeplug_stc, homeplug_melen, ENC_NA);
1192 ptvcursor_push_subtree(cursor, it, ett_homeplug_stc);
1194 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_lco, 1, ENC_BIG_ENDIAN);
1195 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_encf, 1, ENC_BIG_ENDIAN);
1196 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_txprio, 1, ENC_BIG_ENDIAN);
1197 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_rexp, 1, ENC_BIG_ENDIAN);
1198 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_txcf, 1, ENC_BIG_ENDIAN);
1199 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_cftop, 1, ENC_BIG_ENDIAN);
1200 ptvcursor_add(cursor, hf_homeplug_stc_rsvd1, 1, ENC_BIG_ENDIAN);
1201 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_retry, 1, ENC_BIG_ENDIAN);
1202 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_rsvd2, 1, ENC_BIG_ENDIAN);
1203 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_dder, 1, ENC_BIG_ENDIAN);
1204 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_dur, 1, ENC_BIG_ENDIAN);
1205 ptvcursor_add_no_advance(cursor, hf_homeplug_stc_ebp, 1, ENC_BIG_ENDIAN);
1206 ptvcursor_add(cursor, hf_homeplug_stc_dees, 1, ENC_BIG_ENDIAN);
1207 ptvcursor_add(cursor, hf_homeplug_stc_txeks, 1, ENC_BIG_ENDIAN);
1209 ptvcursor_pop_subtree(cursor);
1211 return;
1214 /* Dissection of unknown tags */
1215 static void dissect_homeplug_unknown(ptvcursor_t * cursor)
1217 ptvcursor_add(cursor, hf_homeplug_data, homeplug_melen, ENC_NA);
1220 static void dissect_homeplug_mme(ptvcursor_t * cursor, packet_info * pinfo)
1222 col_append_sep_str(pinfo->cinfo, COL_INFO, ", ",
1223 val_to_str(homeplug_metype, homeplug_metype_vals, "Unknown 0x%x"));
1225 switch(homeplug_metype) {
1226 case HOMEPLUG_MME_RCE:
1227 dissect_homeplug_rce(cursor);
1228 break;
1229 case HOMEPLUG_MME_CER:
1230 dissect_homeplug_cer(cursor);
1231 break;
1232 case HOMEPLUG_MME_VS:
1233 col_set_str(pinfo->cinfo, COL_INFO, "Vendor Specific");
1234 dissect_homeplug_vs(cursor);
1235 break;
1236 case HOMEPLUG_MME_RBA:
1237 col_set_str(pinfo->cinfo, COL_INFO, "Replace Bridge Address");
1238 dissect_homeplug_rba(cursor);
1239 break;
1240 case HOMEPLUG_MME_SNK:
1241 col_set_str(pinfo->cinfo, COL_INFO, "Set Network Encryption Key");
1242 dissect_homeplug_snk(cursor);
1243 break;
1244 case HOMEPLUG_MME_MWR:
1245 col_set_str(pinfo->cinfo, COL_INFO, "Multicast With Response");
1246 dissect_homeplug_mwr(cursor);
1247 break;
1248 case HOMEPLUG_MME_CNK:
1249 col_set_str(pinfo->cinfo, COL_INFO, "Confirm Network Encryption Key");
1250 dissect_homeplug_cnk(cursor);
1251 break;
1252 case HOMEPLUG_MME_RPS:
1253 dissect_homeplug_rps(cursor);
1254 break;
1255 case HOMEPLUG_MME_PSR:
1256 dissect_homeplug_psr(cursor);
1257 break;
1258 case HOMEPLUG_MME_SLP:
1259 dissect_homeplug_slp(cursor);
1260 break;
1261 case HOMEPLUG_MME_LOADER:
1262 col_set_str(pinfo->cinfo, COL_INFO, "Load Firmware");
1263 dissect_homeplug_loader(cursor, pinfo);
1264 break;
1265 case HOMEPLUG_MME_HREQ:
1266 col_set_str(pinfo->cinfo, COL_INFO, "Host Request");
1267 dissect_homeplug_hreq(cursor, pinfo);
1268 break;
1269 case HOMEPLUG_MME_HRSP:
1270 col_set_str(pinfo->cinfo, COL_INFO, "Host Response");
1271 dissect_homeplug_hrsp(cursor, pinfo);
1272 break;
1273 case HOMEPLUG_MME_HTAG:
1274 col_set_str(pinfo->cinfo, COL_INFO, "Host Tag");
1275 dissect_homeplug_htag(cursor);
1276 break;
1277 case HOMEPLUG_MME_NS:
1278 dissect_homeplug_ns(cursor, pinfo);
1279 break;
1280 case HOMEPLUG_MME_BC:
1281 dissect_homeplug_bc(cursor, pinfo);
1282 break;
1283 case HOMEPLUG_MME_STC:
1284 dissect_homeplug_stc(cursor);
1285 break;
1286 default:
1287 dissect_homeplug_unknown(cursor);
1288 break;
1292 #define TVB_LEN_GREATEST 1
1293 #define TVB_LEN_UNDEF 0
1294 #define TVB_LEN_SHORTEST -1
1295 static int check_tvb_length(ptvcursor_t *cursor, const gint length)
1297 if (!cursor)
1298 return TVB_LEN_UNDEF;
1300 if (tvb_reported_length_remaining(ptvcursor_tvbuff(cursor),
1301 ptvcursor_current_offset(cursor)) < length)
1302 return TVB_LEN_SHORTEST;
1304 return TVB_LEN_GREATEST;
1307 static void
1308 dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
1310 proto_item * it= NULL;
1311 proto_tree * homeplug_tree= NULL;
1312 ptvcursor_t * cursor= NULL;
1314 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HomePlug");
1315 /* Clear out stuff in the info column */
1316 col_set_str(pinfo->cinfo, COL_INFO, "MAC Management");
1318 homeplug_offset = 0;
1320 if (tree) {
1321 it = proto_tree_add_item(tree, proto_homeplug, tvb, homeplug_offset, -1, ENC_NA);
1322 homeplug_tree = proto_item_add_subtree(it, ett_homeplug);
1323 cursor = ptvcursor_new(homeplug_tree, tvb, 0);
1326 /* We do not have enough data to read mctrl field stop the dissection */
1327 if (check_tvb_length(cursor, HOMEPLUG_MCTRL_LEN) != TVB_LEN_SHORTEST) {
1329 dissect_homeplug_mctrl(cursor);
1331 /** homeplug_ne indicates the number of MME entries. This field is fetched
1332 * from MCTRL.
1334 if ((homeplug_ne > 0)) {
1335 col_clear(pinfo->cinfo, COL_INFO);
1337 for (; homeplug_ne > 0; homeplug_ne--) {
1339 /* Check we have enough data in tvb to read MEHDR */
1340 if (check_tvb_length(cursor, HOMEPLUG_MEHDR_LEN) == TVB_LEN_SHORTEST)
1341 break;
1342 dissect_homeplug_mehdr(cursor);
1344 /* Check we have enough data in tvb to read MELEN */
1345 if (check_tvb_length(cursor, HOMEPLUG_MELEN_LEN) == TVB_LEN_SHORTEST)
1346 break;
1347 dissect_homeplug_melen(cursor);
1349 dissect_homeplug_mme(cursor, pinfo);
1353 if (cursor)
1354 ptvcursor_free(cursor);
1358 void
1359 proto_reg_handoff_homeplug(void)
1361 dissector_handle_t homeplug_handle;
1363 homeplug_handle = create_dissector_handle(dissect_homeplug, proto_homeplug);
1364 dissector_add_uint("ethertype", ETHERTYPE_HOMEPLUG, homeplug_handle);
1367 void
1368 proto_register_homeplug(void)
1371 static hf_register_info hf[] = {
1372 /* MAC Control Field */
1373 { &hf_homeplug_mctrl,
1374 { "MAC Control Field", "homeplug.mctrl",
1375 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1378 { &hf_homeplug_mctrl_reserved,
1379 { "Reserved", "homeplug.mctrl.rsvd",
1380 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_MCTRL_RSVD, NULL, HFILL }
1383 { &hf_homeplug_mctrl_ne,
1384 { "Number of MAC Data Entries", "homeplug.mctrl.ne",
1385 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_MCTRL_NE, NULL, HFILL }
1388 /* MAC Entry Header */
1389 { &hf_homeplug_mehdr,
1390 { "MAC Management Entry Header", "homeplug.mehdr",
1391 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1394 { &hf_homeplug_mehdr_mev,
1395 { "MAC Entry Version", "homeplug.mehdr.mev",
1396 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_MEHDR_MEV, NULL, HFILL }
1399 { &hf_homeplug_mehdr_metype,
1400 { "MAC Entry Type", "homeplug.mehdr.metype",
1401 FT_UINT8, BASE_HEX, VALS(homeplug_metype_vals), HOMEPLUG_MEHDR_METYPE, NULL, HFILL }
1404 /* MAC Entry Len */
1405 { &hf_homeplug_melen,
1406 { "MAC Management Entry Length", "homeplug.melen",
1407 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1410 /* MAC Management Entry */
1411 #if 0
1412 { &hf_homeplug_mme,
1413 { "MAC Management Entry Data", "homeplug.mmentry",
1414 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1416 #endif
1418 /* Request Channel Estimation */
1419 { &hf_homeplug_rce,
1420 { "Request Channel Estimation", "homeplug.rce",
1421 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1424 { &hf_homeplug_rce_cev,
1425 { "Channel Estimation Version", "homeplug.rce.cev",
1426 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_RCE_CEV, NULL, HFILL }
1429 { &hf_homeplug_rce_rsvd,
1430 { "Reserved", "homeplug.rce.rsvd",
1431 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_RCE_RSVD, NULL, HFILL }
1434 /* Channel Estimation Response */
1435 { &hf_homeplug_cer,
1436 { "Channel Estimation Response", "homeplug.cer",
1437 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1440 { &hf_homeplug_cer_cerv,
1441 { "Channel Estimation Response Version", "homeplug.cer.cerv",
1442 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_CERV, NULL, HFILL }
1445 { &hf_homeplug_cer_rsvd1,
1446 { "Reserved", "homeplug.cer.rsvd1",
1447 FT_UINT16, BASE_DEC, NULL, HOMEPLUG_CER_RSVD, NULL, HFILL }
1450 { &hf_homeplug_cer_rxtmi,
1451 { "Receive Tone Map Index", "homeplug.cer.rxtmi",
1452 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_RXTMI, NULL, HFILL }
1455 /* TODO must append vt[79-0] */
1457 { &hf_homeplug_cer_vt,
1458 {"Valid Tone Flags", "homeplug.cer.vt",
1459 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
1462 { &hf_homeplug_cer_rate,
1463 { "FEC Rate", "homeplug.cer.rate",
1464 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_RATE, NULL, HFILL }
1467 { &hf_homeplug_cer_bp,
1468 { "Bridge Proxy", "homeplug.cer.bp",
1469 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_BP, NULL, HFILL }
1472 { &hf_homeplug_cer_mod,
1473 { "Modulation Method", "homeplug.cer.mod",
1474 FT_UINT8, BASE_DEC, VALS(homeplug_cer_mod_vals), HOMEPLUG_CER_MOD_MASK,
1475 NULL, HFILL }
1478 { &hf_homeplug_cer_vt11,
1479 { "Valid Tone Flags [83-80]", "homeplug.cer.vt11",
1480 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_VT11, NULL, HFILL }
1483 { &hf_homeplug_cer_rsvd2,
1484 { "Reserved", "homeplug.cer.rsvd2",
1485 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_RSVD2, NULL, HFILL }
1488 { &hf_homeplug_cer_nbdas,
1489 { "Number Bridged Destination Addresses", "homeplug.cer.nbdas",
1490 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_CER_NBDAS, NULL, HFILL }
1493 { &hf_homeplug_cer_bda,
1494 { "Bridged Destination Address", "homeplug.cer.bda",
1495 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }
1498 /* Replace Bridge Address */
1499 { &hf_homeplug_rba,
1500 { "Replace Bridge Address", "homeplug.rba",
1501 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1504 /* Vendor Specific */
1505 { &hf_homeplug_vs,
1506 { "Vendor Specific", "homeplug.vs",
1507 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1510 { &hf_homeplug_vs_dir,
1511 { "Direction", "homeplug.vs.dir",
1512 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_VS_DIR, NULL, HFILL }
1515 { &hf_homeplug_vs_mid,
1516 { "Message ID", "homeplug.vs.mid",
1517 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_VS_MID, NULL, HFILL }
1520 { &hf_homeplug_vs_oui,
1521 { "OUI", "homeplug.vs.oui",
1522 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }
1525 /* Set Network Encryption Key */
1526 { &hf_homeplug_snk,
1527 { "Set Network Encryption Key", "homeplug.snk",
1528 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1531 { &hf_homeplug_snk_eks,
1532 { "Encryption Key Select", "homeplug.snk.eks",
1533 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1536 { &hf_homeplug_snk_nek,
1537 { "Network Encryption Key", "homeplug.snk.nek",
1538 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
1541 /* Multicast With Response */
1542 { &hf_homeplug_mwr,
1543 { "Multicast With Response", "homeplug.mwr",
1544 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1547 /* Confirm Network Encryption Key */
1548 { &hf_homeplug_cnk,
1549 { "Confirm Network Encryption Key", "homeplug.cnk",
1550 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1553 /* Host Tag */
1554 { &hf_homeplug_htag,
1555 { "Host Tag", "homeplug.htag",
1556 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1559 /* Request Parameters and Statistics */
1560 { &hf_homeplug_rps,
1561 { "Request Parameters and Statistics", "homeplug.rps",
1562 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1565 /* Parameters and Statistics Response */
1566 { &hf_homeplug_psr,
1567 { "Parameters and Statistics Response", "homeplug.psr",
1568 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1571 { &hf_homeplug_psr_txack,
1572 { "Transmit ACK Counter", "homeplug.psr.txack",
1573 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1576 { &hf_homeplug_psr_txnack,
1577 { "Transmit NACK Counter", "homeplug.psr.txnack",
1578 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1581 { &hf_homeplug_psr_txfail,
1582 { "Transmit FAIL Counter", "homeplug.psr.txfail",
1583 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1586 { &hf_homeplug_psr_txcloss,
1587 { "Transmit Contention Loss Counter", "homeplug.psr.txcloss",
1588 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1591 { &hf_homeplug_psr_txcoll,
1592 { "Transmit Collision Counter", "homeplug.psr.txcoll",
1593 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1596 { &hf_homeplug_psr_txca3lat,
1597 { "Transmit CA3 Latency Counter", "homeplug.psr.txca3lat",
1598 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1601 { &hf_homeplug_psr_txca2lat,
1602 { "Transmit CA2 Latency Counter", "homeplug.psr.txca2lat",
1603 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1605 { &hf_homeplug_psr_txca1lat,
1606 { "Transmit CA1 Latency Counter", "homeplug.psr.txca1lat",
1607 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1609 { &hf_homeplug_psr_txca0lat,
1610 { "Transmit CA0 Latency Counter", "homeplug.psr.txca0lat",
1611 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1614 { &hf_homeplug_psr_rxbp40,
1615 { "Receive Cumulative Bytes per 40-symbol", "homeplug.psr.rxbp40",
1616 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1619 /* Set Local Parameters */
1620 { &hf_homeplug_slp,
1621 { "Set Local Parameters", "homeplug.slp",
1622 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1625 { &hf_homeplug_slp_ma,
1626 { "MAC Address", "homeplug.slp.ma",
1627 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }
1630 /* LOAD */
1631 { &hf_homeplug_loader,
1632 { "Loader", "homeplug.leader",
1633 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1636 { &hf_homeplug_loader_mid,
1637 { "Message ID", "homeplug.loader.mid",
1638 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1641 { &hf_homeplug_loader_length,
1642 { "Length", "homeplug.loader.length",
1643 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1646 { &hf_homeplug_loader_status,
1647 { "Status", "homeplug.loader.status",
1648 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1651 { &hf_homeplug_loader_version,
1652 { "Version", "homeplug.loader.version",
1653 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
1656 { &hf_homeplug_loader_gdfv,
1657 { "Get Device/Firmware Version", "homeplug.loader.gdfv",
1658 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1661 { &hf_homeplug_loader_lsf,
1662 { "Start Firmware", "homeplug.loader.lsf",
1663 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1666 { &hf_homeplug_loader_lwm,
1667 { "Write Memory", "homeplug.loader.lwm",
1668 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1671 { &hf_homeplug_loader_lrm,
1672 { "Read Memory", "homeplug.loader.lrm",
1673 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1676 { &hf_homeplug_loader_lrnvm,
1677 { "Read NVM Data", "homeplug.loader.lrnvm",
1678 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1681 { &hf_homeplug_loader_lwnvm,
1682 { "Write NVM Data", "homeplug.loader.lwnvm",
1683 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1686 { &hf_homeplug_loader_lreset,
1687 { "Reset", "homeplug.loader.lreset",
1688 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1691 { &hf_homeplug_loader_gmd,
1692 { "Get Module Data", "homeplug.loader.gmd",
1693 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1696 { &hf_homeplug_loader_smd,
1697 { "Set Module Data", "homeplug.loader.smd",
1698 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1701 { &hf_homeplug_loader_module_id,
1702 { "Module ID", "homeplug.loader.module.id",
1703 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
1706 { &hf_homeplug_loader_module_offset,
1707 { "Offset", "homeplug.loader.module.offset",
1708 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1711 { &hf_homeplug_loader_module_size,
1712 { "Module size", "homeplug.loader.module.size",
1713 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1716 { &hf_homeplug_loader_data_length,
1717 { "Data length", "homeplug.loader.data.length",
1718 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1721 { &hf_homeplug_loader_data_address,
1722 { "Address", "homeplug.loader.data.address",
1723 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
1726 { &hf_homeplug_loader_data,
1727 { "Data", "homeplug.loader.data",
1728 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
1731 { &hf_homeplug_loader_cm,
1732 { "Commit Modules", "homeplug.loader.cm",
1733 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1736 { &hf_homeplug_loader_lemd,
1737 { "Erase Module Data", "homeplug.loader.emd",
1738 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1741 { &hf_homeplug_loader_lenvms,
1742 { "Erase NVM Sectors", "homeplug.loader.lenvms",
1743 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1746 { &hf_homeplug_loader_gnvmp,
1747 { "Get NVM Parameters", "homeplug.loader.gnvmp",
1748 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1751 { &hf_homeplug_loader_nvmp_type,
1752 { "Type", "homeplug.loader.nvmp.type",
1753 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1756 { &hf_homeplug_loader_nvmp_pagesize,
1757 { "Page Size", "homeplug.loader.nvmp.pagesize",
1758 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1761 { &hf_homeplug_loader_nvmp_blocksize,
1762 { "Block Size", "homeplug.loader.nvmp.blocksize",
1763 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1766 { &hf_homeplug_loader_nvmp_memorysize,
1767 { "Memory Size", "homeplug.loader.nvmp.memorysize",
1768 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
1771 { &hf_homeplug_loader_snvmp,
1772 { "Set NVM Parameters", "homeplug.loader.snvmp",
1773 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1776 /* Host Request */
1777 { &hf_homeplug_hreq,
1778 { "Host Request", "homeplug.hreq",
1779 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1782 { &hf_homeplug_hreq_mid,
1783 { "Message ID", "homeplug.hreq.mid",
1784 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1787 { &hf_homeplug_hreq_gdv,
1788 { "Get Device Version", "homeplug.hreq.gdv",
1789 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1792 { &hf_homeplug_hreq_gfv,
1793 { "Get Firmware Version", "homeplug.hreq.gfv",
1794 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1797 { &hf_homeplug_hreq_gnek,
1798 { "Get Network Encryption Key", "homeplug.hreq.gnek",
1799 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1802 { &hf_homeplug_hreq_gclbpl,
1803 { "Get/Clear Local Bridge Proxy List", "homeplug.hreq.gclbpl",
1804 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1807 { &hf_homeplug_hreq_nvds,
1808 { "Non-volatile Database Status", "homeplug.hreq.nvds",
1809 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1812 { &hf_homeplug_hreq_grbt,
1813 { "Get Remote Bridge Table", "homeplug.hreq.grbt",
1814 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1817 { &hf_homeplug_hreq_gslnm,
1818 { "Get/Set Logical Network Mapping", "homeplug.hreq.gslnm",
1819 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1822 { &hf_homeplug_hreq_gsss,
1823 { "Get/Set Spectral Scaling", "homeplug.hreq.gsss",
1824 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1827 { &hf_homeplug_hreq_rsl,
1828 { "Reset Secondary Loader", "homeplug.hreq.rsl",
1829 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1832 { &hf_homeplug_hreq_reset,
1833 { "Reset", "homeplug.hreq.reset",
1834 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1837 { &hf_homeplug_hreq_reset_type,
1838 { "Type", "homeplug.hreq.reset.type",
1839 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1842 { &hf_homeplug_hreq_reset_delay,
1843 { "Delay", "homeplug.hreq.reset.delay",
1844 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1847 /* Host Response */
1848 { &hf_homeplug_hrsp,
1849 { "Host Response", "homeplug.hrsp",
1850 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1853 { &hf_homeplug_hrsp_mid,
1854 { "Message ID", "homeplug.hrsp.mid",
1855 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1858 { &hf_homeplug_hrsp_gdvr,
1859 { "Get Device Version", "homeplug.hrsp.gdvr",
1860 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1863 { &hf_homeplug_hrsp_gfvr,
1864 { "Get Firmware Version", "homeplug.hrsp.gfvr",
1865 FT_UINT8, BASE_DEC, NULL, 0x0, "Get Firmwave Version", HFILL }
1868 { &hf_homeplug_hrsp_gnekr,
1869 { "Get Network Encryption Key", "homeplug.hrsp.gnekr",
1870 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1873 { &hf_homeplug_hrsp_gnekr_select,
1874 { "Key Select", "homeplug.hrsp.gnekr.select",
1875 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1878 { &hf_homeplug_hrsp_gnekr_key,
1879 { "Key", "homeplug.hrsp.gnekr.key",
1880 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }
1883 { &hf_homeplug_hrsp_invalid,
1884 { "Invalid", "homeplug.hrsp.invalid",
1885 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
1888 { &hf_homeplug_hrsp_version,
1889 { "Version", "homeplug.hrsp.version",
1890 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
1893 /* Network Statistics */
1894 { &hf_homeplug_ns,
1895 { "Network Statistics", "homeplug.ns",
1896 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1899 { &hf_homeplug_ns_extended,
1900 { "Network Statistics is Extended", "homeplug.ns.extended",
1901 FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Network Statistics is Extended (MELEN >= 199)", HFILL }
1904 { &hf_homeplug_ns_netw_ctrl_ac,
1905 { "Action Control", "homeplug.ns.ac",
1906 FT_BOOLEAN, 8, TFS(&homeplug_ns_ac_vals), HOMEPLUG_NS_AC, NULL, HFILL }
1909 { &hf_homeplug_ns_netw_ctrl_icid,
1910 { "IC_ID", "homeplug.ns.icid",
1911 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(homeplug_ns_icid_vals), HOMEPLUG_NS_ICID, NULL, HFILL }
1914 { &hf_homeplug_ns_bytes40_robo,
1915 { "Bytes in 40 symbols in ROBO", "homeplug.ns.bytes40_robo",
1916 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1919 { &hf_homeplug_ns_fails_robo,
1920 { "Fails Received in ROBO", "homeplug.ns.fails_robo",
1921 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1924 { &hf_homeplug_ns_drops_robo,
1925 { "Frame Drops in ROBO", "homeplug.ns.drops_robo",
1926 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1929 { &hf_homeplug_ns_netw_da,
1930 { "Address of Network DA", "homeplug.ns.netw_da",
1931 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }
1934 { &hf_homeplug_ns_bytes40,
1935 { "Bytes in 40 symbols", "homeplug.ns.bytes40",
1936 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1939 { &hf_homeplug_ns_fails,
1940 { "Fails Received", "homeplug.ns.fails",
1941 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1944 { &hf_homeplug_ns_drops,
1945 { "Frame Drops", "homeplug.ns.drops",
1946 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
1949 /* ... Extended */
1950 #if 0
1951 { &hf_homeplug_ns_tx_bfr_state,
1952 { "Transmit Buffer State", "homeplug.ns.tx_bfr_state",
1953 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1955 #endif
1957 { &hf_homeplug_ns_buf_in_use,
1958 { "Buffer in use", "homeplug.ns.buf_in_use",
1959 FT_BOOLEAN, 8, TFS(&homeplug_ns_buf_in_use_vals), HOMEPLUG_NS_BUF_IN_USE,
1960 "Buffer in use (1) or Available (0)", HFILL }
1963 { &hf_homeplug_ns_prio,
1964 { "Priority", "homeplug.ns.prio",
1965 FT_UINT8, BASE_DEC, VALS(homeplug_txprio_vals), HOMEPLUG_NS_PRIO,
1966 NULL, HFILL }
1969 { &hf_homeplug_ns_msdu_len,
1970 { "MSDU Length", "homeplug.ns.msdu_len",
1971 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_NS_MSDU_LEN, NULL, HFILL }
1974 { &hf_homeplug_ns_seqn,
1975 { "Sequence Number", "homeplug.ns.seqn",
1976 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_NS_SEQN, NULL, HFILL }
1979 { &hf_homeplug_ns_toneidx,
1980 { "Transmit tone map index", "homeplug.ns.toneidx",
1981 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_NS_TONEIDX,
1982 "Maps to the 16 statistics occurring earlier in this MME", HFILL }
1985 /* Bridging Characteristics Network */
1986 { &hf_homeplug_bcn,
1987 { "Bridging Characteristics Network", "homeplug.bcn",
1988 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
1991 { &hf_homeplug_bcn_network,
1992 { "Network", "homeplug.bcn.network",
1993 FT_BOOLEAN, 8, TFS(&homeplug_bc_network_vals), HOMEPLUG_BC_NETWORK,
1994 "Local (0) or Network Bridge (1) Information", HFILL }
1997 { &hf_homeplug_bcn_return,
1998 { "Return/Set", "homeplug.bcn.return",
1999 FT_BOOLEAN, 8, TFS(&homeplug_bc_return_vals), HOMEPLUG_BC_RETURN,
2000 "From host: Return (1) or set bridging characteristics (0)", HFILL }
2003 { &hf_homeplug_bcn_rsvd,
2004 { "Reserved", "homeplug.bcn.rsvd",
2005 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_BCN_RSVD, NULL, HFILL }
2008 { &hf_homeplug_bcn_fbn,
2009 { "First Bridge Number", "homeplug.bcn.fbn",
2010 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_BCN_FBN, NULL, HFILL }
2013 { &hf_homeplug_bcn_brda,
2014 { "Address of Bridge", "homeplug.bcn.brda",
2015 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }
2018 { &hf_homeplug_bcn_bp_das,
2019 { "Number of bridge proxied DAs", "homeplug.bcn.bp_das",
2020 FT_UINT8, BASE_DEC, NULL, 0x0,
2021 "Number of bridge proxied DAs supported", HFILL }
2024 { &hf_homeplug_bcn_bp_da,
2025 { "Bridged DA", "homeplug.bcn.bp_da",
2026 FT_ETHER, BASE_NONE, NULL, 0x0, "Bridged Destination Address", HFILL }
2029 /* Bridging Characteristics Local */
2030 { &hf_homeplug_bcl,
2031 { "Bridging Characteristics Local", "homeplug.bcl",
2032 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
2035 { &hf_homeplug_bcl_network,
2036 { "Network/Local", "homeplug.bcl.network",
2037 FT_BOOLEAN, 8, TFS(&homeplug_bc_network_vals), HOMEPLUG_BC_NETWORK,
2038 "Local (0) or Network Bridge (1) Information", HFILL }
2041 { &hf_homeplug_bcl_return,
2042 { "Return/Set", "homeplug.bcl.return",
2043 FT_BOOLEAN, 8, TFS(&homeplug_bc_return_vals), HOMEPLUG_BC_RETURN,
2044 "From host: Return (1) or set bridging characteristics (0)", HFILL }
2047 { &hf_homeplug_bcl_rsvd,
2048 { "Reserved", "homeplug.bcl.rsvd",
2049 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_BCL_RSVD, NULL, HFILL }
2052 { &hf_homeplug_bcl_hprox_das,
2053 { "Number of host proxied DAs", "homeplug.bcl.hprox_das",
2054 FT_UINT8, BASE_DEC, NULL, 0x0,
2055 "Number of host proxied DAs supported by the bridge application", HFILL }
2058 { &hf_homeplug_bcl_hpbda,
2059 { "Host Proxied DA", "homeplug.bcl.hpbda",
2060 FT_ETHER, BASE_NONE, NULL, 0x0, "Host Proxied Bridged Destination Address", HFILL }
2063 /* Set Transmit Characteristics */
2064 { &hf_homeplug_stc,
2065 { "Set Transmit Characteristics", "homeplug.stc",
2066 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
2069 { &hf_homeplug_stc_lco,
2070 { "Local Consumption Only", "homeplug.stc.lco",
2071 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_LCO,
2072 "Do not transmit subsequent frames to medium", HFILL }
2075 { &hf_homeplug_stc_encf,
2076 { "Encryption Flag", "homeplug.stc.encf",
2077 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_ENCF, "Encrypt subsequent frames", HFILL }
2080 { &hf_homeplug_stc_txprio,
2081 { "Transmit Priority", "homeplug.stc.txprio",
2082 FT_UINT8, BASE_DEC, VALS(homeplug_txprio_vals), HOMEPLUG_STC_TXPRIO,
2083 NULL, HFILL }
2086 { &hf_homeplug_stc_rexp,
2087 { "Response Expected", "homeplug.stc.rexp",
2088 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_REXP,
2089 "Mark subsequent frames to receive response", HFILL }
2092 { &hf_homeplug_stc_txcf,
2093 { "Transmit Contention Free", "homeplug.stc.txcf",
2094 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_TXCF,
2095 "Mark subsequently transmitted frames as contention free", HFILL }
2098 { &hf_homeplug_stc_cftop,
2099 { "Contention Free Transmit Override Priority", "homeplug.stc.cftop",
2100 FT_BOOLEAN, 8, TFS(&homeplug_stc_cftop_vals), HOMEPLUG_STC_CFTOP,
2101 "Transmit subsequent contention free frames with CA2/CA3 priority", HFILL }
2104 { &hf_homeplug_stc_rsvd1,
2105 { "Reserved", "homeplug.stc.rsvd1",
2106 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_STC_RSVD1, NULL, HFILL }
2109 { &hf_homeplug_stc_retry,
2110 { "Retry Control", "homeplug.stc.retry",
2111 FT_UINT8, BASE_DEC, VALS(homeplug_stc_retry_vals), HOMEPLUG_STC_RETRY,
2112 NULL, HFILL }
2115 { &hf_homeplug_stc_rsvd2,
2116 { "Reserved", "homeplug.stc.rsvd2",
2117 FT_UINT8, BASE_DEC, NULL, HOMEPLUG_STC_RSVD2, NULL, HFILL }
2120 { &hf_homeplug_stc_dder,
2121 { "Disable Default Encryption Receive", "homeplug.stc.dder",
2122 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_DDER, NULL, HFILL }
2125 { &hf_homeplug_stc_dur,
2126 { "Disable Unencrypted Receive", "homeplug.stc.dur",
2127 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_DUR, NULL, HFILL }
2130 { &hf_homeplug_stc_ebp,
2131 { "INT51X1 (Host/DTE Option) Enable Backpressure", "homeplug.stc.ebp",
2132 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_EBP,
2133 NULL, HFILL }
2136 { &hf_homeplug_stc_dees,
2137 { "Disable EEPROM Save", "homeplug.stc.dees",
2138 FT_BOOLEAN, 8, NULL, HOMEPLUG_STC_DEES, NULL, HFILL }
2141 { &hf_homeplug_stc_txeks,
2142 { "EKS to be used for encryption", "homeplug.stc.txeks",
2143 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
2146 /* Undecoded data */
2147 { &hf_homeplug_data,
2148 { "Data", "homeplug.data",
2149 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2153 /* Setup protocol subtree array */
2154 static gint *ett[] = {
2155 &ett_homeplug,
2156 &ett_homeplug_mctrl,
2157 &ett_homeplug_mehdr,
2158 &ett_homeplug_rce,
2159 &ett_homeplug_cer,
2160 &ett_homeplug_vs,
2161 &ett_homeplug_vs_mid,
2162 &ett_homeplug_snk,
2163 &ett_homeplug_rps,
2164 &ett_homeplug_psr,
2165 &ett_homeplug_slp,
2166 &ett_homeplug_loader,
2167 &ett_homeplug_hreq,
2168 &ett_homeplug_hrsp,
2169 &ett_homeplug_ns,
2170 &ett_homeplug_tx_bfr_state,
2171 &ett_homeplug_tone,
2172 &ett_homeplug_bcn,
2173 &ett_homeplug_bridge,
2174 &ett_homeplug_bcl,
2175 &ett_homeplug_stc
2178 proto_homeplug = proto_register_protocol("HomePlug protocol", "HomePlug", "homeplug");
2180 proto_register_field_array(proto_homeplug, hf, array_length(hf));
2182 proto_register_subtree_array(ett, array_length(ett));