2 * Functions for the WSE Remote Ethernet Dissector
6 * Dissector - WSE RemoteEthernet
7 * By Clement Marrast <clement.marrast@molex.com>
8 * Copyright 2012 Clement Marrast
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <http://www.gnu.org/licenses/>
26 #include <epan/packet.h>
28 #define WRETH_PORT 0xAAAA
30 static void dissect_wreth(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
);
31 static gint
WrethIdentPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
32 static gint
WrethConnectPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
33 static gint
WrethDisconnectPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
34 static gint
WrethBlinkyPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
35 static gint
WrethGetValuePacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
36 static gint
WrethSetValuePacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
37 static gint
WrethBoostPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
38 static gint
WrethAckPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
39 static gint
WrethNackPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
40 static gint
WrethMailPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
);
41 static gint
WrethMailDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
, guint8 fragmented
);
42 static gint
WrethCodefMasterInfoDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethMailboxTree
);
43 static gint
WrethCodefEquipmentInfoDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethMailboxTree
);
45 /* Remote ethernet sub packet type */
46 #define WSE_RETH_SUBTYPE 0x0200
48 /* Remote ethernet function code */
50 #define WRETH_CONNECT 2
53 #define WRETH_DISCONNECT 5
55 #define WRETH_BLINKY 7
56 #define WRETH_GET_VALUE 8
57 #define WRETH_SET_VALUE 9
58 #define WRETH_BOOST 10
60 /* Remote ethernet error code */
61 #define WRETH_BAD_FUNCTION_CODE 1
62 #define WRETH_ALREADY_CONNECTED 2
63 #define WRETH_INVALID_PROTOCOL_VERSION 3
64 #define WRETH_NOT_CONNECTED 4
65 #define WRETH_INVALID_MAC_ADDRESS 5
66 #define WRETH_INVALID_FRAME_SIZE 6
67 #define WRETH_NO_MEMORY_AVAILABLE 7
68 #define WRETH_BAD_PARAMETER 8
69 #define WRETH_TASK_REGISTERED 9
71 /* Initialize the protocol and registered fields */
72 static gint wreth_proto
= -1;
74 /* static gint wreth_mail_proto = -1; */
75 static int hf_Wreth_Subtype
= -1;
76 static int hf_Wreth_Size
= -1;
77 static int hf_Wreth_FunctionCode
= -1;
78 static int hf_Wreth_FrameId
= -1;
79 static int hf_Wreth_ErrorCode
= -1;
80 static int hf_Wreth_Fragmented
= -1;
81 static int hf_Wreth_Retry
= -1;
82 static int hf_Wreth_IdentificationBiosVersion
= -1;
83 static int hf_Wreth_IdentificationBoardNumber
= -1;
84 static int hf_Wreth_IdentificationProtocolVersion
= -1;
85 static int hf_Wreth_IdentificationBoardId
= -1;
86 static int hf_Wreth_IdentificationState
= -1;
87 static int hf_Wreth_IdentificationMacAddr
= -1;
88 static int hf_Wreth_ConnectProtocolVersion
= -1;
89 static int hf_Wreth_ConnectTimeout
= -1;
90 static int hf_Wreth_BlinkyPeriod
= -1;
91 static int hf_Wreth_GetValueVal
= -1;
92 static int hf_Wreth_SetValueVal
= -1;
93 static int hf_Wreth_BoostValue
= -1;
94 static int hf_Wreth_MailDestTic
= -1;
95 static int hf_Wreth_MailReserved
= -1;
96 static int hf_Wreth_Mail_Codef
= -1;
97 static int hf_Wreth_Mail_Status
= -1;
98 static int hf_Wreth_Mail_TicUser_Root
= -1;
99 static int hf_Wreth_Mail_PidUser
= -1;
100 static int hf_Wreth_Mail_Mode
= -1;
101 static int hf_Wreth_Mail_Time
= -1;
102 static int hf_Wreth_Mail_Stop
= -1;
103 static int hf_Wreth_Mail_Nfonc
= -1;
104 static int hf_Wreth_Mail_Ncard
= -1;
105 static int hf_Wreth_Mail_Nchan
= -1;
106 static int hf_Wreth_Mail_Nes
= -1;
107 static int hf_Wreth_Mail_Nb
= -1;
108 static int hf_Wreth_Mail_TypVar
= -1;
109 static int hf_Wreth_Mail_Adr
= -1;
110 static int hf_Wreth_Mail_TicUser_DispCyc
= -1;
111 static int hf_Wreth_Mail_Nb_Max_Size_Mail
= -1;
112 static int hf_Wreth_Mail_User_ThreadID
= -1;
113 static int hf_Wreth_Mail_DispCyc_Version
= -1;
114 static int hf_Wreth_Mail_DifUserParam
= -1;
115 static int hf_Wreth_Mail_Filler
= -1;
116 /* static int hf_Wreth_Mail_Data = -1; */
117 static int hf_Wreth_Mail_Mastinf_Version
= -1;
118 static int hf_Wreth_Mail_Mastinf_Release
= -1;
119 static int hf_Wreth_Mail_Mastinf_Protocol
= -1;
120 static int hf_Wreth_Mail_Mastinf_CyclicFlux
= -1;
121 static int hf_Wreth_Mail_Mastinf_szProtocolName
= -1;
122 static int hf_Wreth_Mail_Mastinf_MaxTypeEquipment
= -1;
123 static int hf_Wreth_Mail_Mastinf_MinEquipmentNumber
= -1;
124 static int hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
= -1;
125 static int hf_Wreth_Mail_Equinf_Version
= -1;
126 static int hf_Wreth_Mail_Equinf_Release
= -1;
127 static int hf_Wreth_Mail_Equinf_Network
= -1;
128 static int hf_Wreth_Mail_Equinf_Protocol
= -1;
129 static int hf_Wreth_Mail_Equinf_Messaging
= -1;
130 static int hf_Wreth_Mail_Equinf_Equipment
= -1;
131 static int hf_Wreth_Mail_Equinf_Flux
= -1;
132 static int hf_Wreth_Mail_Equinf_IncWord
= -1;
133 static int hf_Wreth_Mail_Equinf_IncDWord
= -1;
134 static int hf_Wreth_Mail_Equinf_IncFWord
= -1;
135 static int hf_Wreth_Mail_Mastinf_DllItemName
= -1;
136 static int hf_Wreth_Mail_Mastinf_szEquipmentName
= -1;
137 static int hf_Wreth_Mail_Equinf_MaxWriteBit
= -1;
138 static int hf_Wreth_Mail_Equinf_MaxReadBit
= -1;
139 static int hf_Wreth_Mail_Equinf_BreakBit
= -1;
140 static int hf_Wreth_Mail_Equinf_MaxWriteIBit
= -1;
141 static int hf_Wreth_Mail_Equinf_MaxReadIBit
= -1;
142 static int hf_Wreth_Mail_Equinf_MaxWriteQBit
= -1;
143 static int hf_Wreth_Mail_Equinf_MaxReadQBit
= -1;
144 static int hf_Wreth_Mail_Equinf_BreakQBit
= -1;
145 static int hf_Wreth_Mail_Equinf_MaxWriteByte
= -1;
146 static int hf_Wreth_Mail_Equinf_MaxReadByte
= -1;
147 static int hf_Wreth_Mail_Equinf_BreakByte
= -1;
148 static int hf_Wreth_Mail_Equinf_MaxWriteIByte
= -1;
149 static int hf_Wreth_Mail_Equinf_MaxReadIByte
= -1;
150 static int hf_Wreth_Mail_Equinf_BreakIByte
= -1;
151 static int hf_Wreth_Mail_Equinf_MaxWriteQByte
= -1;
152 static int hf_Wreth_Mail_Equinf_MaxReadQByte
= -1;
153 static int hf_Wreth_Mail_Equinf_BreakQByte
= -1;
154 static int hf_Wreth_Mail_Equinf_MaxWriteWord
= -1;
155 static int hf_Wreth_Mail_Equinf_MaxReadWord
= -1;
156 static int hf_Wreth_Mail_Equinf_BreakWord
= -1;
157 static int hf_Wreth_Mail_Equinf_MaxWriteIWord
= -1;
158 static int hf_Wreth_Mail_Equinf_MaxReadIWord
= -1;
159 static int hf_Wreth_Mail_Equinf_BreakIWord
= -1;
160 static int hf_Wreth_Mail_Equinf_MaxWriteQWord
= -1;
161 static int hf_Wreth_Mail_Equinf_MaxReadQWord
= -1;
162 static int hf_Wreth_Mail_Equinf_BreakQWord
= -1;
163 static int hf_Wreth_Mail_Equinf_MaxWriteDWord
= -1;
164 static int hf_Wreth_Mail_Equinf_MaxReadDWord
= -1;
165 static int hf_Wreth_Mail_Equinf_BreakDWord
= -1;
166 static int hf_Wreth_Mail_Equinf_MaxWriteFWord
= -1;
167 static int hf_Wreth_Mail_Equinf_MaxReadFWord
= -1;
168 static int hf_Wreth_Mail_Equinf_BreakFWord
= -1;
169 static int hf_Wreth_Mail_Equinf_ReadFactorWord
= -1;
170 static int hf_Wreth_Mail_Equinf_ReadFactorIWord
= -1;
171 static int hf_Wreth_Mail_Equinf_ReadFactorQWord
= -1;
172 static int hf_Wreth_Mail_Equinf_ReadFactorDWord
= -1;
173 static int hf_Wreth_Mail_Equinf_ReadFactorFWord
= -1;
174 static int hf_Wreth_Mail_Equinf_WriteFactorWord
= -1;
175 static int hf_Wreth_Mail_Equinf_WriteFactorIWord
= -1;
176 static int hf_Wreth_Mail_Equinf_WriteFactorQWord
= -1;
177 static int hf_Wreth_Mail_Equinf_WriteFactorDWord
= -1;
178 static int hf_Wreth_Mail_Equinf_WriteFactorFWord
= -1;
179 static int hf_Wreth_Mail_Equinf_DataFormat
= -1;
180 static int hf_Wreth_Mail_Equinf_BreakIBit
= -1;
182 /* Initialize the subtree pointers */
183 static gint ett_wreth
= -1;
185 /* Note: vals are stored as unsigned 32 bit quantities */
186 static const value_string tabStatus
[] = {
188 { 1, "stat_err_fonc" },
189 { 2, "stat_err_addr" },
190 { 3, "stat_bad_frame" },
191 { 4, "stat_lock_data" },
192 { 10, "STAT_QUEUE_OVERFLOW" },
195 { 33, "statjb_timeout" },
196 { 34, "statjb_crc" },
197 { 35, "stat_cyc_inc" },
198 { 36, "stat_escl_inconnu" },
200 { 40, "STAT_DIF_MAX_THREAD" },
201 { 41, "stat_dif_full" },
202 { 42, "stat_dif_empty" },
203 { 43, "STAT_NES_UNKNOWN" },
204 { 45, "stat_no_soft" },
206 { 47, "stat_no_board" },
207 { 48, "stat_timeout_cts" },
208 { 49, "stat_timeout_wait" },
213 { 54, "stat_nopolling" },
214 { 55, "stat_badintpol" },
215 { 56, "stat_answer" },
216 { 57, "stat_no_statment" },
217 { 58, "stat_net_no_ready" },
220 { 60, "stat_no_retmail" },
221 { 61, "stat_no_dsr_gt4000" },
222 { 62, "stat_no_cts_gt4000" },
223 { 63, "stat_timeout_gt4000" },
224 { 64, "stat_bcc_gt4000" },
225 { 65, "STAT_NOT_CONNECT" },
226 { 66, "STAT_RESSOURCE" },
227 { 67, "STAT_ERR_PDU" },
228 { 68, "STAT_OBJECT_NON_EXISTENT" },
229 { 69, "STAT_TYPE_CONFLICT" },
230 { 70, "STAT_ABORT_USER" },
231 { 71, "STAT_ABORT_FMS" },
232 { 72, "STAT_ABORT_LLI" },
233 { 73, "STAT_ABORT_LAYER2" },
234 { 74, "STAT_MAX_PDU_SIZE" },
235 { 75, "STAT_FEATURE_NOT_SUPPORTED" },
236 { 76, "STAT_VERSION_INCOMPATIBLE" },
237 { 77, "STAT_USER_INITIATE_DENIED" },
238 { 78, "STAT_PASSWORD_ERROR" },
239 { 79, "STAT_PROFILE_INCOMPATIBLE" },
240 { 80, "STAT_ABORT_LLI_CONTEXT" },
241 { 81, "STAT_ABORT_LLI_ABT_RC2" },
242 { 82, "STAT_ABORT_LLI_ABT_RC3" },
243 { 83, "STAT_ERR_CLASS_VFD_STATE" },
244 { 84, "STAT_ERR_CLASS_APPLICATION_REF" },
245 { 85, "STAT_ERR_CLASS_DEFINITION" },
246 { 86, "STAT_ERR_CLASS_RESSOURCE" },
247 { 87, "STAT_ERR_CLASS_SERVICE" },
248 { 88, "STAT_ERR_CLASS_ACCESS" },
249 { 89, "STAT_ERR_CLASS_OD" },
250 { 90, "STAT_ERR_CLASS_OTHER" },
251 { 91, "STAT_REJECT_PDU" },
252 { 92, "STAT_ERR_HARDWARE" },
253 { 93, "STAT_DRIVER_ACCESS" },
254 { 94, "STAT_DRIVER_BAD_VERSION" },
255 { 95, "STAT_FILL_BIG_MAIL" },
256 { 96, "STAT_NO_TASK_VERSION" },
257 { 97, "STAT_DLL_LOCKED" },
258 { 98, "STAT_BOARD_LOCKED" },
259 { 99, "STAT_MODEIO_LOCKED" },
261 /*---- RESERVED STATUS FOR USER KIT4000 ----*/
262 { 100, "STAT_KIT_START" },
264 { 127, "STAT_KIT_END" },
265 /*------------------------------------------*/
266 { 128, "STAT_ERR_NO_REMOTE_CONNECTION" },
267 { 129, "STAT_CONFIG_OK" },
268 { 130, "STAT_CONFIG_NOK" },
270 { 131, "STAT_DNS_PENDING" },
271 { 132, "STAT_DNS_ERROR" },
272 { 133, "STAT_OVERTIME" },
274 { 134, "STAT_FRAG_WRITE" },
275 { 135, "STAT_FRAG_READ" },
277 { 136, "STAT_API_ACCESS" },
278 { 137, "STAT_QUEUE_EMPTY" },
279 { 138, "STAT_QUEUE_FULL" },
281 { 254, "STAT_DEV_INIT" },
283 { -11, "index not updated" },
284 { -10, "stat_handshake" },
285 { -9, "stat_event_data" },
286 { -8, "stat_timeout_ic_read" },
287 { -7, "stat_timeout_read" },
288 { -6, "stat_cyc_stopped" },
289 { -5, "stat_dif_not_ready" },
290 { -4, "stat_unchanged" },
291 { -3, "stat_nes_broadcast" },
292 { -2, "Unknown Status" },
293 { -1, "stat_writedif_ok" },
296 static value_string_ext tabStatus_ext
= VALUE_STRING_EXT_INIT(tabStatus
);
298 static const value_string tabCodef
[] = {
299 /* Code for monitor */
300 { 0x0000, "TIC_INVALID_ROOT" },
301 { 0x0002, "tic_monitor" },
304 { 0x0003, "COD_LOAD_TASK" },
305 { 0x0004, "COD_LOAD_TASK" },
307 { 0x00ff, "TIC_TASK_NON_INIT" }, /* 255 */
309 /* Code for monitor */
310 { 0x0106, "COD_MON_INFO" },
311 { 0x0109, "COD_GETTIC" },
312 { 0x0119, "COD_MON_SETTIME" },
313 { 0x0126, "COD_MON_SIZEMAIL" },
314 { 0x0127, "COD_MON_SETSYNCHRO" },
315 { 0x0128, "COD_MON_GETSYNCHRO" },
317 { 0x012A, "COD_MON_FLAG_DEBUG" },
318 { 0x012B, "COD_MON_SETSCADA_PT" },
319 { 0x012C, "COD_MON_GETSCADA_PT" },
321 { 0x0134, "COD_MON_SETGENVAR" },
322 { 0x0135, "COD_MON_GETGENVAR" },
323 { 0x0200, "COD_MON_READFLASHGT" },
324 { 0x0206, "COD_MON_SETCOMSPEED" },
325 { 0x020c, "COD_MON_TESTCARDTYPE" },
328 { 0x0400, "COD_LOAD_TASK" },
329 { 0x0600, "COD_RELOAD_TASK" },
331 /* Code for master function */
332 { 0x1000, "cod_initmasterline" },
333 { 0x1001, "cod_loadmasterconf" },
334 { 0x1002, "cod_masterinfo" },
335 { 0x1003, "cod_readpackbit" },
336 { 0x1004, "cod_readpackibit" },
337 { 0x1005, "cod_readword" },
338 { 0x1006, "cod_readiword" },
339 { 0x1007, "cod_readdword" },
340 { 0x1008, "cod_readfword" },
341 { 0x1009, "cod_writepackbit" },
342 { 0x100A, "cod_writeword" },
343 { 0x100B, "cod_writedword" },
344 { 0x100C, "cod_writefword" },
345 { 0x100D, "cod_readquickbit" },
346 { 0x100E, "cod_readdiag" },
347 { 0x100F, "cod_readeven" },
348 { 0x1010, "cod_readtrace" },
349 { 0x1011, "cod_statjbus" },
350 { 0x1012, "cod_creatjnet" },
351 { 0x1013, "cod_rijnet" },
352 { 0x1014, "cod_rcjnet" },
353 { 0x1015, "cod_writemes" },
354 { 0x1016, "cod_readmes" },
355 { 0x1017, "cod_manual" },
356 { 0x1018, "cod_automatic" },
357 { 0x1019, "cod_connect" },
358 { 0x101A, "cod_unconnect" },
359 { 0x101B, "cod_iocounter" },
360 { 0x101C, "cod_resetiocounter" },
361 { 0x101D, "codute_identequipment" },
362 { 0x101E, "codute_readbit_SY" },
363 { 0x101F, "codute_readbit_IO" },
364 { 0x1020, "codute_readword_CW" },
365 { 0x1021, "codute_readword_SW" },
366 { 0x1022, "codute_readword_COM" },
367 { 0x1023, "codute_readtempo" },
368 { 0x1024, "codute_readmonost_Mi" },
369 { 0x1025, "codute_readcounter_Ci" },
370 { 0x1026, "codute_readreg_Ri" },
371 { 0x1027, "codute_readsteps_Xi" },
372 { 0x1028, "codute_readdword_DW" },
373 { 0x1029, "codute_readdword_CDW" },
374 { 0x102A, "codute_readone_step" },
375 { 0x102B, "codute_writebit_SY" },
376 { 0x102C, "codute_writebit_IO" },
377 { 0x102D, "codute_writeword_SW" },
378 { 0x102E, "codute_writeword_COM" },
379 { 0x102F, "codute_writetimer_Ti" },
380 { 0x1030, "codute_writemonost_Mi" },
381 { 0x1031, "codute_writecounter_Ci" },
382 { 0x1032, "codute_writereg_Ri" },
383 { 0x1033, "codute_writedword_DW" },
384 { 0x1034, "codute_readbit_B" },
385 { 0x1035, "codute_readword_W" },
386 { 0x1036, "codute_readobjets" },
387 { 0x1037, "codute_readstruc_obj" },
388 { 0x1038, "codute_writebit_B" },
389 { 0x1039, "codute_writeword_W" },
390 { 0x103A, "codute_writestruc_obj" },
391 { 0x103B, "codute_no_requestdata" },
392 { 0x103C, "codute_prot_ver" },
393 { 0x103D, "codute_status" },
394 { 0x103E, "codute_mirror" },
395 { 0x103F, "codute_readerror_count" },
396 { 0x1040, "codute_readstation_status" },
397 { 0x1041, "codute_razerror_counter" },
398 { 0x1042, "codute_write_xgs" },
399 { 0x1043, "codute_stop" },
400 { 0x1044, "codute_run" },
401 { 0x1045, "codute_selftest" },
402 { 0x1046, "codute_init" },
403 { 0x1047, "codute_reserv" },
404 { 0x1048, "codute_unreserv" },
405 { 0x1049, "codute_entreserv" },
406 { 0x104A, "codute_initloader" },
407 { 0x104B, "codute_upload_seg" },
408 { 0x104C, "codute_end_upload_seg" },
409 { 0x104D, "codute_init_download" },
410 { 0x104E, "codute_download_seg" },
411 { 0x104F, "codute_end_download" },
412 { 0x1050, "codute_writereq_file" },
413 { 0x1051, "codute_readanswer_file" },
414 { 0x1052, "codute_exereq_file" },
415 { 0x1053, "codute_razreq_file" },
416 { 0x1054, "codute_stopdrum_DiS" },
417 { 0x1055, "codute_incdrum_DiS" },
418 { 0x1056, "codute_godrum_DiS" },
419 { 0x1057, "codute_readeven_DiS" },
420 { 0x1058, "codute_readone_DiS" },
421 { 0x1059, "codute_write_objet" },
422 { 0x105A, "cod_readpackqbit" },
423 { 0x105B, "cod_writepackqbit" },
424 { 0x105C, "cod_send_rec_txt" },
425 { 0x105D, "cod_iowhite" },
426 { 0x105E, "cod_readpackbyte" },
427 { 0x105F, "cod_readbyte" },
428 { 0x1060, "cod_writepackbyte" },
429 { 0x1061, "cod_writebyte" },
430 { 0x1062, "cod_readwordbcd" },
431 { 0x1063, "cod_writewordbcd" },
432 { 0x1064, "cod_writereadmes" },
433 { 0x1065, "cod_readqword" },
434 { 0x1066, "cod_writeqword" },
435 { 0x1067, "cod_writereaddifmes" },
436 { 0x1068, "cod_readpackibyte" },
437 { 0x1069, "cod_readibyte" },
438 { 0x106A, "cod_readpackqbyte" },
439 { 0x106B, "cod_readqbyte" },
440 { 0x106C, "cod_writepackqbyte" },
441 { 0x106D, "cod_writeqbyte" },
442 { 0x106E, "cod_readident" },
443 { 0x106F, "cod_readpackiqbit" },
444 { 0x1070, "cod_writepackiqbit" },
445 { 0x1071, "cod_layer2profibus" },
446 { 0x1072, "cod_readtimer" },
447 { 0x1073, "cod_writetimer" },
448 { 0x1074, "cod_readcounter" },
449 { 0x1075, "cod_writecounter" },
450 { 0x1076, "0x1076COD_FMSGETOD" },
451 { 0x1077, "cod_endloadmasterconf" },
452 { 0x1078, "COD_FMSSTATUS" },
453 { 0x1079, "COD_EQUIPMENTINFO" },
454 { 0x107A, "COD_WRITEREADPACKBIT" },
455 { 0x107B, "COD_WRITEREADPACKQBIT" },
456 { 0x107C, "COD_WRITEREADPACKBYTE" },
457 { 0x107D, "COD_WRITEREADBYTE" },
458 { 0x107E, "COD_WRITEREADPACKQBYTE" },
459 { 0x107F, "COD_WRITEREADQBYTE" },
460 { 0x1080, "COD_WRITEREADWORD" },
461 { 0x1081, "COD_WRITEREADQWORD" },
462 { 0x1082, "COD_WRITEREADDWORD" },
463 { 0x1083, "COD_WRITEREADFWORD" },
464 { 0x1084, "COD_WRITEREADWORDBCD" },
465 { 0x1085, "COD_CLOSECONNECTION" },
466 { 0x1086, "COD_GET_SUPPORTED_FUNCTION" },
467 { 0x1087, "COD_READOBJECT" },
468 { 0x1088, "COD_WRITEFIELDOBJECT" },
469 { 0x1089, "COD_EQUINFO_OBJ" },
470 { 0x1090, "COD_WRITEREADMSG" },
471 { 0x1091, "COD_START_SCANNER" },
473 /* Code slave function */
474 { 0x2000, "cod_initslave" },
475 { 0x2001, "cod_loadslaveconf" },
476 { 0x2002, "cod_endloadslaveconf" },
479 { 0x3000, "cod_getpackbit" },
480 { 0x3001, "cod_getbit" },
481 { 0x3002, "cod_getword" },
482 { 0x3003, "cod_getdword" },
483 { 0x3004, "cod_getfword" },
484 { 0x3005, "cod_setpackbit" },
485 { 0x3006, "cod_setbit" },
486 { 0x3007, "cod_setword" },
487 { 0x3008, "cod_setdword" },
488 { 0x3009, "cod_setfword" },
489 { 0x300A, "cod_getdispbit" },
490 { 0x300B, "cod_getdispword" },
491 { 0x300C, "cod_getdispdword" },
492 { 0x300D, "cod_getdispfword" },
493 { 0x300E, "cod_setdispbit" },
494 { 0x300F, "cod_setdispword" },
495 { 0x3010, "cod_setdispdword" },
496 { 0x3011, "cod_setdispfword" },
497 { 0x3012, "cod_incdispword" },
498 { 0x3013, "cod_incdispdword" },
499 { 0x3014, "cod_decdispword" },
500 { 0x3015, "cod_decdispdword" },
501 { 0x3016, "cod_getevent" },
502 { 0x3017, "cod_confdb" },
503 { 0x3018, "cod_puteventvar" },
504 { 0x3019, "cod_getpackbyte" },
505 { 0x301A, "cod_setpackbyte" },
506 { 0x301B, "cod_fillbit" },
507 { 0x301C, "cod_fillbyte" },
508 { 0x301D, "cod_fillword" },
509 { 0x301E, "cod_filldword" },
510 { 0x301F, "cod_fillfword" },
511 { 0x3020, "COD_APPGETBIT" },
512 { 0x3021, "COD_DBEXECUTED" },
513 { 0x3022, "COD_GETRIGHTS" },
514 { 0x3023, "COD_WFCYC_COS" },
515 { 0x3024, "COD_END_FCYC" },
516 { 0x3025, "COD_FCYC_END" },
517 { 0x3026, "COD_TAB_FCYC" },
518 { 0x3027, "COD_GETFCYCCOS" },
519 { 0x3028, "COD_SETIOAREAADDR" },
520 { 0x3029, "COD_GETIOAREAADDR" },
521 { 0x3030, "COD_SETACTFNTADDR" },
522 { 0x3031, "COD_GETACTFNTADDR" },
523 { 0x3032, "COD_GETACTFNTBITWORD" },
525 /* Code disp_cyc functions */
526 { 0x4000, "cod_cycinfo" },
527 { 0x4001, "cod_createcyc" },
528 { 0x4002, "cod_startcyc" },
529 { 0x4003, "cod_stopcyc" },
530 { 0x4004, "cod_transcyc" },
531 { 0x4005, "cod_actcyc" },
532 { 0x4006, "cod_initcyc" },
533 { 0x4007, "cod_cycparam" },
534 { 0x4008, "cod_stopallcyc" },
535 { 0x4009, "cod_stopallcycread" },
536 { 0x400A, "cod_stopallcycwrite" },
537 { 0x400B, "cod_cyctimebase" },
538 { 0x400C, "COD_CYCEXECUTED" },
539 { 0x400E, "COD_NEWCREATECYC" },
540 { 0x400F, "COD_DISPCYC_DEBUG" },
541 { 0x4010, "COD_NEWCREATECYC_ID" },
542 { 0x4011, "COD_DESTROYCYC_ID" },
543 { 0x4012, "COD_CREATECYC_OBJ" },
544 { 0x4013, "COD_TRANSCYC_VERIF" },
545 { 0x4014, "COD_CREATECYC_WRMSG" },
546 { 0x4015, "COD_NEWCREATECYC_WRMSG" },
547 { 0x4016, "COD_NEWCREATECYC_WRMSG_ID" },
548 { 0x4017, "COD_CYCEXECUTED_AND_COS" },
549 { 0x4018, "COD_STARTCYCONE" },
550 { 0x4019, "COD_GETCRESCENDO_USB" },
551 { 0x4020, "COD_GETCYCPARAM2" },
552 { 0x4021, "COD_FCYCWRITENONCOS" },
553 { 0x4022, "COD_RESETCPTACTIVATION" },
555 /* Code Root function */
556 { 0x5000, "cod_rootinfo" },
557 { 0x5001, "cod_initjbus" },
558 { 0x5002, "cod_exitjbus" },
559 { 0x5003, "cod_transdif" },
560 { 0x5004, "cod_testtransdif" },
561 { 0x5005, "cod_watchdog" },
562 { 0x5006, "cod_accesskey" },
563 { 0x5007, "cod_getmodem" },
564 { 0x5008, "cod_setmodem" },
565 { 0x5009, "COD_GETSTATIONNAME" },
566 { 0x500A, "COD_GETSTATIONINFO" },
567 { 0x500B, "COD_GETWATCHDOG" },
568 { 0x500C, "COD_DIAG_ROOT" },
570 /* Code bt100 function */
571 { 0x6000, "COD_CREATEBT" },
572 { 0x6001, "COD_TIMEBASEBT" },
573 { 0x6002, "COD_CREATEBASETIME" },
575 /* Code ADMINFL-0 : files */
576 { 0x7000, "COD_OPENFILE" },
577 { 0x7001, "COD_CLOSEFILE" },
578 { 0x7002, "COD_READFILE" },
579 { 0x7003, "COD_WRITEFILE" },
580 { 0x7004, "COD_DELETEFILE" },
581 { 0x7005, "COD_SEEKFILE" },
582 { 0x7006, "COD_TEELFILE" },
583 { 0x7007, "COD_EOFFILE" },
584 { 0x7008, "COD_GETPTRFILE" },
585 { 0x7009, "COD_DIRFILE" },
588 { 0x7500, "COD_USER_FIRST" },
590 { 0x7501, "COD_USER_EXCHANGE" },
591 { 0x7502, "COD_USER_STATUSEXCHANGE" },
592 { 0x7503, "COD_USER_SENDFRAME" },
593 { 0x7504, "COD_USER_STATUSSENDFRAME" },
595 { 0x7600, "COD_USER_EQUIPPARAMSREAD" },
596 { 0x7601, "COD_USER_EQUIPINFOUPDATE" },
597 { 0x7602, "COD_USER_ANALYZESTDREQUEST" },
598 { 0x7603, "COD_USER_ANALYZEOBJREQUEST" },
599 { 0x7604, "COD_USER_PREPROCESSREQUEST" },
600 { 0x7605, "COD_USER_PREPROCESSANSWER" },
601 { 0x7606, "COD_USER_EXEFUNCREQUEST" },
602 { 0x7607, "COD_USER_EXEFUNCANSWER" },
603 { 0x7608, "COD_USER_ABORTFRAME" },
605 { 0x7700, "COD_USER_GETFUNCTION" },
606 { 0x7701, "COD_USER_EXEFUNCREQ" },
607 { 0x7702, "COD_USER_EXEFUNCACK" },
609 { 0x7999, "COD_USER_LAST" },
612 { 0x8000, "COD_INDWRITEMASK" },
614 /* Code ADMINMSG-0 : message */
615 { 0x9000, "COD_READMSG" },
616 { 0x9001, "COD_CLEARMSG" },
617 { 0x9002, "COD_DIRMSG" },
618 { 0x9003, "COD_ENABLEMSG" },
619 { 0x9004, "COD_DISABLEMSG" },
620 { 0x9005, "COD_CREATEMSG" },
621 { 0x9006, "COD_GETDESCRMSG" },
622 { 0x9007, "COD_DIRALLMSG" },
623 { 0x9008, "COD_INFOMSG" },
624 { 0x9009, "COD_GETFLAGSMSG" },
625 { 0x900A, "COD_SETFLAGSMSG" },
626 { 0x9100, "COD_MSG_ENABLED" },
628 /* First LLI MAIL Codef */
629 { 0x9500, "COD_LLI_WHITE" },
631 /* system commands */
632 { 0x9510, "COD_MANAGE_INIT" },
633 { 0x9511, "COD_MANAGE_SAP" },
634 { 0x9512, "COD_LLI_DIAG" },
635 { 0x9513, "COD_LLI_MANAGE" },
636 { 0x9514, "COD_ADD_INSTANCE" },
637 { 0x9515, "COD_REM_INSTANCE" },
638 { 0x9516, "COD_GET_MESSAGING" },
639 { 0x9517, "COD_LLI_CMD" },
641 /* protocol commands */
642 { 0x9600, "COD_LLI_EXCHANGE" },
643 { 0x9602, "COD_LLI_INIT" },
644 { 0x9603, "COD_LLI_START" },
645 { 0x9604, "COD_LLI_STOP" },
646 { 0x9605, "COD_LLI_READ_INPUT" },
647 { 0x9606, "COD_LLI_READ_OUTPUT" },
648 { 0x9607, "COD_LLI_ABORT" },
649 { 0x9608, "COD_LLI_TRACE_ON" },
650 { 0x9609, "COD_LLI_TRACE_OFF" },
651 { 0x960A, "COD_LLI_WRITE_OUTPUT" },
652 { 0x960B, "COD_LLI_READ_ASYNC" },
653 { 0x960C, "COD_LLI_WRITE_ASYNC" },
654 { 0x960D, "COD_LLI_DP_SERVICE" },
655 { 0x960E, "COD_LLI_FDL_SERVICE" },
656 { 0x960F, "COD_LLI_SCAN_L2" },
657 { 0x9610, "COD_LLI_SCAN_MESSAGING" },
658 { 0x9611, "COD_LLI_MPISLAVE_SERVICE" },
659 { 0x9612, "COD_LLI_FDL_MESSAGING" },
661 /* Last LLI MAIL Codef */
662 { 0x96FF, "COD_LLI_LAST" },
664 { 0xA001, "COD_REFRESH_INPUT" },
665 { 0xA002, "COD_REFRESH_OUTPUT" },
668 { 0xB001, "COD_SOCKET_CREATE" },
669 { 0xB002, "COD_SOCKET_BIND" },
670 { 0xB003, "COD_SOCKET_CONNECT" },
671 { 0xB004, "COD_SOCKET_LISTEN" },
672 { 0xB005, "COD_SOCKET_ACCEPT" },
673 { 0xB006, "COD_SOCKET_SENDTO" },
674 { 0xB007, "COD_SOCKET_RECVFROM" },
675 { 0xB008, "COD_SOCKET_SEND" },
676 { 0xB009, "COD_SOCKET_RECV" },
677 { 0xB010, "COD_SOCKET_CLOSE" },
678 { 0xB011, "COD_SOCKET_HOST_INFO" },
679 { 0xB012, "COD_SOCKET_PEER_INFO" },
680 { 0xB013, "COD_SOCKET_RECV_GET_DATA" },
681 { 0xB014, "COD_SOCKET_GET_STAT" },
682 { 0xB015, "COD_SOCKET_RESET_STAT" },
683 /*New type for the version 2*/
684 { 0xB016, "COD_SOCKET_SETSOCKOPT" },
685 { 0xB017, "COD_SOCKET_SELECT" },
686 { 0xB018, "COD_SOCKET_SHUTDOWN_ALL" },
687 { 0xB019, "COD_SOCKET_DIAG_SUMMARY" },
688 { 0xB01A, "COD_SOCKET_DIAG_DETAILS" },
689 { 0xB01B, "COD_SOCKET_DIAG_SO" },
690 { 0xB01C, "COD_SOCKET_EVENT" },
693 { 0xC000, "COD_ARP_QUERY" },
694 { 0xC001, "COD_ARP_FLUSH" },
696 { 0xFFEF, "index not updated" }, /* -11 */
698 { 0xFFFE, "Unknown Status" },
701 static value_string_ext tabCodef_ext
= VALUE_STRING_EXT_INIT(tabCodef
);
703 static const value_string FunctionCodes
[] = {
704 { WRETH_IDENT
, "Identification" },
705 { WRETH_CONNECT
, "Connection" },
706 { WRETH_ACK
, "Acknowledge" },
707 { WRETH_NACK
, "Non acknowledge" },
708 { WRETH_DISCONNECT
, "Disconnection" },
709 { WRETH_MAIL
, "Mail" },
710 { WRETH_BLINKY
, "Blinky" },
711 { WRETH_GET_VALUE
, "Get value" },
712 { WRETH_SET_VALUE
, "Set value" },
713 { WRETH_BOOST
, "Boost" },
716 static value_string_ext FunctionCodes_ext
= VALUE_STRING_EXT_INIT(FunctionCodes
);
718 static const value_string ErrorCode_vals
[] = {
720 { WRETH_BAD_FUNCTION_CODE
, "Bad function code" },
721 { WRETH_ALREADY_CONNECTED
, "Already connected" },
722 { WRETH_INVALID_PROTOCOL_VERSION
, "Invalid protocol version" },
723 { WRETH_NOT_CONNECTED
, "Not connected" },
724 { WRETH_INVALID_MAC_ADDRESS
, "Invalid MAC address" },
725 { WRETH_INVALID_FRAME_SIZE
, "Invalid frame size" },
726 { WRETH_NO_MEMORY_AVAILABLE
, "No memory available" },
727 { WRETH_BAD_PARAMETER
, "Bad parameter" },
728 { WRETH_TASK_REGISTERED
, "Task registered" },
731 static value_string_ext ErrorCode_vals_ext
= VALUE_STRING_EXT_INIT(ErrorCode_vals
);
733 static void dissect_wreth(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
736 guint16 packet_type
,functionCode
;
739 proto_tree
*pWrethTree
;
743 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Wreth");
744 /* Clear out stuff in the info column */
745 col_clear(pinfo
->cinfo
,COL_INFO
);
747 /*Read the packet type, if not good, exit*/
748 packet_type
= tvb_get_ntohs(tvb
,0);
749 if(packet_type
!= WSE_RETH_SUBTYPE
) return;
751 mi
= proto_tree_add_protocol_format(tree
, wreth_proto
, tvb
, Offset
, -1, "WSE remote ethernet");
752 pWrethTree
= proto_item_add_subtree(mi
, ett_wreth
);
754 functionCode
= tvb_get_letohs(tvb
,4);
755 fragmented
= tvb_get_guint8(tvb
,10);
759 col_set_str(pinfo
->cinfo
, COL_INFO
, "Invalid fragmented byte");
766 proto_tree_add_item(pWrethTree
, hf_Wreth_Subtype
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
769 proto_tree_add_item(pWrethTree
, hf_Wreth_Size
, tvb
, Offset
+ 2, 2, ENC_LITTLE_ENDIAN
);
772 proto_tree_add_item(pWrethTree
, hf_Wreth_FunctionCode
, tvb
, Offset
+ 4, 2, ENC_LITTLE_ENDIAN
);
775 proto_tree_add_item(pWrethTree
, hf_Wreth_FrameId
, tvb
, Offset
+ 6, 2, ENC_LITTLE_ENDIAN
);
778 proto_tree_add_item(pWrethTree
, hf_Wreth_ErrorCode
, tvb
, Offset
+ 8, 2, ENC_LITTLE_ENDIAN
);
785 ti
= proto_tree_add_item(pWrethTree
, hf_Wreth_Fragmented
, tvb
, Offset
+ 10, 1, ENC_LITTLE_ENDIAN
);
786 proto_item_append_text(ti
, ": second fragment");
789 proto_tree_add_item(pWrethTree
, hf_Wreth_Retry
, tvb
, Offset
+ 11, 1, ENC_LITTLE_ENDIAN
);
791 WrethMailDissection(tvb
, Offset
+ 12, pinfo
, pWrethTree
, fragmented
);
795 ti
= proto_tree_add_item(pWrethTree
, hf_Wreth_Fragmented
, tvb
, Offset
+ 10, 1, ENC_LITTLE_ENDIAN
);
798 proto_item_append_text(ti
, ": first fragment");
800 proto_item_append_text(ti
, ": no");
803 proto_tree_add_item(pWrethTree
, hf_Wreth_Retry
, tvb
, Offset
+ 11, 1, ENC_LITTLE_ENDIAN
);
805 /* Add items to protocol tree specific to Wreth */
809 WrethIdentPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
812 WrethConnectPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
815 WrethAckPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
818 WrethNackPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
820 case WRETH_DISCONNECT
:
821 WrethDisconnectPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
824 WrethMailPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
827 WrethBlinkyPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
829 case WRETH_GET_VALUE
:
830 WrethGetValuePacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
832 case WRETH_SET_VALUE
:
833 WrethSetValuePacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
836 WrethBoostPacket(tvb
, Offset
+ 12, pinfo
, pWrethTree
);
844 /*****************************************************************************/
846 static const value_string IdentState
[] = {
852 gint
WrethIdentPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
856 Size
= tvb_get_letohs(tvb
, 2);
858 if((Size
!= 0)&&(Size
!= 19))
860 /* Invalid identification frame */
861 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid identification frame");
867 col_set_str(pInfo
->cinfo
, COL_INFO
, "Identification question");
872 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBiosVersion
, tvb
, Offset
, 6, ENC_ASCII
|ENC_NA
);
875 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBoardNumber
, tvb
, Offset
+ 6, 2, ENC_LITTLE_ENDIAN
);
878 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationProtocolVersion
, tvb
, Offset
+ 8, 2, ENC_LITTLE_ENDIAN
);
881 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationBoardId
, tvb
, Offset
+ 10, 2, ENC_LITTLE_ENDIAN
);
884 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationState
, tvb
, Offset
+ 12, 1, ENC_LITTLE_ENDIAN
);
886 /*Client MAC address*/
887 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationMacAddr
, tvb
, Offset
+ 13, 6, ENC_BIG_ENDIAN
);
889 col_set_str(pInfo
->cinfo
, COL_INFO
, "Identification response");
894 /*****************************************************************************/
896 gint
WrethConnectPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
900 Size
= tvb_get_letohs(tvb
,2);
904 /* Invalid connection frame */
905 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid connection frame");
909 col_set_str(pInfo
->cinfo
, COL_INFO
, "Connection");
911 proto_tree_add_item(pWrethTree
, hf_Wreth_ConnectProtocolVersion
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
913 proto_tree_add_item(pWrethTree
, hf_Wreth_ConnectTimeout
, tvb
, Offset
+ 2, 2, ENC_LITTLE_ENDIAN
);
918 /*****************************************************************************/
920 gint
WrethDisconnectPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
924 Size
= tvb_get_letohs(tvb
,2);
928 /* Invalid disconnection frame */
929 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid disconnection frame");
933 col_set_str(pInfo
->cinfo
, COL_INFO
, "Disconnection");
938 /*****************************************************************************/
940 gint
WrethBlinkyPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
944 Size
= tvb_get_letohs(tvb
,2);
948 /* Invalid blinky frame */
949 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid blinky frame");
953 col_set_str(pInfo
->cinfo
, COL_INFO
, "Blinky");
955 proto_tree_add_item(pWrethTree
, hf_Wreth_BlinkyPeriod
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
960 /*****************************************************************************/
962 gint
WrethGetValuePacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
966 Size
= tvb_get_letohs(tvb
,2);
971 col_set_str(pInfo
->cinfo
, COL_INFO
, "Get value question");
974 proto_tree_add_item(pWrethTree
, hf_Wreth_GetValueVal
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
975 col_set_str(pInfo
->cinfo
, COL_INFO
, "Get value response");
978 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid get value frame");
985 /*****************************************************************************/
987 gint
WrethSetValuePacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
991 Size
= tvb_get_letohs(tvb
,2);
995 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid set value frame");
998 proto_tree_add_item(pWrethTree
, hf_Wreth_SetValueVal
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1000 col_set_str(pInfo
->cinfo
, COL_INFO
, "Set value question");
1005 /*****************************************************************************/
1006 static const value_string BoostValue
[] = {
1012 gint
WrethBoostPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1016 Size
= tvb_get_letohs(tvb
,2);
1020 /* Invalid boost frame */
1021 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid boost frame");
1025 col_set_str(pInfo
->cinfo
, COL_INFO
, "Boost");
1027 proto_tree_add_item(pWrethTree
, hf_Wreth_BoostValue
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1032 /*****************************************************************************/
1034 gint
WrethAckPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree _U_
)
1038 Size
= tvb_get_letohs(tvb
,2);
1042 /* Invalid ack frame */
1043 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid acknowledge frame");
1047 col_set_str(pInfo
->cinfo
, COL_INFO
, "Acknowledge");
1052 /*****************************************************************************/
1054 gint
WrethNackPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1059 Size
= tvb_get_letohs(tvb
,2);
1060 ErrorCode
= tvb_get_letohs(tvb
,8);
1062 if((Size
!= 0)&&(Size
!= 6))
1064 /* Invalid ack frame */
1065 col_set_str(pInfo
->cinfo
, COL_INFO
, "Invalid non acknowledge frame");
1070 col_add_str(pInfo
->cinfo
, COL_INFO
, val_to_str_ext(ErrorCode
, &ErrorCode_vals_ext
, "Unknown 0x%04x"));
1074 proto_tree_add_item(pWrethTree
, hf_Wreth_IdentificationMacAddr
, tvb
, Offset
, 6, ENC_BIG_ENDIAN
);
1080 /*****************************************************************************/
1082 gint
WrethMailPacket(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
)
1085 proto_tree_add_item(pWrethTree
, hf_Wreth_MailDestTic
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1086 proto_tree_add_item(pWrethTree
, hf_Wreth_MailReserved
, tvb
, Offset
+ 2, 4, ENC_LITTLE_ENDIAN
);
1088 col_set_str(pInfo
->cinfo
, COL_INFO
, "Mail");
1090 /*Frame not fragmented => last argument = 0*/
1091 WrethMailDissection(tvb
, Offset
+6, pInfo
, pWrethTree
,0);
1096 /*****************************************************************************/
1098 gint
WrethMailDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo
, proto_tree
* pWrethTree
, guint8 fragmented
)
1101 proto_tree
*pWrethMailboxTree
;
1105 mi
= proto_tree_add_protocol_format(pWrethTree
, wreth_proto
, tvb
, Offset
, -1, "MailBox");
1106 pWrethMailboxTree
= proto_item_add_subtree(mi
, ett_wreth
);
1108 /*If it's not the last fragment, display the header of the MailBox*/
1109 if (2 != fragmented
)
1115 Codef
= tvb_get_letohs(tvb
,Offset
);
1116 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Codef
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1119 Status
= (gint16
)tvb_get_letohs(tvb
,Offset
); /* cast fetched value to signed so sign is extended */
1120 /* so that lookup of 32-bit unsigned in tabCodef */
1121 /* value_string array will work properly. */
1122 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Status
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1125 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TicUser_Root
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1128 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_PidUser
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1131 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Mode
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1134 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Time
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1137 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Stop
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1140 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nfonc
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1143 Card
= tvb_get_letohs(tvb
,Offset
);
1144 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Ncard
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1147 Chan
= tvb_get_letohs(tvb
,Offset
);
1148 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nchan
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1151 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nes
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1154 Nb
= (gint
)tvb_get_letohs(tvb
,Offset
);
1155 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nb
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1158 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TypVar
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1161 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Adr
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1164 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_TicUser_DispCyc
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1166 /*Mail Nb Max Size Mail*/
1167 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Nb_Max_Size_Mail
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1169 /*Mail User ThreadID*/
1170 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_User_ThreadID
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1172 /*Mail DispCyc Version*/
1173 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_DispCyc_Version
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1175 /*Mail DifUserParam*/
1176 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_DifUserParam
, tvb
, Offset
, 4, ENC_LITTLE_ENDIAN
);
1179 proto_tree_add_item(pWrethMailboxTree
, hf_Wreth_Mail_Filler
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1182 col_add_fstr(pInfo
->cinfo
, COL_INFO
, "Mail : Codef = Ox%X (%s), Status = %02d (%s), Card = %d, Chan = %d" ,
1184 val_to_str_ext(Codef
, &tabCodef_ext
, "Unknown 0x%04x%"),
1186 val_to_str_ext(Status
, &tabStatus_ext
, "Unknown %d"),
1192 col_set_str(pInfo
->cinfo
, COL_INFO
, "Mail : Data Second Fragment ");
1197 /*Specific Decode for some Codef*/
1200 case 0x1002: /*Master Info*/
1201 WrethCodefMasterInfoDissection(tvb
, Offset
, pInfo
, pWrethMailboxTree
);
1203 case 0x1079: /*Equipment Info*/
1204 WrethCodefEquipmentInfoDissection(tvb
, Offset
, pInfo
, pWrethMailboxTree
);
1207 proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1215 /*****************************************************************************/
1217 gint
WrethCodefMasterInfoDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo _U_
, proto_tree
* pWrethMailboxTree
)
1220 proto_tree
*pWrethMailboxDataTree
;
1222 mi
= proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1223 pWrethMailboxDataTree
= proto_item_add_subtree(mi
, ett_wreth
);
1226 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Version
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1229 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Release
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1232 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_Protocol
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1235 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_CyclicFlux
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1238 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_szProtocolName
, tvb
, Offset
, 16, ENC_ASCII
|ENC_NA
);
1240 /*bMaxTypeEquipment*/
1241 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MaxTypeEquipment
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1243 /*wMinEquipmentNumber*/
1244 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MinEquipmentNumber
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1246 /*wMaxEquipmentNumber*/
1247 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1253 /*****************************************************************************/
1255 gint
WrethCodefEquipmentInfoDissection(tvbuff_t
*tvb
, guint8 Offset
, packet_info
* pInfo _U_
, proto_tree
* pWrethMailboxTree
)
1258 proto_tree
*pWrethMailboxDataTree
;
1260 mi
= proto_tree_add_protocol_format(pWrethMailboxTree
, wreth_proto
, tvb
, Offset
, -1, "Data");
1261 pWrethMailboxDataTree
= proto_item_add_subtree(mi
, ett_wreth
);
1264 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Version
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1269 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Release
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1272 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Network
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1275 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Protocol
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1278 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Messaging
, tvb
, Offset
, 1, ENC_LITTLE_ENDIAN
);
1281 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Equipment
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1284 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_Flux
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1289 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1292 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1295 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_IncFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1300 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_DllItemName
, tvb
, Offset
, 14, ENC_ASCII
|ENC_NA
);
1303 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Mastinf_szEquipmentName
, tvb
, Offset
, 16, ENC_ASCII
|ENC_NA
);
1308 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1311 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1314 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1317 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1320 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1323 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1326 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1329 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1332 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQBit
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1335 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1338 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1341 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1344 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1347 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1350 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1353 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1356 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1359 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQByte
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1362 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1365 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1368 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1371 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1374 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1377 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1380 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1383 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1386 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1389 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1392 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1395 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1398 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxWriteFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1401 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_MaxReadFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1404 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_BreakFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1407 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1409 /*wReadFactorIWord*/
1410 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1412 /*wReadFactorQWord*/
1413 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1415 /*wReadFactorDWord*/
1416 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1418 /*wReadFactorFWord*/
1419 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_ReadFactorFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1421 /*wWriteFactorWord*/
1422 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1424 /*wWriteFactorIWord*/
1425 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorIWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1427 /*wWriteFactorQWord*/
1428 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorQWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1430 /*wWriteFactorDWord*/
1431 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorDWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1433 /*wWriteFactorFWord*/
1434 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_WriteFactorFWord
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1437 proto_tree_add_item(pWrethMailboxDataTree
, hf_Wreth_Mail_Equinf_DataFormat
, tvb
, Offset
, 2, ENC_LITTLE_ENDIAN
);
1443 void proto_register_wreth(void)
1445 static hf_register_info hf
[] =
1447 /* Wreth header fields */
1448 { &hf_Wreth_Subtype
,
1449 { "Subtype", "wreth.Subtype",
1450 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1454 { "Size", "wreth.Size",
1455 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1458 { &hf_Wreth_FunctionCode
,
1459 { "Function code","wreth.FunctionCode",
1460 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &FunctionCodes_ext
, 0x0,
1463 { &hf_Wreth_FrameId
,
1464 { "FrameId", "wreth.FrameId",
1465 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1468 { &hf_Wreth_ErrorCode
,
1469 { "Error code", "wreth.ErrorCode",
1470 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ErrorCode_vals_ext
, 0x0,
1473 { &hf_Wreth_Fragmented
,
1474 { "Fragmented", "wreth.Fragmented",
1475 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1479 { "Retry", "wreth.Retry",
1480 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1483 { &hf_Wreth_IdentificationBiosVersion
,
1484 { "Bios version", "wreth.IdentBiosVersion",
1485 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1488 { &hf_Wreth_IdentificationBoardNumber
,
1489 { "Board number", "wreth.IdentBoardNumber",
1490 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1493 { &hf_Wreth_IdentificationProtocolVersion
,
1494 { "Protocol version", "wreth.IdentProtocolVersion",
1495 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1498 { &hf_Wreth_IdentificationBoardId
,
1499 { "Board Id", "wreth.IdentBoardId",
1500 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1503 { &hf_Wreth_IdentificationState
,
1504 { "State", "wreth.IdentState",
1505 FT_UINT8
, BASE_DEC
, VALS(IdentState
), 0x0,
1508 { &hf_Wreth_IdentificationMacAddr
,
1509 { "Client MAC address :", "wreth.IdentClientMacAddr",
1510 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1513 { &hf_Wreth_ConnectProtocolVersion
,
1514 { "Protocol version", "wreth.ConnectProtocolVersion",
1515 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1518 { &hf_Wreth_ConnectTimeout
,
1519 { "Connect timeout", "wreth.ConnectTimeout",
1520 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1523 { &hf_Wreth_BlinkyPeriod
,
1524 { "Period", "wreth.BlinkyPeriod",
1525 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1528 { &hf_Wreth_GetValueVal
,
1529 { "Value", "wreth.GetValue",
1530 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1533 { &hf_Wreth_SetValueVal
,
1534 { "Value", "wreth.SetValue",
1535 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1538 { &hf_Wreth_BoostValue
,
1539 { "Boost", "wreth.BoostStatus",
1540 FT_UINT16
, BASE_DEC
, VALS(BoostValue
), 0x0,
1543 { &hf_Wreth_MailDestTic
,
1544 { "Dest tic", "wreth.MailDestTic",
1545 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1548 { &hf_Wreth_MailReserved
,
1549 { "Reserved", "wreth.MailReserved",
1550 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1553 { &hf_Wreth_Mail_Codef
,
1554 { "Codef", "wreth.Mail.Codef",
1555 FT_UINT16
, BASE_HEX
| BASE_EXT_STRING
, &tabCodef_ext
, 0x0,
1558 { &hf_Wreth_Mail_Status
,
1559 { "Status", "wreth.Mail.Status",
1560 FT_INT16
, BASE_DEC
| BASE_EXT_STRING
, &tabStatus_ext
, 0x0,
1563 { &hf_Wreth_Mail_TicUser_Root
,
1564 { "TicUser Root", "wreth.Mail.TicUserRoot",
1565 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1568 { &hf_Wreth_Mail_PidUser
,
1569 { "PidUser", "wreth.Mail.PidUser",
1570 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1573 { &hf_Wreth_Mail_Mode
,
1574 { "Mode", "wreth.Mail.Mode",
1575 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1578 { &hf_Wreth_Mail_Time
,
1579 { "Time", "wreth.Mail.Time",
1580 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1583 { &hf_Wreth_Mail_Stop
,
1584 { "Stop", "wreth.Mail.Stop",
1585 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1588 { &hf_Wreth_Mail_Nfonc
,
1589 { "Nfonc", "wreth.Mail.Nfonc",
1590 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1593 { &hf_Wreth_Mail_Ncard
,
1594 { "Ncard", "wreth.Mail.Ncard",
1595 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1598 { &hf_Wreth_Mail_Nchan
,
1599 { "Nchan", "wreth.Mail.Nchan",
1600 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1603 { &hf_Wreth_Mail_Nes
,
1604 { "Nes", "wreth.Mail.Nes",
1605 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1608 { &hf_Wreth_Mail_Nb
,
1609 { "Nb", "wreth.Mail.Nb",
1610 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1613 { &hf_Wreth_Mail_TypVar
,
1614 { "TypVar", "wreth.Mail.TypVar",
1615 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1618 { &hf_Wreth_Mail_Adr
,
1619 { "Adr", "wreth.Mail.Adr",
1620 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1623 { &hf_Wreth_Mail_TicUser_DispCyc
,
1624 { "TicUser DispCyc", "wreth.Mail.TicUser.DispCyc",
1625 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1628 { &hf_Wreth_Mail_Nb_Max_Size_Mail
,
1629 { "Nb Max Size Mail", "wreth.Mail.TicUser.Nb.Max.Size.Mail",
1630 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1633 { &hf_Wreth_Mail_User_ThreadID
,
1634 { "User ThreadID", "wreth.Mail.User.ThreadID",
1635 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1638 { &hf_Wreth_Mail_DispCyc_Version
,
1639 { "DispCyc Version", "wreth.Mail.DispCyc.Version",
1640 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1643 { &hf_Wreth_Mail_DifUserParam
,
1644 { "DifUserParam", "wreth.Mail.DifUserParam",
1645 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1648 { &hf_Wreth_Mail_Filler
,
1649 { "Filler", "wreth.Mail.Filler",
1650 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1654 { &hf_Wreth_Mail_Data
,
1655 { "Data", "wreth.Mail.Data",
1656 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1660 { &hf_Wreth_Mail_Mastinf_Version
,
1661 { "Version", "wreth.Mail.Mastinf.Version",
1662 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1665 { &hf_Wreth_Mail_Mastinf_Release
,
1666 { "Release", "wreth.Mail.Mastinf.Release",
1667 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1670 { &hf_Wreth_Mail_Mastinf_Protocol
,
1671 { "Protocol", "wreth.Mail.Mastinf.Protocol",
1672 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1675 { &hf_Wreth_Mail_Mastinf_CyclicFlux
,
1676 { "CyclicFlux", "wreth.Mail.Mastinf.CyclicFlux",
1677 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1680 { &hf_Wreth_Mail_Mastinf_szProtocolName
,
1681 { "ProtocolName", "wreth.Mail.Mastinf.ProtocolName",
1682 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1685 { &hf_Wreth_Mail_Mastinf_MaxTypeEquipment
,
1686 { "MaxTypeEquipment", "wreth.Mail.Mastinf.MaxTypeEquipment",
1687 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1690 { &hf_Wreth_Mail_Mastinf_MinEquipmentNumber
,
1691 { "MinEquipmentNumber", "wreth.Mail.Mastinf.MinEquipmentNumber",
1692 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1695 { &hf_Wreth_Mail_Mastinf_MaxEquipmentNumber
,
1696 { "MaxEquipmentNumber", "wreth.Mail.Mastinf.MaxEquipmentNumber",
1697 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1700 { &hf_Wreth_Mail_Equinf_Version
,
1701 { "Version", "wreth.Mail.Equinf.Version",
1702 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1705 { &hf_Wreth_Mail_Equinf_Release
,
1706 { "Release", "wreth.Mail.Equinf.Release",
1707 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1710 { &hf_Wreth_Mail_Equinf_Network
,
1711 { "Network", "wreth.Mail.Equinf.Network",
1712 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1715 { &hf_Wreth_Mail_Equinf_Protocol
,
1716 { "Protocol", "wreth.Mail.Equinf.Protocol",
1717 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1720 { &hf_Wreth_Mail_Equinf_Messaging
,
1721 { "Messaging", "wreth.Mail.Equinf.Messaging",
1722 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1725 { &hf_Wreth_Mail_Equinf_Equipment
,
1726 { "Equipment", "wreth.Mail.Equinf.Equipment",
1727 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1730 { &hf_Wreth_Mail_Equinf_Flux
,
1731 { "Flux", "wreth.Mail.Equinf.Flux",
1732 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1735 { &hf_Wreth_Mail_Equinf_IncWord
,
1736 { "IncWord", "wreth.Mail.Equinf.IncWord",
1737 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1740 { &hf_Wreth_Mail_Equinf_IncDWord
,
1741 { "IncDWord", "wreth.Mail.Equinf.IncDWord",
1742 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1745 { &hf_Wreth_Mail_Equinf_IncFWord
,
1746 { "IncFWord", "wreth.Mail.Equinf.IncFWord",
1747 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1750 { &hf_Wreth_Mail_Mastinf_DllItemName
,
1751 { "DllItemName", "wreth.Mail.Equinf.DllItemName",
1752 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1755 { &hf_Wreth_Mail_Mastinf_szEquipmentName
,
1756 { "EquipmentName", "wreth.Mail.Equinf.EquipmentName",
1757 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1760 { &hf_Wreth_Mail_Equinf_MaxWriteBit
,
1761 { "MaxWriteBit", "wreth.Mail.Equinf.MaxWriteBit",
1762 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1765 { &hf_Wreth_Mail_Equinf_MaxReadBit
,
1766 { "MaxReadBit", "wreth.Mail.Equinf.MaxReadBit",
1767 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1770 { &hf_Wreth_Mail_Equinf_BreakBit
,
1771 { "BreakBit", "wreth.Mail.Equinf.BreakBit",
1772 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1775 { &hf_Wreth_Mail_Equinf_MaxWriteIBit
,
1776 { "MaxWriteIBit", "wreth.Mail.Equinf.MaxWriteIBit",
1777 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1780 { &hf_Wreth_Mail_Equinf_MaxReadIBit
,
1781 { "MaxReadIBit", "wreth.Mail.Equinf.MaxReadIBit",
1782 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1785 { &hf_Wreth_Mail_Equinf_MaxWriteQBit
,
1786 { "MaxWriteQBit", "wreth.Mail.Equinf.MaxWriteQBit",
1787 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1790 { &hf_Wreth_Mail_Equinf_MaxReadQBit
,
1791 { "MaxReadQBit", "wreth.Mail.Equinf.MaxReadQBit",
1792 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1795 { &hf_Wreth_Mail_Equinf_BreakQBit
,
1796 { "BreakQBit", "wreth.Mail.Equinf.BreakQBit",
1797 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1800 { &hf_Wreth_Mail_Equinf_MaxWriteByte
,
1801 { "MaxWriteByte", "wreth.Mail.Equinf.MaxWriteByte",
1802 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1805 { &hf_Wreth_Mail_Equinf_MaxReadByte
,
1806 { "MaxReadByte", "wreth.Mail.Equinf.MaxReadByte",
1807 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1810 { &hf_Wreth_Mail_Equinf_BreakByte
,
1811 { "BreakByte", "wreth.Mail.Equinf.BreakByte",
1812 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1815 { &hf_Wreth_Mail_Equinf_MaxWriteIByte
,
1816 { "MaxWriteIByte", "wreth.Mail.Equinf.MaxWriteIByte",
1817 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1820 { &hf_Wreth_Mail_Equinf_MaxReadIByte
,
1821 { "MaxReadIByte", "wreth.Mail.Equinf.MaxReadIByte",
1822 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1825 { &hf_Wreth_Mail_Equinf_BreakIByte
,
1826 { "BreakIByte", "wreth.Mail.Equinf.BreakIByte",
1827 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1830 { &hf_Wreth_Mail_Equinf_MaxWriteQByte
,
1831 { "MaxWriteQByte", "wreth.Mail.Equinf.MaxWriteQByte",
1832 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1835 { &hf_Wreth_Mail_Equinf_MaxReadQByte
,
1836 { "MaxReadQByte", "wreth.Mail.Equinf.MaxReadQByte",
1837 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1841 { &hf_Wreth_Mail_Equinf_BreakQByte
,
1842 { "BreakQByte", "wreth.Mail.Equinf.BreakQByte",
1843 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1846 { &hf_Wreth_Mail_Equinf_MaxWriteWord
,
1847 { "MaxWriteWord", "wreth.Mail.Equinf.MaxWriteWord",
1848 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1851 { &hf_Wreth_Mail_Equinf_MaxReadWord
,
1852 { "MaxReadWord", "wreth.Mail.Equinf.MaxReadWord",
1853 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1856 { &hf_Wreth_Mail_Equinf_BreakWord
,
1857 { "BreakWord", "wreth.Mail.Equinf.BreakWord",
1858 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1861 { &hf_Wreth_Mail_Equinf_MaxWriteIWord
,
1862 { "MaxWriteIWord", "wreth.Mail.Equinf.MaxWriteIWord",
1863 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1866 { &hf_Wreth_Mail_Equinf_MaxReadIWord
,
1867 { "MaxReadIWord", "wreth.Mail.Equinf.MaxReadIWord",
1868 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1871 { &hf_Wreth_Mail_Equinf_BreakIWord
,
1872 { "BreakIWord", "wreth.Mail.Equinf.BreakIWord",
1873 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1876 { &hf_Wreth_Mail_Equinf_MaxReadQWord
,
1877 { "MaxReadQWord", "wreth.Mail.Equinf.MaxReadQWord",
1878 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1881 { &hf_Wreth_Mail_Equinf_MaxWriteQWord
,
1882 { "MaxWriteQWord", "wreth.Mail.Equinf.MaxWriteQWord",
1883 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1886 { &hf_Wreth_Mail_Equinf_BreakQWord
,
1887 { "BreakQWord", "wreth.Mail.Equinf.BreakQWord",
1888 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1891 { &hf_Wreth_Mail_Equinf_MaxWriteDWord
,
1892 { "MaxWriteDWord", "wreth.Mail.Equinf.MaxWriteDWord",
1893 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1896 { &hf_Wreth_Mail_Equinf_MaxReadDWord
,
1897 { "MaxReadDWord", "wreth.Mail.Equinf.MaxReadDWord",
1898 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1901 { &hf_Wreth_Mail_Equinf_BreakDWord
,
1902 { "BreakDWord", "wreth.Mail.Equinf.BreakDWord",
1903 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1906 { &hf_Wreth_Mail_Equinf_MaxWriteFWord
,
1907 { "MaxWriteFWord", "wreth.Mail.Equinf.MaxWriteFWord",
1908 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1911 { &hf_Wreth_Mail_Equinf_MaxReadFWord
,
1912 { "MaxReadFWord", "wreth.Mail.Equinf.MaxReadFWord",
1913 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1916 { &hf_Wreth_Mail_Equinf_BreakFWord
,
1917 { "BreakFWord", "wreth.Mail.Equinf.BreakFWord",
1918 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1921 { &hf_Wreth_Mail_Equinf_ReadFactorWord
,
1922 { "ReadFactorWord", "wreth.Mail.Equinf.ReadFactorWord",
1923 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1926 { &hf_Wreth_Mail_Equinf_ReadFactorIWord
,
1927 { "ReadFactorIWord", "wreth.Mail.Equinf.ReadFactorIWord",
1928 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1931 { &hf_Wreth_Mail_Equinf_ReadFactorQWord
,
1932 { "ReadFactorQWord", "wreth.Mail.Equinf.ReadFactorQWord",
1933 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1936 { &hf_Wreth_Mail_Equinf_ReadFactorDWord
,
1937 { "ReadFactorDWord", "wreth.Mail.Equinf.ReadFactorDWord",
1938 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1941 { &hf_Wreth_Mail_Equinf_ReadFactorFWord
,
1942 { "ReadFactorFWord", "wreth.Mail.Equinf.ReadFactorFWord",
1943 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1946 { &hf_Wreth_Mail_Equinf_WriteFactorWord
,
1947 { "WriteFactorWord", "wreth.Mail.Equinf.WriteFactorWord",
1948 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1951 { &hf_Wreth_Mail_Equinf_WriteFactorIWord
,
1952 { "WriteFactorIWord", "wreth.Mail.Equinf.WriteFactorIWord",
1953 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1956 { &hf_Wreth_Mail_Equinf_WriteFactorQWord
,
1957 { "WriteFactorQWord", "wreth.Mail.Equinf.WriteFactorQWord",
1958 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1961 { &hf_Wreth_Mail_Equinf_WriteFactorDWord
,
1962 { "WriteFactorDWord", "wreth.Mail.Equinf.WriteFactorDWord",
1963 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1966 { &hf_Wreth_Mail_Equinf_WriteFactorFWord
,
1967 { "WriteFactorFWord", "wreth.Mail.Equinf.WriteFactorFWord",
1968 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1971 { &hf_Wreth_Mail_Equinf_DataFormat
,
1972 { "DataFormat", "wreth.Mail.Equinf.DataFormat",
1973 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1976 { &hf_Wreth_Mail_Equinf_BreakIBit
,
1977 { "BreakIBit", "wreth.Mail.Equinf.BreakIBit",
1978 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1983 static gint
*ett
[] = {
1987 wreth_proto
= proto_register_protocol (
1988 "WSE remote ethernet", /* name */
1989 "WRETH", /* short name */
1990 "wreth" /* abbrev */
1992 proto_register_field_array(wreth_proto
, hf
, array_length(hf
));
1993 proto_register_subtree_array(ett
, array_length(ett
));
1996 void proto_reg_handoff_wreth(void)
1998 dissector_handle_t wreth_handle
;
2000 wreth_handle
= create_dissector_handle(dissect_wreth
, wreth_proto
);
2001 dissector_add_uint("ethertype", WRETH_PORT
, wreth_handle
);
2005 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2010 * indent-tabs-mode: nil
2013 * vi: set shiftwidth=4 tabstop=8 expandtab:
2014 * :indentSize=4:tabSize=8:noTabs=true: