2 * Functions for the WSE Remote Ethernet Dissector
4 * Dissector - WSE RemoteEthernet
5 * By Clement Marrast <clement.marrast@molex.com>
6 * Copyright 2012 Clement Marrast
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include <epan/packet.h>
19 #define WRETH_PORT 0xAAAA
21 void proto_register_wreth(void);
22 void proto_reg_handoff_wreth(void);
24 static dissector_handle_t wreth_handle
;
26 static int WrethIdentPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
27 static int WrethConnectPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
28 static int WrethDisconnectPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
29 static int WrethBlinkyPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
30 static int WrethGetValuePacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
31 static int WrethSetValuePacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
32 static int WrethBoostPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
33 static int WrethAckPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
34 static int WrethNackPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
35 static int WrethMailPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
36 static int WrethMailDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
, uint8_t fragmented
);
37 static int WrethCodefMasterInfoDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethMailboxTree
);
38 static int WrethCodefEquipmentInfoDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethMailboxTree
);
40 /* Remote ethernet sub packet type */
41 #define WSE_RETH_SUBTYPE 0x0200
43 /* Remote ethernet function code */
45 #define WRETH_CONNECT 2
48 #define WRETH_DISCONNECT 5
50 #define WRETH_BLINKY 7
51 #define WRETH_GET_VALUE 8
52 #define WRETH_SET_VALUE 9
53 #define WRETH_BOOST 10
55 /* Remote ethernet error code */
56 #define WRETH_BAD_FUNCTION_CODE 1
57 #define WRETH_ALREADY_CONNECTED 2
58 #define WRETH_INVALID_PROTOCOL_VERSION 3
59 #define WRETH_NOT_CONNECTED 4
60 #define WRETH_INVALID_MAC_ADDRESS 5
61 #define WRETH_INVALID_FRAME_SIZE 6
62 #define WRETH_NO_MEMORY_AVAILABLE 7
63 #define WRETH_BAD_PARAMETER 8
64 #define WRETH_TASK_REGISTERED 9
66 /* Initialize the protocol and registered fields */
67 static int wreth_proto
= -1;
69 /* static int wreth_mail_proto = -1; */
70 static int hf_Wreth_Subtype
;
71 static int hf_Wreth_Size
;
72 static int hf_Wreth_FunctionCode
;
73 static int hf_Wreth_FrameId
;
74 static int hf_Wreth_ErrorCode
;
75 static int hf_Wreth_Fragmented
;
76 static int hf_Wreth_Retry
;
77 static int hf_Wreth_IdentificationBiosVersion
;
78 static int hf_Wreth_IdentificationBoardNumber
;
79 static int hf_Wreth_IdentificationProtocolVersion
;
80 static int hf_Wreth_IdentificationBoardId
;
81 static int hf_Wreth_IdentificationState
;
82 static int hf_Wreth_IdentificationMacAddr
;
83 static int hf_Wreth_ConnectProtocolVersion
;
84 static int hf_Wreth_ConnectTimeout
;
85 static int hf_Wreth_BlinkyPeriod
;
86 static int hf_Wreth_GetValueVal
;
87 static int hf_Wreth_SetValueVal
;
88 static int hf_Wreth_BoostValue
;
89 static int hf_Wreth_MailDestTic
;
90 static int hf_Wreth_MailReserved
;
91 static int hf_Wreth_Mail_Codef
;
92 static int hf_Wreth_Mail_Status
;
93 static int hf_Wreth_Mail_TicUser_Root
;
94 static int hf_Wreth_Mail_PidUser
;
95 static int hf_Wreth_Mail_Mode
;
96 static int hf_Wreth_Mail_Time
;
97 static int hf_Wreth_Mail_Stop
;
98 static int hf_Wreth_Mail_Nfonc
;
99 static int hf_Wreth_Mail_Ncard
;
100 static int hf_Wreth_Mail_Nchan
;
101 static int hf_Wreth_Mail_Nes
;
102 static int hf_Wreth_Mail_Nb
;
103 static int hf_Wreth_Mail_TypVar
;
104 static int hf_Wreth_Mail_Adr
;
105 static int hf_Wreth_Mail_TicUser_DispCyc
;
106 static int hf_Wreth_Mail_Nb_Max_Size_Mail
;
107 static int hf_Wreth_Mail_User_ThreadID
;
108 static int hf_Wreth_Mail_DispCyc_Version
;
109 static int hf_Wreth_Mail_DifUserParam
;
110 static int hf_Wreth_Mail_Filler
;
111 /* static int hf_Wreth_Mail_Data; */
112 static int hf_Wreth_Mail_Mastinf_Version
;
113 static int hf_Wreth_Mail_Mastinf_Release
;
114 static int hf_Wreth_Mail_Mastinf_Protocol
;
115 static int hf_Wreth_Mail_Mastinf_CyclicFlux
;
116 static int hf_Wreth_Mail_Mastinf_szProtocolName
;
117 static int hf_Wreth_Mail_Mastinf_MaxTypeEquipment
;
118 static int hf_Wreth_Mail_Mastinf_MinEquipmentNumber
;
119 static int hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
;
120 static int hf_Wreth_Mail_Equinf_Version
;
121 static int hf_Wreth_Mail_Equinf_Release
;
122 static int hf_Wreth_Mail_Equinf_Network
;
123 static int hf_Wreth_Mail_Equinf_Protocol
;
124 static int hf_Wreth_Mail_Equinf_Messaging
;
125 static int hf_Wreth_Mail_Equinf_Equipment
;
126 static int hf_Wreth_Mail_Equinf_Flux
;
127 static int hf_Wreth_Mail_Equinf_IncWord
;
128 static int hf_Wreth_Mail_Equinf_IncDWord
;
129 static int hf_Wreth_Mail_Equinf_IncFWord
;
130 static int hf_Wreth_Mail_Mastinf_DllItemName
;
131 static int hf_Wreth_Mail_Mastinf_szEquipmentName
;
132 static int hf_Wreth_Mail_Equinf_MaxWriteBit
;
133 static int hf_Wreth_Mail_Equinf_MaxReadBit
;
134 static int hf_Wreth_Mail_Equinf_BreakBit
;
135 static int hf_Wreth_Mail_Equinf_MaxWriteIBit
;
136 static int hf_Wreth_Mail_Equinf_MaxReadIBit
;
137 static int hf_Wreth_Mail_Equinf_MaxWriteQBit
;
138 static int hf_Wreth_Mail_Equinf_MaxReadQBit
;
139 static int hf_Wreth_Mail_Equinf_BreakQBit
;
140 static int hf_Wreth_Mail_Equinf_MaxWriteByte
;
141 static int hf_Wreth_Mail_Equinf_MaxReadByte
;
142 static int hf_Wreth_Mail_Equinf_BreakByte
;
143 static int hf_Wreth_Mail_Equinf_MaxWriteIByte
;
144 static int hf_Wreth_Mail_Equinf_MaxReadIByte
;
145 static int hf_Wreth_Mail_Equinf_BreakIByte
;
146 static int hf_Wreth_Mail_Equinf_MaxWriteQByte
;
147 static int hf_Wreth_Mail_Equinf_MaxReadQByte
;
148 static int hf_Wreth_Mail_Equinf_BreakQByte
;
149 static int hf_Wreth_Mail_Equinf_MaxWriteWord
;
150 static int hf_Wreth_Mail_Equinf_MaxReadWord
;
151 static int hf_Wreth_Mail_Equinf_BreakWord
;
152 static int hf_Wreth_Mail_Equinf_MaxWriteIWord
;
153 static int hf_Wreth_Mail_Equinf_MaxReadIWord
;
154 static int hf_Wreth_Mail_Equinf_BreakIWord
;
155 static int hf_Wreth_Mail_Equinf_MaxWriteQWord
;
156 static int hf_Wreth_Mail_Equinf_MaxReadQWord
;
157 static int hf_Wreth_Mail_Equinf_BreakQWord
;
158 static int hf_Wreth_Mail_Equinf_MaxWriteDWord
;
159 static int hf_Wreth_Mail_Equinf_MaxReadDWord
;
160 static int hf_Wreth_Mail_Equinf_BreakDWord
;
161 static int hf_Wreth_Mail_Equinf_MaxWriteFWord
;
162 static int hf_Wreth_Mail_Equinf_MaxReadFWord
;
163 static int hf_Wreth_Mail_Equinf_BreakFWord
;
164 static int hf_Wreth_Mail_Equinf_ReadFactorWord
;
165 static int hf_Wreth_Mail_Equinf_ReadFactorIWord
;
166 static int hf_Wreth_Mail_Equinf_ReadFactorQWord
;
167 static int hf_Wreth_Mail_Equinf_ReadFactorDWord
;
168 static int hf_Wreth_Mail_Equinf_ReadFactorFWord
;
169 static int hf_Wreth_Mail_Equinf_WriteFactorWord
;
170 static int hf_Wreth_Mail_Equinf_WriteFactorIWord
;
171 static int hf_Wreth_Mail_Equinf_WriteFactorQWord
;
172 static int hf_Wreth_Mail_Equinf_WriteFactorDWord
;
173 static int hf_Wreth_Mail_Equinf_WriteFactorFWord
;
174 static int hf_Wreth_Mail_Equinf_DataFormat
;
175 static int hf_Wreth_Mail_Equinf_BreakIBit
;
177 /* Initialize the subtree pointers */
178 static int ett_wreth
;
180 /* Note: vals are stored as unsigned 32 bit quantities */
181 static const value_string tabStatus
[] = {
183 { 1, "stat_err_fonc" },
184 { 2, "stat_err_addr" },
185 { 3, "stat_bad_frame" },
186 { 4, "stat_lock_data" },
187 { 10, "STAT_QUEUE_OVERFLOW" },
190 { 33, "statjb_timeout" },
191 { 34, "statjb_crc" },
192 { 35, "stat_cyc_inc" },
193 { 36, "stat_escl_inconnu" },
195 { 40, "STAT_DIF_MAX_THREAD" },
196 { 41, "stat_dif_full" },
197 { 42, "stat_dif_empty" },
198 { 43, "STAT_NES_UNKNOWN" },
199 { 45, "stat_no_soft" },
201 { 47, "stat_no_board" },
202 { 48, "stat_timeout_cts" },
203 { 49, "stat_timeout_wait" },
208 { 54, "stat_nopolling" },
209 { 55, "stat_badintpol" },
210 { 56, "stat_answer" },
211 { 57, "stat_no_statment" },
212 { 58, "stat_net_no_ready" },
215 { 60, "stat_no_retmail" },
216 { 61, "stat_no_dsr_gt4000" },
217 { 62, "stat_no_cts_gt4000" },
218 { 63, "stat_timeout_gt4000" },
219 { 64, "stat_bcc_gt4000" },
220 { 65, "STAT_NOT_CONNECT" },
221 { 66, "STAT_RESSOURCE" },
222 { 67, "STAT_ERR_PDU" },
223 { 68, "STAT_OBJECT_NON_EXISTENT" },
224 { 69, "STAT_TYPE_CONFLICT" },
225 { 70, "STAT_ABORT_USER" },
226 { 71, "STAT_ABORT_FMS" },
227 { 72, "STAT_ABORT_LLI" },
228 { 73, "STAT_ABORT_LAYER2" },
229 { 74, "STAT_MAX_PDU_SIZE" },
230 { 75, "STAT_FEATURE_NOT_SUPPORTED" },
231 { 76, "STAT_VERSION_INCOMPATIBLE" },
232 { 77, "STAT_USER_INITIATE_DENIED" },
233 { 78, "STAT_PASSWORD_ERROR" },
234 { 79, "STAT_PROFILE_INCOMPATIBLE" },
235 { 80, "STAT_ABORT_LLI_CONTEXT" },
236 { 81, "STAT_ABORT_LLI_ABT_RC2" },
237 { 82, "STAT_ABORT_LLI_ABT_RC3" },
238 { 83, "STAT_ERR_CLASS_VFD_STATE" },
239 { 84, "STAT_ERR_CLASS_APPLICATION_REF" },
240 { 85, "STAT_ERR_CLASS_DEFINITION" },
241 { 86, "STAT_ERR_CLASS_RESSOURCE" },
242 { 87, "STAT_ERR_CLASS_SERVICE" },
243 { 88, "STAT_ERR_CLASS_ACCESS" },
244 { 89, "STAT_ERR_CLASS_OD" },
245 { 90, "STAT_ERR_CLASS_OTHER" },
246 { 91, "STAT_REJECT_PDU" },
247 { 92, "STAT_ERR_HARDWARE" },
248 { 93, "STAT_DRIVER_ACCESS" },
249 { 94, "STAT_DRIVER_BAD_VERSION" },
250 { 95, "STAT_FILL_BIG_MAIL" },
251 { 96, "STAT_NO_TASK_VERSION" },
252 { 97, "STAT_DLL_LOCKED" },
253 { 98, "STAT_BOARD_LOCKED" },
254 { 99, "STAT_MODEIO_LOCKED" },
256 /*---- RESERVED STATUS FOR USER KIT4000 ----*/
257 { 100, "STAT_KIT_START" },
259 { 127, "STAT_KIT_END" },
260 /*------------------------------------------*/
261 { 128, "STAT_ERR_NO_REMOTE_CONNECTION" },
262 { 129, "STAT_CONFIG_OK" },
263 { 130, "STAT_CONFIG_NOK" },
265 { 131, "STAT_DNS_PENDING" },
266 { 132, "STAT_DNS_ERROR" },
267 { 133, "STAT_OVERTIME" },
269 { 134, "STAT_FRAG_WRITE" },
270 { 135, "STAT_FRAG_READ" },
272 { 136, "STAT_API_ACCESS" },
273 { 137, "STAT_QUEUE_EMPTY" },
274 { 138, "STAT_QUEUE_FULL" },
276 { 254, "STAT_DEV_INIT" },
278 { -11, "index not updated" },
279 { -10, "stat_handshake" },
280 { -9, "stat_event_data" },
281 { -8, "stat_timeout_ic_read" },
282 { -7, "stat_timeout_read" },
283 { -6, "stat_cyc_stopped" },
284 { -5, "stat_dif_not_ready" },
285 { -4, "stat_unchanged" },
286 { -3, "stat_nes_broadcast" },
287 { -2, "Unknown Status" },
288 { -1, "stat_writedif_ok" },
291 static value_string_ext tabStatus_ext
= VALUE_STRING_EXT_INIT(tabStatus
);
293 static const value_string tabCodef
[] = {
294 /* Code for monitor */
295 { 0x0000, "TIC_INVALID_ROOT" },
296 { 0x0002, "tic_monitor" },
299 { 0x0003, "COD_LOAD_TASK" },
300 { 0x0004, "COD_LOAD_TASK" },
302 { 0x00ff, "TIC_TASK_NON_INIT" }, /* 255 */
304 /* Code for monitor */
305 { 0x0106, "COD_MON_INFO" },
306 { 0x0109, "COD_GETTIC" },
307 { 0x0119, "COD_MON_SETTIME" },
308 { 0x0126, "COD_MON_SIZEMAIL" },
309 { 0x0127, "COD_MON_SETSYNCHRO" },
310 { 0x0128, "COD_MON_GETSYNCHRO" },
312 { 0x012A, "COD_MON_FLAG_DEBUG" },
313 { 0x012B, "COD_MON_SETSCADA_PT" },
314 { 0x012C, "COD_MON_GETSCADA_PT" },
316 { 0x0134, "COD_MON_SETGENVAR" },
317 { 0x0135, "COD_MON_GETGENVAR" },
318 { 0x0200, "COD_MON_READFLASHGT" },
319 { 0x0206, "COD_MON_SETCOMSPEED" },
320 { 0x020c, "COD_MON_TESTCARDTYPE" },
323 { 0x0400, "COD_LOAD_TASK" },
324 { 0x0600, "COD_RELOAD_TASK" },
326 /* Code for master function */
327 { 0x1000, "cod_initmasterline" },
328 { 0x1001, "cod_loadmasterconf" },
329 { 0x1002, "cod_masterinfo" },
330 { 0x1003, "cod_readpackbit" },
331 { 0x1004, "cod_readpackibit" },
332 { 0x1005, "cod_readword" },
333 { 0x1006, "cod_readiword" },
334 { 0x1007, "cod_readdword" },
335 { 0x1008, "cod_readfword" },
336 { 0x1009, "cod_writepackbit" },
337 { 0x100A, "cod_writeword" },
338 { 0x100B, "cod_writedword" },
339 { 0x100C, "cod_writefword" },
340 { 0x100D, "cod_readquickbit" },
341 { 0x100E, "cod_readdiag" },
342 { 0x100F, "cod_readeven" },
343 { 0x1010, "cod_readtrace" },
344 { 0x1011, "cod_statjbus" },
345 { 0x1012, "cod_creatjnet" },
346 { 0x1013, "cod_rijnet" },
347 { 0x1014, "cod_rcjnet" },
348 { 0x1015, "cod_writemes" },
349 { 0x1016, "cod_readmes" },
350 { 0x1017, "cod_manual" },
351 { 0x1018, "cod_automatic" },
352 { 0x1019, "cod_connect" },
353 { 0x101A, "cod_unconnect" },
354 { 0x101B, "cod_iocounter" },
355 { 0x101C, "cod_resetiocounter" },
356 { 0x101D, "codute_identequipment" },
357 { 0x101E, "codute_readbit_SY" },
358 { 0x101F, "codute_readbit_IO" },
359 { 0x1020, "codute_readword_CW" },
360 { 0x1021, "codute_readword_SW" },
361 { 0x1022, "codute_readword_COM" },
362 { 0x1023, "codute_readtempo" },
363 { 0x1024, "codute_readmonost_Mi" },
364 { 0x1025, "codute_readcounter_Ci" },
365 { 0x1026, "codute_readreg_Ri" },
366 { 0x1027, "codute_readsteps_Xi" },
367 { 0x1028, "codute_readdword_DW" },
368 { 0x1029, "codute_readdword_CDW" },
369 { 0x102A, "codute_readone_step" },
370 { 0x102B, "codute_writebit_SY" },
371 { 0x102C, "codute_writebit_IO" },
372 { 0x102D, "codute_writeword_SW" },
373 { 0x102E, "codute_writeword_COM" },
374 { 0x102F, "codute_writetimer_Ti" },
375 { 0x1030, "codute_writemonost_Mi" },
376 { 0x1031, "codute_writecounter_Ci" },
377 { 0x1032, "codute_writereg_Ri" },
378 { 0x1033, "codute_writedword_DW" },
379 { 0x1034, "codute_readbit_B" },
380 { 0x1035, "codute_readword_W" },
381 { 0x1036, "codute_readobjets" },
382 { 0x1037, "codute_readstruc_obj" },
383 { 0x1038, "codute_writebit_B" },
384 { 0x1039, "codute_writeword_W" },
385 { 0x103A, "codute_writestruc_obj" },
386 { 0x103B, "codute_no_requestdata" },
387 { 0x103C, "codute_prot_ver" },
388 { 0x103D, "codute_status" },
389 { 0x103E, "codute_mirror" },
390 { 0x103F, "codute_readerror_count" },
391 { 0x1040, "codute_readstation_status" },
392 { 0x1041, "codute_razerror_counter" },
393 { 0x1042, "codute_write_xgs" },
394 { 0x1043, "codute_stop" },
395 { 0x1044, "codute_run" },
396 { 0x1045, "codute_selftest" },
397 { 0x1046, "codute_init" },
398 { 0x1047, "codute_reserv" },
399 { 0x1048, "codute_unreserv" },
400 { 0x1049, "codute_entreserv" },
401 { 0x104A, "codute_initloader" },
402 { 0x104B, "codute_upload_seg" },
403 { 0x104C, "codute_end_upload_seg" },
404 { 0x104D, "codute_init_download" },
405 { 0x104E, "codute_download_seg" },
406 { 0x104F, "codute_end_download" },
407 { 0x1050, "codute_writereq_file" },
408 { 0x1051, "codute_readanswer_file" },
409 { 0x1052, "codute_exereq_file" },
410 { 0x1053, "codute_razreq_file" },
411 { 0x1054, "codute_stopdrum_DiS" },
412 { 0x1055, "codute_incdrum_DiS" },
413 { 0x1056, "codute_godrum_DiS" },
414 { 0x1057, "codute_readeven_DiS" },
415 { 0x1058, "codute_readone_DiS" },
416 { 0x1059, "codute_write_objet" },
417 { 0x105A, "cod_readpackqbit" },
418 { 0x105B, "cod_writepackqbit" },
419 { 0x105C, "cod_send_rec_txt" },
420 { 0x105D, "cod_iowhite" },
421 { 0x105E, "cod_readpackbyte" },
422 { 0x105F, "cod_readbyte" },
423 { 0x1060, "cod_writepackbyte" },
424 { 0x1061, "cod_writebyte" },
425 { 0x1062, "cod_readwordbcd" },
426 { 0x1063, "cod_writewordbcd" },
427 { 0x1064, "cod_writereadmes" },
428 { 0x1065, "cod_readqword" },
429 { 0x1066, "cod_writeqword" },
430 { 0x1067, "cod_writereaddifmes" },
431 { 0x1068, "cod_readpackibyte" },
432 { 0x1069, "cod_readibyte" },
433 { 0x106A, "cod_readpackqbyte" },
434 { 0x106B, "cod_readqbyte" },
435 { 0x106C, "cod_writepackqbyte" },
436 { 0x106D, "cod_writeqbyte" },
437 { 0x106E, "cod_readident" },
438 { 0x106F, "cod_readpackiqbit" },
439 { 0x1070, "cod_writepackiqbit" },
440 { 0x1071, "cod_layer2profibus" },
441 { 0x1072, "cod_readtimer" },
442 { 0x1073, "cod_writetimer" },
443 { 0x1074, "cod_readcounter" },
444 { 0x1075, "cod_writecounter" },
445 { 0x1076, "0x1076COD_FMSGETOD" },
446 { 0x1077, "cod_endloadmasterconf" },
447 { 0x1078, "COD_FMSSTATUS" },
448 { 0x1079, "COD_EQUIPMENTINFO" },
449 { 0x107A, "COD_WRITEREADPACKBIT" },
450 { 0x107B, "COD_WRITEREADPACKQBIT" },
451 { 0x107C, "COD_WRITEREADPACKBYTE" },
452 { 0x107D, "COD_WRITEREADBYTE" },
453 { 0x107E, "COD_WRITEREADPACKQBYTE" },
454 { 0x107F, "COD_WRITEREADQBYTE" },
455 { 0x1080, "COD_WRITEREADWORD" },
456 { 0x1081, "COD_WRITEREADQWORD" },
457 { 0x1082, "COD_WRITEREADDWORD" },
458 { 0x1083, "COD_WRITEREADFWORD" },
459 { 0x1084, "COD_WRITEREADWORDBCD" },
460 { 0x1085, "COD_CLOSECONNECTION" },
461 { 0x1086, "COD_GET_SUPPORTED_FUNCTION" },
462 { 0x1087, "COD_READOBJECT" },
463 { 0x1088, "COD_WRITEFIELDOBJECT" },
464 { 0x1089, "COD_EQUINFO_OBJ" },
465 { 0x1090, "COD_WRITEREADMSG" },
466 { 0x1091, "COD_START_SCANNER" },
468 /* Code slave function */
469 { 0x2000, "cod_initslave" },
470 { 0x2001, "cod_loadslaveconf" },
471 { 0x2002, "cod_endloadslaveconf" },
474 { 0x3000, "cod_getpackbit" },
475 { 0x3001, "cod_getbit" },
476 { 0x3002, "cod_getword" },
477 { 0x3003, "cod_getdword" },
478 { 0x3004, "cod_getfword" },
479 { 0x3005, "cod_setpackbit" },
480 { 0x3006, "cod_setbit" },
481 { 0x3007, "cod_setword" },
482 { 0x3008, "cod_setdword" },
483 { 0x3009, "cod_setfword" },
484 { 0x300A, "cod_getdispbit" },
485 { 0x300B, "cod_getdispword" },
486 { 0x300C, "cod_getdispdword" },
487 { 0x300D, "cod_getdispfword" },
488 { 0x300E, "cod_setdispbit" },
489 { 0x300F, "cod_setdispword" },
490 { 0x3010, "cod_setdispdword" },
491 { 0x3011, "cod_setdispfword" },
492 { 0x3012, "cod_incdispword" },
493 { 0x3013, "cod_incdispdword" },
494 { 0x3014, "cod_decdispword" },
495 { 0x3015, "cod_decdispdword" },
496 { 0x3016, "cod_getevent" },
497 { 0x3017, "cod_confdb" },
498 { 0x3018, "cod_puteventvar" },
499 { 0x3019, "cod_getpackbyte" },
500 { 0x301A, "cod_setpackbyte" },
501 { 0x301B, "cod_fillbit" },
502 { 0x301C, "cod_fillbyte" },
503 { 0x301D, "cod_fillword" },
504 { 0x301E, "cod_filldword" },
505 { 0x301F, "cod_fillfword" },
506 { 0x3020, "COD_APPGETBIT" },
507 { 0x3021, "COD_DBEXECUTED" },
508 { 0x3022, "COD_GETRIGHTS" },
509 { 0x3023, "COD_WFCYC_COS" },
510 { 0x3024, "COD_END_FCYC" },
511 { 0x3025, "COD_FCYC_END" },
512 { 0x3026, "COD_TAB_FCYC" },
513 { 0x3027, "COD_GETFCYCCOS" },
514 { 0x3028, "COD_SETIOAREAADDR" },
515 { 0x3029, "COD_GETIOAREAADDR" },
516 { 0x3030, "COD_SETACTFNTADDR" },
517 { 0x3031, "COD_GETACTFNTADDR" },
518 { 0x3032, "COD_GETACTFNTBITWORD" },
520 /* Code disp_cyc functions */
521 { 0x4000, "cod_cycinfo" },
522 { 0x4001, "cod_createcyc" },
523 { 0x4002, "cod_startcyc" },
524 { 0x4003, "cod_stopcyc" },
525 { 0x4004, "cod_transcyc" },
526 { 0x4005, "cod_actcyc" },
527 { 0x4006, "cod_initcyc" },
528 { 0x4007, "cod_cycparam" },
529 { 0x4008, "cod_stopallcyc" },
530 { 0x4009, "cod_stopallcycread" },
531 { 0x400A, "cod_stopallcycwrite" },
532 { 0x400B, "cod_cyctimebase" },
533 { 0x400C, "COD_CYCEXECUTED" },
534 { 0x400E, "COD_NEWCREATECYC" },
535 { 0x400F, "COD_DISPCYC_DEBUG" },
536 { 0x4010, "COD_NEWCREATECYC_ID" },
537 { 0x4011, "COD_DESTROYCYC_ID" },
538 { 0x4012, "COD_CREATECYC_OBJ" },
539 { 0x4013, "COD_TRANSCYC_VERIF" },
540 { 0x4014, "COD_CREATECYC_WRMSG" },
541 { 0x4015, "COD_NEWCREATECYC_WRMSG" },
542 { 0x4016, "COD_NEWCREATECYC_WRMSG_ID" },
543 { 0x4017, "COD_CYCEXECUTED_AND_COS" },
544 { 0x4018, "COD_STARTCYCONE" },
545 { 0x4019, "COD_GETCRESCENDO_USB" },
546 { 0x4020, "COD_GETCYCPARAM2" },
547 { 0x4021, "COD_FCYCWRITENONCOS" },
548 { 0x4022, "COD_RESETCPTACTIVATION" },
550 /* Code Root function */
551 { 0x5000, "cod_rootinfo" },
552 { 0x5001, "cod_initjbus" },
553 { 0x5002, "cod_exitjbus" },
554 { 0x5003, "cod_transdif" },
555 { 0x5004, "cod_testtransdif" },
556 { 0x5005, "cod_watchdog" },
557 { 0x5006, "cod_accesskey" },
558 { 0x5007, "cod_getmodem" },
559 { 0x5008, "cod_setmodem" },
560 { 0x5009, "COD_GETSTATIONNAME" },
561 { 0x500A, "COD_GETSTATIONINFO" },
562 { 0x500B, "COD_GETWATCHDOG" },
563 { 0x500C, "COD_DIAG_ROOT" },
565 /* Code bt100 function */
566 { 0x6000, "COD_CREATEBT" },
567 { 0x6001, "COD_TIMEBASEBT" },
568 { 0x6002, "COD_CREATEBASETIME" },
570 /* Code ADMINFL-0 : files */
571 { 0x7000, "COD_OPENFILE" },
572 { 0x7001, "COD_CLOSEFILE" },
573 { 0x7002, "COD_READFILE" },
574 { 0x7003, "COD_WRITEFILE" },
575 { 0x7004, "COD_DELETEFILE" },
576 { 0x7005, "COD_SEEKFILE" },
577 { 0x7006, "COD_TEELFILE" },
578 { 0x7007, "COD_EOFFILE" },
579 { 0x7008, "COD_GETPTRFILE" },
580 { 0x7009, "COD_DIRFILE" },
583 { 0x7500, "COD_USER_FIRST" },
585 { 0x7501, "COD_USER_EXCHANGE" },
586 { 0x7502, "COD_USER_STATUSEXCHANGE" },
587 { 0x7503, "COD_USER_SENDFRAME" },
588 { 0x7504, "COD_USER_STATUSSENDFRAME" },
590 { 0x7600, "COD_USER_EQUIPPARAMSREAD" },
591 { 0x7601, "COD_USER_EQUIPINFOUPDATE" },
592 { 0x7602, "COD_USER_ANALYZESTDREQUEST" },
593 { 0x7603, "COD_USER_ANALYZEOBJREQUEST" },
594 { 0x7604, "COD_USER_PREPROCESSREQUEST" },
595 { 0x7605, "COD_USER_PREPROCESSANSWER" },
596 { 0x7606, "COD_USER_EXEFUNCREQUEST" },
597 { 0x7607, "COD_USER_EXEFUNCANSWER" },
598 { 0x7608, "COD_USER_ABORTFRAME" },
600 { 0x7700, "COD_USER_GETFUNCTION" },
601 { 0x7701, "COD_USER_EXEFUNCREQ" },
602 { 0x7702, "COD_USER_EXEFUNCACK" },
604 { 0x7999, "COD_USER_LAST" },
607 { 0x8000, "COD_INDWRITEMASK" },
609 /* Code ADMINMSG-0 : message */
610 { 0x9000, "COD_READMSG" },
611 { 0x9001, "COD_CLEARMSG" },
612 { 0x9002, "COD_DIRMSG" },
613 { 0x9003, "COD_ENABLEMSG" },
614 { 0x9004, "COD_DISABLEMSG" },
615 { 0x9005, "COD_CREATEMSG" },
616 { 0x9006, "COD_GETDESCRMSG" },
617 { 0x9007, "COD_DIRALLMSG" },
618 { 0x9008, "COD_INFOMSG" },
619 { 0x9009, "COD_GETFLAGSMSG" },
620 { 0x900A, "COD_SETFLAGSMSG" },
621 { 0x9100, "COD_MSG_ENABLED" },
623 /* First LLI MAIL Codef */
624 { 0x9500, "COD_LLI_WHITE" },
626 /* system commands */
627 { 0x9510, "COD_MANAGE_INIT" },
628 { 0x9511, "COD_MANAGE_SAP" },
629 { 0x9512, "COD_LLI_DIAG" },
630 { 0x9513, "COD_LLI_MANAGE" },
631 { 0x9514, "COD_ADD_INSTANCE" },
632 { 0x9515, "COD_REM_INSTANCE" },
633 { 0x9516, "COD_GET_MESSAGING" },
634 { 0x9517, "COD_LLI_CMD" },
636 /* protocol commands */
637 { 0x9600, "COD_LLI_EXCHANGE" },
638 { 0x9602, "COD_LLI_INIT" },
639 { 0x9603, "COD_LLI_START" },
640 { 0x9604, "COD_LLI_STOP" },
641 { 0x9605, "COD_LLI_READ_INPUT" },
642 { 0x9606, "COD_LLI_READ_OUTPUT" },
643 { 0x9607, "COD_LLI_ABORT" },
644 { 0x9608, "COD_LLI_TRACE_ON" },
645 { 0x9609, "COD_LLI_TRACE_OFF" },
646 { 0x960A, "COD_LLI_WRITE_OUTPUT" },
647 { 0x960B, "COD_LLI_READ_ASYNC" },
648 { 0x960C, "COD_LLI_WRITE_ASYNC" },
649 { 0x960D, "COD_LLI_DP_SERVICE" },
650 { 0x960E, "COD_LLI_FDL_SERVICE" },
651 { 0x960F, "COD_LLI_SCAN_L2" },
652 { 0x9610, "COD_LLI_SCAN_MESSAGING" },
653 { 0x9611, "COD_LLI_MPISLAVE_SERVICE" },
654 { 0x9612, "COD_LLI_FDL_MESSAGING" },
656 /* Last LLI MAIL Codef */
657 { 0x96FF, "COD_LLI_LAST" },
659 { 0xA001, "COD_REFRESH_INPUT" },
660 { 0xA002, "COD_REFRESH_OUTPUT" },
663 { 0xB001, "COD_SOCKET_CREATE" },
664 { 0xB002, "COD_SOCKET_BIND" },
665 { 0xB003, "COD_SOCKET_CONNECT" },
666 { 0xB004, "COD_SOCKET_LISTEN" },
667 { 0xB005, "COD_SOCKET_ACCEPT" },
668 { 0xB006, "COD_SOCKET_SENDTO" },
669 { 0xB007, "COD_SOCKET_RECVFROM" },
670 { 0xB008, "COD_SOCKET_SEND" },
671 { 0xB009, "COD_SOCKET_RECV" },
672 { 0xB010, "COD_SOCKET_CLOSE" },
673 { 0xB011, "COD_SOCKET_HOST_INFO" },
674 { 0xB012, "COD_SOCKET_PEER_INFO" },
675 { 0xB013, "COD_SOCKET_RECV_GET_DATA" },
676 { 0xB014, "COD_SOCKET_GET_STAT" },
677 { 0xB015, "COD_SOCKET_RESET_STAT" },
678 /*New type for the version 2*/
679 { 0xB016, "COD_SOCKET_SETSOCKOPT" },
680 { 0xB017, "COD_SOCKET_SELECT" },
681 { 0xB018, "COD_SOCKET_SHUTDOWN_ALL" },
682 { 0xB019, "COD_SOCKET_DIAG_SUMMARY" },
683 { 0xB01A, "COD_SOCKET_DIAG_DETAILS" },
684 { 0xB01B, "COD_SOCKET_DIAG_SO" },
685 { 0xB01C, "COD_SOCKET_EVENT" },
688 { 0xC000, "COD_ARP_QUERY" },
689 { 0xC001, "COD_ARP_FLUSH" },
691 { 0xFFEF, "index not updated" }, /* -11 */
693 { 0xFFFE, "Unknown Status" },
696 static value_string_ext tabCodef_ext
= VALUE_STRING_EXT_INIT(tabCodef
);
698 static const value_string FunctionCodes
[] = {
699 { WRETH_IDENT
, "Identification" },
700 { WRETH_CONNECT
, "Connection" },
701 { WRETH_ACK
, "Acknowledge" },
702 { WRETH_NACK
, "Non acknowledge" },
703 { WRETH_DISCONNECT
, "Disconnection" },
704 { WRETH_MAIL
, "Mail" },
705 { WRETH_BLINKY
, "Blinky" },
706 { WRETH_GET_VALUE
, "Get value" },
707 { WRETH_SET_VALUE
, "Set value" },
708 { WRETH_BOOST
, "Boost" },
711 static value_string_ext FunctionCodes_ext
= VALUE_STRING_EXT_INIT(FunctionCodes
);
713 static const value_string ErrorCode_vals
[] = {
715 { WRETH_BAD_FUNCTION_CODE
, "Bad function code" },
716 { WRETH_ALREADY_CONNECTED
, "Already connected" },
717 { WRETH_INVALID_PROTOCOL_VERSION
, "Invalid protocol version" },
718 { WRETH_NOT_CONNECTED
, "Not connected" },
719 { WRETH_INVALID_MAC_ADDRESS
, "Invalid MAC address" },
720 { WRETH_INVALID_FRAME_SIZE
, "Invalid frame size" },
721 { WRETH_NO_MEMORY_AVAILABLE
, "No memory available" },
722 { WRETH_BAD_PARAMETER
, "Bad parameter" },
723 { WRETH_TASK_REGISTERED
, "Task registered" },
726 static value_string_ext ErrorCode_vals_ext
= VALUE_STRING_EXT_INIT(ErrorCode_vals
);
728 static int dissect_wreth(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
730 uint16_t packet_type
,functionCode
;
733 proto_tree
*pWrethTree
;
737 /*Read the packet type, if not good, exit*/
738 packet_type
= tvb_get_ntohs(tvb
,0);
739 if(packet_type
!= WSE_RETH_SUBTYPE
) return 1;
741 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Wreth");
742 /* Clear out stuff in the info column */
743 col_clear(pinfo
->cinfo
,COL_INFO
);
745 mi
= proto_tree_add_protocol_format(tree
, wreth_proto
, tvb
, Offset
, -1, "WSE remote ethernet");
746 pWrethTree
= proto_item_add_subtree(mi
, ett_wreth
);
748 functionCode
= tvb_get_letohs(tvb
,4);
749 fragmented
= tvb_get_uint8(tvb
,10);
753 col_set_str(pinfo
->cinfo
, COL_INFO
, "Invalid fragmented byte");
754 return tvb_captured_length(tvb
);
760 proto_tree_add_item(pWrethTree
, hf_Wreth_Subtype
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
763 proto_tree_add_item(pWrethTree
, hf_Wreth_Size
, tvb
, Offset
+ 2, 2, ENC_LITTLE_ENDIAN
);
766 proto_tree_add_item(pWrethTree
, hf_Wreth_FunctionCode
, tvb
, Offset
+ 4, 2, ENC_LITTLE_ENDIAN
);
769 proto_tree_add_item(pWrethTree
, hf_Wreth_FrameId
, tvb
, Offset
+ 6, 2, ENC_LITTLE_ENDIAN
);
772 proto_tree_add_item(pWrethTree
, hf_Wreth_ErrorCode
, tvb
, Offset
+ 8, 2, ENC_LITTLE_ENDIAN
);
779 ti
= proto_tree_add_item(pWrethTree
, hf_Wreth_Fragmented
, tvb
, Offset
+ 10, 1, ENC_LITTLE_ENDIAN
);
780 proto_item_append_text(ti
, ": second fragment");
783 proto_tree_add_item(pWrethTree
, hf_Wreth_Retry
, tvb
, Offset
+ 11, 1, ENC_LITTLE_ENDIAN
);
785 WrethMailDissection(tvb
, Offset
+ 12, pinfo
, pWrethTree
, fragmented
);
786 return tvb_captured_length(tvb
);
789 ti
= proto_tree_add_item(pWrethTree
, hf_Wreth_Fragmented
, tvb
, Offset
+ 10, 1, ENC_LITTLE_ENDIAN
);
792 proto_item_append_text(ti
, ": first fragment");
794 proto_item_append_text(ti
, ": no");
797 proto_tree_add_item(pWrethTree
, hf_Wreth_Retry
, tvb
, Offset
+ 11, 1, ENC_LITTLE_ENDIAN
);
799 /* Add items to protocol tree specific to Wreth */
803 WrethIdentPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
806 WrethConnectPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
809 WrethAckPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
812 WrethNackPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
814 case WRETH_DISCONNECT
:
815 WrethDisconnectPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
818 WrethMailPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
821 WrethBlinkyPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
823 case WRETH_GET_VALUE
:
824 WrethGetValuePacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
826 case WRETH_SET_VALUE
:
827 WrethSetValuePacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
830 WrethBoostPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
836 return tvb_captured_length(tvb
);
839 /*****************************************************************************/
841 static const value_string IdentState
[] = {
847 int WrethIdentPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
851 Size
= tvb_get_letohs(tvb
, 2);
853 if((Size
!= 0)&&(Size
!= 19))
855 /* Invalid identification frame */
856 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid identification frame");
862 col_set_str(pInfo
->cinfo
, COL_INFO
, "Identification question");
867 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBiosVersion
, tvb
, Offset
, 6, ENC_ASCII
);
870 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBoardNumber
, tvb
, Offset
+ 6, 2, ENC_LITTLE_ENDIAN
);
873 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationProtocolVersion
, tvb
, Offset
+ 8, 2, ENC_LITTLE_ENDIAN
);
876 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBoardId
, tvb
, Offset
+ 10, 2, ENC_LITTLE_ENDIAN
);
879 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationState
, tvb
, Offset
+ 12, 1, ENC_LITTLE_ENDIAN
);
881 /*Client MAC address*/
882 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationMacAddr
, tvb
, Offset
+ 13, 6, ENC_NA
);
884 col_set_str(pInfo
->cinfo
, COL_INFO
, "Identification response");
889 /*****************************************************************************/
891 int WrethConnectPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
895 Size
= tvb_get_letohs(tvb
,2);
899 /* Invalid connection frame */
900 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid connection frame");
904 col_set_str(pInfo
->cinfo
, COL_INFO
, "Connection");
906 proto_tree_add_item(pWrethTree
, hf_Wreth_ConnectProtocolVersion
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
908 proto_tree_add_item(pWrethTree
, hf_Wreth_ConnectTimeout
, tvb
, Offset
+ 2, 2, ENC_LITTLE_ENDIAN
);
913 /*****************************************************************************/
915 int WrethDisconnectPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
919 Size
= tvb_get_letohs(tvb
,2);
923 /* Invalid disconnection frame */
924 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid disconnection frame");
928 col_set_str(pInfo
->cinfo
, COL_INFO
, "Disconnection");
933 /*****************************************************************************/
935 int WrethBlinkyPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
939 Size
= tvb_get_letohs(tvb
,2);
943 /* Invalid blinky frame */
944 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid blinky frame");
948 col_set_str(pInfo
->cinfo
, COL_INFO
, "Blinky");
950 proto_tree_add_item(pWrethTree
, hf_Wreth_BlinkyPeriod
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
955 /*****************************************************************************/
957 int WrethGetValuePacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
961 Size
= tvb_get_letohs(tvb
,2);
966 col_set_str(pInfo
->cinfo
, COL_INFO
, "Get value question");
969 proto_tree_add_item(pWrethTree
, hf_Wreth_GetValueVal
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
970 col_set_str(pInfo
->cinfo
, COL_INFO
, "Get value response");
973 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid get value frame");
980 /*****************************************************************************/
982 int WrethSetValuePacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
986 Size
= tvb_get_letohs(tvb
,2);
990 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid set value frame");
993 proto_tree_add_item(pWrethTree
, hf_Wreth_SetValueVal
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
995 col_set_str(pInfo
->cinfo
, COL_INFO
, "Set value question");
1000 /*****************************************************************************/
1001 static const value_string BoostValue
[] = {
1007 int WrethBoostPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1011 Size
= tvb_get_letohs(tvb
,2);
1015 /* Invalid boost frame */
1016 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid boost frame");
1020 col_set_str(pInfo
->cinfo
, COL_INFO
, "Boost");
1022 proto_tree_add_item(pWrethTree
, hf_Wreth_BoostValue
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1027 /*****************************************************************************/
1029 int WrethAckPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
1033 Size
= tvb_get_letohs(tvb
,2);
1037 /* Invalid ack frame */
1038 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid acknowledge frame");
1042 col_set_str(pInfo
->cinfo
, COL_INFO
, "Acknowledge");
1047 /*****************************************************************************/
1049 int WrethNackPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1054 Size
= tvb_get_letohs(tvb
,2);
1055 ErrorCode
= tvb_get_letohs(tvb
,8);
1057 if((Size
!= 0)&&(Size
!= 6))
1059 /* Invalid ack frame */
1060 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid non acknowledge frame");
1065 col_add_str(pInfo
->cinfo
, COL_INFO
, val_to_str_ext(ErrorCode
, &ErrorCode_vals_ext
, "Unknown 0x%04x"));
1069 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationMacAddr
, tvb
, Offset
, 6, ENC_NA
);
1075 /*****************************************************************************/
1077 int WrethMailPacket(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1080 proto_tree_add_item(pWrethTree
, hf_Wreth_MailDestTic
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1081 proto_tree_add_item(pWrethTree
, hf_Wreth_MailReserved
, tvb
, Offset
+ 2, 4, ENC_LITTLE_ENDIAN
);
1083 col_set_str(pInfo
->cinfo
, COL_INFO
, "Mail");
1085 /*Frame not fragmented => last argument = 0*/
1086 WrethMailDissection(tvb
, Offset
+6, pInfo
, pWrethTree
,0);
1091 /*****************************************************************************/
1093 int WrethMailDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
, uint8_t fragmented
)
1096 proto_tree
*pWrethMailboxTree
;
1100 mi
= proto_tree_add_protocol_format(pWrethTree
, wreth_proto
, tvb
, Offset
, -1, "MailBox");
1101 pWrethMailboxTree
= proto_item_add_subtree(mi
, ett_wreth
);
1103 /*If it's not the last fragment, display the header of the MailBox*/
1104 if (2 != fragmented
)
1106 uint16_t Card
, Chan
;
1110 Codef
= tvb_get_letohs(tvb
,Offset
);
1111 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Codef
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1114 Status
= (int16_t)tvb_get_letohs(tvb
,Offset
); /* cast fetched value to signed so sign is extended */
1115 /* so that lookup of 32-bit unsigned in tabCodef */
1116 /* value_string array will work properly. */
1117 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Status
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1120 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TicUser_Root
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1123 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_PidUser
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1126 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Mode
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1129 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Time
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1132 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Stop
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1135 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nfonc
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1138 Card
= tvb_get_letohs(tvb
,Offset
);
1139 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Ncard
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1142 Chan
= tvb_get_letohs(tvb
,Offset
);
1143 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nchan
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1146 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nes
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1149 proto_tree_add_item_ret_uint(pWrethMailboxTree
, hf_Wreth_Mail_Nb
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
, &Nb
);
1152 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TypVar
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1155 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Adr
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1158 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TicUser_DispCyc
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1160 /*Mail Nb Max Size Mail*/
1161 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nb_Max_Size_Mail
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1163 /*Mail User ThreadID*/
1164 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_User_ThreadID
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1166 /*Mail DispCyc Version*/
1167 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_DispCyc_Version
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1169 /*Mail DifUserParam*/
1170 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_DifUserParam
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1173 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Filler
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1176 col_add_fstr(pInfo
->cinfo
, COL_INFO
, "Mail : Codef = Ox%X (%s), Status = %02d (%s), Card = %d, Chan = %d" ,
1178 val_to_str_ext(Codef
, &tabCodef_ext
, "Unknown 0x%04x"),
1180 val_to_str_ext(Status
, &tabStatus_ext
, "Unknown %d"),
1186 col_set_str(pInfo
->cinfo
, COL_INFO
, "Mail : Data Second Fragment ");
1191 /*Specific Decode for some Codef*/
1194 case 0x1002: /*Master Info*/
1195 WrethCodefMasterInfoDissection(tvb
, Offset
, pInfo
, pWrethMailboxTree
);
1197 case 0x1079: /*Equipment Info*/
1198 WrethCodefEquipmentInfoDissection(tvb
, Offset
, pInfo
, pWrethMailboxTree
);
1201 proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1209 /*****************************************************************************/
1211 int WrethCodefMasterInfoDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo _U_
, proto_tree
* pWrethMailboxTree
)
1214 proto_tree
*pWrethMailboxDataTree
;
1216 mi
= proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1217 pWrethMailboxDataTree
= proto_item_add_subtree(mi
, ett_wreth
);
1220 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Version
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1223 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Release
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1226 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Protocol
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1229 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_CyclicFlux
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1232 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_szProtocolName
, tvb
, Offset
, 16, ENC_ASCII
);
1234 /*bMaxTypeEquipment*/
1235 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MaxTypeEquipment
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1237 /*wMinEquipmentNumber*/
1238 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MinEquipmentNumber
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1240 /*wMaxEquipmentNumber*/
1241 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1247 /*****************************************************************************/
1249 int WrethCodefEquipmentInfoDissection(tvbuff_t
*tvb
, uint8_t Offset
, packet_info
* pInfo _U_
, proto_tree
* pWrethMailboxTree
)
1252 proto_tree
*pWrethMailboxDataTree
;
1254 mi
= proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1255 pWrethMailboxDataTree
= proto_item_add_subtree(mi
, ett_wreth
);
1258 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Version
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1263 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Release
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1266 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Network
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1269 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Protocol
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1272 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Messaging
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1275 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Equipment
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1278 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Flux
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1283 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1286 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1289 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1294 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_DllItemName
, tvb
, Offset
, 14, ENC_ASCII
);
1297 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_szEquipmentName
, tvb
, Offset
, 16, ENC_ASCII
);
1302 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1305 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1308 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1311 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1314 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1317 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1320 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1323 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1326 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1329 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1332 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1335 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1338 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1341 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1344 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1347 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1350 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1353 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1356 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1359 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1362 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1365 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1368 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1371 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1374 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1377 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1380 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1383 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1386 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1389 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1392 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1395 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1398 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1401 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1403 /*wReadFactorIWord*/
1404 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1406 /*wReadFactorQWord*/
1407 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1409 /*wReadFactorDWord*/
1410 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1412 /*wReadFactorFWord*/
1413 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1415 /*wWriteFactorWord*/
1416 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1418 /*wWriteFactorIWord*/
1419 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1421 /*wWriteFactorQWord*/
1422 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1424 /*wWriteFactorDWord*/
1425 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1427 /*wWriteFactorFWord*/
1428 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1431 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_DataFormat
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1437 void proto_register_wreth(void)
1439 static hf_register_info hf
[] =
1441 /* Wreth header fields */
1442 { &hf_Wreth_Subtype
,
1443 { "Subtype", "wreth.Subtype",
1444 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1448 { "Size", "wreth.Size",
1449 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1452 { &hf_Wreth_FunctionCode
,
1453 { "Function code","wreth.FunctionCode",
1454 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &FunctionCodes_ext
, 0x0,
1457 { &hf_Wreth_FrameId
,
1458 { "FrameId", "wreth.FrameId",
1459 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1462 { &hf_Wreth_ErrorCode
,
1463 { "Error code", "wreth.ErrorCode",
1464 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ErrorCode_vals_ext
, 0x0,
1467 { &hf_Wreth_Fragmented
,
1468 { "Fragmented", "wreth.Fragmented",
1469 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1473 { "Retry", "wreth.Retry",
1474 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1477 { &hf_Wreth_IdentificationBiosVersion
,
1478 { "Bios version", "wreth.IdentBiosVersion",
1479 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1482 { &hf_Wreth_IdentificationBoardNumber
,
1483 { "Board number", "wreth.IdentBoardNumber",
1484 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1487 { &hf_Wreth_IdentificationProtocolVersion
,
1488 { "Protocol version", "wreth.IdentProtocolVersion",
1489 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1492 { &hf_Wreth_IdentificationBoardId
,
1493 { "Board Id", "wreth.IdentBoardId",
1494 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1497 { &hf_Wreth_IdentificationState
,
1498 { "State", "wreth.IdentState",
1499 FT_UINT8
, BASE_DEC
, VALS(IdentState
), 0x0,
1502 { &hf_Wreth_IdentificationMacAddr
,
1503 { "Client MAC address", "wreth.IdentClientMacAddr",
1504 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1507 { &hf_Wreth_ConnectProtocolVersion
,
1508 { "Protocol version", "wreth.ConnectProtocolVersion",
1509 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1512 { &hf_Wreth_ConnectTimeout
,
1513 { "Connect timeout", "wreth.ConnectTimeout",
1514 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1517 { &hf_Wreth_BlinkyPeriod
,
1518 { "Period", "wreth.BlinkyPeriod",
1519 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1522 { &hf_Wreth_GetValueVal
,
1523 { "Value", "wreth.GetValue",
1524 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1527 { &hf_Wreth_SetValueVal
,
1528 { "Value", "wreth.SetValue",
1529 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1532 { &hf_Wreth_BoostValue
,
1533 { "Boost", "wreth.BoostStatus",
1534 FT_UINT16
, BASE_DEC
, VALS(BoostValue
), 0x0,
1537 { &hf_Wreth_MailDestTic
,
1538 { "Dest tic", "wreth.MailDestTic",
1539 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1542 { &hf_Wreth_MailReserved
,
1543 { "Reserved", "wreth.MailReserved",
1544 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1547 { &hf_Wreth_Mail_Codef
,
1548 { "Codef", "wreth.Mail.Codef",
1549 FT_UINT16
, BASE_HEX
| BASE_EXT_STRING
, &tabCodef_ext
, 0x0,
1552 { &hf_Wreth_Mail_Status
,
1553 { "Status", "wreth.Mail.Status",
1554 FT_INT16
, BASE_DEC
| BASE_EXT_STRING
, &tabStatus_ext
, 0x0,
1557 { &hf_Wreth_Mail_TicUser_Root
,
1558 { "TicUser Root", "wreth.Mail.TicUserRoot",
1559 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1562 { &hf_Wreth_Mail_PidUser
,
1563 { "PidUser", "wreth.Mail.PidUser",
1564 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1567 { &hf_Wreth_Mail_Mode
,
1568 { "Mode", "wreth.Mail.Mode",
1569 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1572 { &hf_Wreth_Mail_Time
,
1573 { "Time", "wreth.Mail.Time",
1574 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1577 { &hf_Wreth_Mail_Stop
,
1578 { "Stop", "wreth.Mail.Stop",
1579 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1582 { &hf_Wreth_Mail_Nfonc
,
1583 { "Nfonc", "wreth.Mail.Nfonc",
1584 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1587 { &hf_Wreth_Mail_Ncard
,
1588 { "Ncard", "wreth.Mail.Ncard",
1589 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1592 { &hf_Wreth_Mail_Nchan
,
1593 { "Nchan", "wreth.Mail.Nchan",
1594 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1597 { &hf_Wreth_Mail_Nes
,
1598 { "Nes", "wreth.Mail.Nes",
1599 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1602 { &hf_Wreth_Mail_Nb
,
1603 { "Nb", "wreth.Mail.Nb",
1604 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1607 { &hf_Wreth_Mail_TypVar
,
1608 { "TypVar", "wreth.Mail.TypVar",
1609 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1612 { &hf_Wreth_Mail_Adr
,
1613 { "Adr", "wreth.Mail.Adr",
1614 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1617 { &hf_Wreth_Mail_TicUser_DispCyc
,
1618 { "TicUser DispCyc", "wreth.Mail.TicUser.DispCyc",
1619 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1622 { &hf_Wreth_Mail_Nb_Max_Size_Mail
,
1623 { "Nb Max Size Mail", "wreth.Mail.TicUser.Nb.Max.Size.Mail",
1624 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1627 { &hf_Wreth_Mail_User_ThreadID
,
1628 { "User ThreadID", "wreth.Mail.User.ThreadID",
1629 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1632 { &hf_Wreth_Mail_DispCyc_Version
,
1633 { "DispCyc Version", "wreth.Mail.DispCyc.Version",
1634 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1637 { &hf_Wreth_Mail_DifUserParam
,
1638 { "DifUserParam", "wreth.Mail.DifUserParam",
1639 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1642 { &hf_Wreth_Mail_Filler
,
1643 { "Filler", "wreth.Mail.Filler",
1644 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1648 { &hf_Wreth_Mail_Data
,
1649 { "Data", "wreth.Mail.Data",
1650 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1654 { &hf_Wreth_Mail_Mastinf_Version
,
1655 { "Version", "wreth.Mail.Mastinf.Version",
1656 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1659 { &hf_Wreth_Mail_Mastinf_Release
,
1660 { "Release", "wreth.Mail.Mastinf.Release",
1661 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1664 { &hf_Wreth_Mail_Mastinf_Protocol
,
1665 { "Protocol", "wreth.Mail.Mastinf.Protocol",
1666 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1669 { &hf_Wreth_Mail_Mastinf_CyclicFlux
,
1670 { "CyclicFlux", "wreth.Mail.Mastinf.CyclicFlux",
1671 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1674 { &hf_Wreth_Mail_Mastinf_szProtocolName
,
1675 { "ProtocolName", "wreth.Mail.Mastinf.ProtocolName",
1676 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1679 { &hf_Wreth_Mail_Mastinf_MaxTypeEquipment
,
1680 { "MaxTypeEquipment", "wreth.Mail.Mastinf.MaxTypeEquipment",
1681 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1684 { &hf_Wreth_Mail_Mastinf_MinEquipmentNumber
,
1685 { "MinEquipmentNumber", "wreth.Mail.Mastinf.MinEquipmentNumber",
1686 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1689 { &hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
,
1690 { "MaxEquipmentNumber", "wreth.Mail.Mastinf.MaxEquipmentNumber",
1691 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1694 { &hf_Wreth_Mail_Equinf_Version
,
1695 { "Version", "wreth.Mail.Equinf.Version",
1696 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1699 { &hf_Wreth_Mail_Equinf_Release
,
1700 { "Release", "wreth.Mail.Equinf.Release",
1701 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1704 { &hf_Wreth_Mail_Equinf_Network
,
1705 { "Network", "wreth.Mail.Equinf.Network",
1706 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1709 { &hf_Wreth_Mail_Equinf_Protocol
,
1710 { "Protocol", "wreth.Mail.Equinf.Protocol",
1711 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1714 { &hf_Wreth_Mail_Equinf_Messaging
,
1715 { "Messaging", "wreth.Mail.Equinf.Messaging",
1716 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1719 { &hf_Wreth_Mail_Equinf_Equipment
,
1720 { "Equipment", "wreth.Mail.Equinf.Equipment",
1721 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1724 { &hf_Wreth_Mail_Equinf_Flux
,
1725 { "Flux", "wreth.Mail.Equinf.Flux",
1726 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1729 { &hf_Wreth_Mail_Equinf_IncWord
,
1730 { "IncWord", "wreth.Mail.Equinf.IncWord",
1731 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1734 { &hf_Wreth_Mail_Equinf_IncDWord
,
1735 { "IncDWord", "wreth.Mail.Equinf.IncDWord",
1736 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1739 { &hf_Wreth_Mail_Equinf_IncFWord
,
1740 { "IncFWord", "wreth.Mail.Equinf.IncFWord",
1741 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1744 { &hf_Wreth_Mail_Mastinf_DllItemName
,
1745 { "DllItemName", "wreth.Mail.Equinf.DllItemName",
1746 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1749 { &hf_Wreth_Mail_Mastinf_szEquipmentName
,
1750 { "EquipmentName", "wreth.Mail.Equinf.EquipmentName",
1751 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1754 { &hf_Wreth_Mail_Equinf_MaxWriteBit
,
1755 { "MaxWriteBit", "wreth.Mail.Equinf.MaxWriteBit",
1756 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1759 { &hf_Wreth_Mail_Equinf_MaxReadBit
,
1760 { "MaxReadBit", "wreth.Mail.Equinf.MaxReadBit",
1761 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1764 { &hf_Wreth_Mail_Equinf_BreakBit
,
1765 { "BreakBit", "wreth.Mail.Equinf.BreakBit",
1766 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1769 { &hf_Wreth_Mail_Equinf_MaxWriteIBit
,
1770 { "MaxWriteIBit", "wreth.Mail.Equinf.MaxWriteIBit",
1771 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1774 { &hf_Wreth_Mail_Equinf_MaxReadIBit
,
1775 { "MaxReadIBit", "wreth.Mail.Equinf.MaxReadIBit",
1776 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1779 { &hf_Wreth_Mail_Equinf_MaxWriteQBit
,
1780 { "MaxWriteQBit", "wreth.Mail.Equinf.MaxWriteQBit",
1781 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1784 { &hf_Wreth_Mail_Equinf_MaxReadQBit
,
1785 { "MaxReadQBit", "wreth.Mail.Equinf.MaxReadQBit",
1786 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1789 { &hf_Wreth_Mail_Equinf_BreakQBit
,
1790 { "BreakQBit", "wreth.Mail.Equinf.BreakQBit",
1791 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1794 { &hf_Wreth_Mail_Equinf_MaxWriteByte
,
1795 { "MaxWriteByte", "wreth.Mail.Equinf.MaxWriteByte",
1796 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1799 { &hf_Wreth_Mail_Equinf_MaxReadByte
,
1800 { "MaxReadByte", "wreth.Mail.Equinf.MaxReadByte",
1801 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1804 { &hf_Wreth_Mail_Equinf_BreakByte
,
1805 { "BreakByte", "wreth.Mail.Equinf.BreakByte",
1806 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1809 { &hf_Wreth_Mail_Equinf_MaxWriteIByte
,
1810 { "MaxWriteIByte", "wreth.Mail.Equinf.MaxWriteIByte",
1811 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1814 { &hf_Wreth_Mail_Equinf_MaxReadIByte
,
1815 { "MaxReadIByte", "wreth.Mail.Equinf.MaxReadIByte",
1816 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1819 { &hf_Wreth_Mail_Equinf_BreakIByte
,
1820 { "BreakIByte", "wreth.Mail.Equinf.BreakIByte",
1821 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1824 { &hf_Wreth_Mail_Equinf_MaxWriteQByte
,
1825 { "MaxWriteQByte", "wreth.Mail.Equinf.MaxWriteQByte",
1826 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1829 { &hf_Wreth_Mail_Equinf_MaxReadQByte
,
1830 { "MaxReadQByte", "wreth.Mail.Equinf.MaxReadQByte",
1831 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1835 { &hf_Wreth_Mail_Equinf_BreakQByte
,
1836 { "BreakQByte", "wreth.Mail.Equinf.BreakQByte",
1837 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1840 { &hf_Wreth_Mail_Equinf_MaxWriteWord
,
1841 { "MaxWriteWord", "wreth.Mail.Equinf.MaxWriteWord",
1842 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1845 { &hf_Wreth_Mail_Equinf_MaxReadWord
,
1846 { "MaxReadWord", "wreth.Mail.Equinf.MaxReadWord",
1847 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1850 { &hf_Wreth_Mail_Equinf_BreakWord
,
1851 { "BreakWord", "wreth.Mail.Equinf.BreakWord",
1852 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1855 { &hf_Wreth_Mail_Equinf_MaxWriteIWord
,
1856 { "MaxWriteIWord", "wreth.Mail.Equinf.MaxWriteIWord",
1857 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1860 { &hf_Wreth_Mail_Equinf_MaxReadIWord
,
1861 { "MaxReadIWord", "wreth.Mail.Equinf.MaxReadIWord",
1862 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1865 { &hf_Wreth_Mail_Equinf_BreakIWord
,
1866 { "BreakIWord", "wreth.Mail.Equinf.BreakIWord",
1867 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1870 { &hf_Wreth_Mail_Equinf_MaxReadQWord
,
1871 { "MaxReadQWord", "wreth.Mail.Equinf.MaxReadQWord",
1872 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1875 { &hf_Wreth_Mail_Equinf_MaxWriteQWord
,
1876 { "MaxWriteQWord", "wreth.Mail.Equinf.MaxWriteQWord",
1877 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1880 { &hf_Wreth_Mail_Equinf_BreakQWord
,
1881 { "BreakQWord", "wreth.Mail.Equinf.BreakQWord",
1882 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1885 { &hf_Wreth_Mail_Equinf_MaxWriteDWord
,
1886 { "MaxWriteDWord", "wreth.Mail.Equinf.MaxWriteDWord",
1887 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1890 { &hf_Wreth_Mail_Equinf_MaxReadDWord
,
1891 { "MaxReadDWord", "wreth.Mail.Equinf.MaxReadDWord",
1892 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1895 { &hf_Wreth_Mail_Equinf_BreakDWord
,
1896 { "BreakDWord", "wreth.Mail.Equinf.BreakDWord",
1897 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1900 { &hf_Wreth_Mail_Equinf_MaxWriteFWord
,
1901 { "MaxWriteFWord", "wreth.Mail.Equinf.MaxWriteFWord",
1902 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1905 { &hf_Wreth_Mail_Equinf_MaxReadFWord
,
1906 { "MaxReadFWord", "wreth.Mail.Equinf.MaxReadFWord",
1907 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1910 { &hf_Wreth_Mail_Equinf_BreakFWord
,
1911 { "BreakFWord", "wreth.Mail.Equinf.BreakFWord",
1912 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1915 { &hf_Wreth_Mail_Equinf_ReadFactorWord
,
1916 { "ReadFactorWord", "wreth.Mail.Equinf.ReadFactorWord",
1917 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1920 { &hf_Wreth_Mail_Equinf_ReadFactorIWord
,
1921 { "ReadFactorIWord", "wreth.Mail.Equinf.ReadFactorIWord",
1922 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1925 { &hf_Wreth_Mail_Equinf_ReadFactorQWord
,
1926 { "ReadFactorQWord", "wreth.Mail.Equinf.ReadFactorQWord",
1927 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1930 { &hf_Wreth_Mail_Equinf_ReadFactorDWord
,
1931 { "ReadFactorDWord", "wreth.Mail.Equinf.ReadFactorDWord",
1932 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1935 { &hf_Wreth_Mail_Equinf_ReadFactorFWord
,
1936 { "ReadFactorFWord", "wreth.Mail.Equinf.ReadFactorFWord",
1937 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1940 { &hf_Wreth_Mail_Equinf_WriteFactorWord
,
1941 { "WriteFactorWord", "wreth.Mail.Equinf.WriteFactorWord",
1942 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1945 { &hf_Wreth_Mail_Equinf_WriteFactorIWord
,
1946 { "WriteFactorIWord", "wreth.Mail.Equinf.WriteFactorIWord",
1947 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1950 { &hf_Wreth_Mail_Equinf_WriteFactorQWord
,
1951 { "WriteFactorQWord", "wreth.Mail.Equinf.WriteFactorQWord",
1952 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1955 { &hf_Wreth_Mail_Equinf_WriteFactorDWord
,
1956 { "WriteFactorDWord", "wreth.Mail.Equinf.WriteFactorDWord",
1957 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1960 { &hf_Wreth_Mail_Equinf_WriteFactorFWord
,
1961 { "WriteFactorFWord", "wreth.Mail.Equinf.WriteFactorFWord",
1962 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1965 { &hf_Wreth_Mail_Equinf_DataFormat
,
1966 { "DataFormat", "wreth.Mail.Equinf.DataFormat",
1967 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1970 { &hf_Wreth_Mail_Equinf_BreakIBit
,
1971 { "BreakIBit", "wreth.Mail.Equinf.BreakIBit",
1972 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1977 static int *ett
[] = {
1981 wreth_proto
= proto_register_protocol (
1982 "WSE remote ethernet", /* name */
1983 "WRETH", /* short name */
1984 "wreth" /* abbrev */
1986 proto_register_field_array(wreth_proto
, hf
, array_length(hf
));
1987 proto_register_subtree_array(ett
, array_length(ett
));
1988 wreth_handle
= register_dissector("wreth", dissect_wreth
, wreth_proto
);
1991 void proto_reg_handoff_wreth(void)
1993 dissector_add_uint("ethertype", WRETH_PORT
, wreth_handle
);
1997 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2002 * indent-tabs-mode: nil
2005 * vi: set shiftwidth=4 tabstop=8 expandtab:
2006 * :indentSize=4:tabSize=8:noTabs=true: