4 * FF-588-1.3: HSE Field Device Access Agent
5 * 6. Field Device Access Agent Interface
7 * (c) Copyright 2008, Yukiyo Akisada <Yukiyo.Akisada@jp.yokogawa.com>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
18 * ---------------------------------------------------------------------
19 * ff-annunc 1089/tcp # FF Annunciation
20 * ff-annunc 1089/udp # FF Annunciation
21 * ff-fms 1090/tcp # FF Fieldbus Message Specification
22 * ff-fms 1090/udp # FF Fieldbus Message Specification
23 * ff-sm 1091/tcp # FF System Management
24 * ff-sm 1091/udp # FF System Management
25 * ff-lr-port 3622/tcp # FF LAN Redundancy Port
26 * ff-lr-port 3622/udp # FF LAN Redundancy Port
27 * ---------------------------------------------------------------------
30 #ifndef __PACKET_FF_H__
31 #define __PACKET_FF_H__
33 #define UDP_PORT_FF_RANGE "1089-1091,3622"
34 #define TCP_PORT_FF_ANNUNC 1089
36 #define TCP_PORT_FF_FMS 1090
38 #define TCP_PORT_FF_SM 1091
40 #define TCP_PORT_FF_LR_PORT 3622
52 #define OPTION_MESSAGE_NUMBER_MASK 0x80 /* 10000000 */
53 #define OPTION_INVOKE_ID_MASK 0x40 /* 01000000 */
54 #define OPTION_TIME_STAMP_MASK 0x20 /* 00100000 */
55 #define OPTION_RESERVED_MASK 0x10 /* 00010000 */
56 #define OPTION_EXTENDED_CNTRL_MASK 0x08 /* 00001000 */
57 #define OPTION_PAD_LENGTH_MASK 0x07 /* 00000111 */
59 #define OPTION_PAD_4BYTE 0x03 /* 00000011 */
60 #define OPTION_PAD_8BYTE 0x07 /* 00000111 */
63 * Protocol Id And Confirmed Msg Type
66 #define PROTOCOL_MASK 0xfc /* 11111100 */
67 #define TYPE_MASK 0x03 /* 00000011 */
72 #define PROTOCOL_FDA 0x04 /* 00000100 */
73 #define PROTOCOL_SM 0x08 /* 00001000 */
74 #define PROTOCOL_FMS 0x0c /* 00001100 */
75 #define PROTOCOL_LAN 0x10 /* 00010000 */
80 #define TYPE_REQUEST 0x00 /* 00000000 */
81 #define TYPE_RESPONSE 0x01 /* 00000001 */
82 #define TYPE_ERROR 0x02 /* 00000010 */
88 #define SERVICE_CONFIRMED_FLAG_MASK 0x80 /* 10000000 */
89 #define SERVICE_SERVICE_ID_MASK 0x7f /* 01111111 */
91 #define FDA_UNCONFIRMED_SERVICE 0x00 /* 00000000 */
92 #define FDA_CONFIRMED_SERVICE 0x80 /* 10000000 */
96 #define PROTOCOL_FDA_MSG (PROTOCOL_FDA << 8)
97 #define PROTOCOL_SM_MSG (PROTOCOL_SM << 8)
98 #define PROTOCOL_FMS_MSG (PROTOCOL_FMS << 8)
99 #define PROTOCOL_LAN_MSG (PROTOCOL_LAN << 8)
103 #define PROTOCOL_TYPE_REQ (TYPE_REQUEST << 8)
104 #define PROTOCOL_TYPE_RSP (TYPE_RESPONSE << 8)
105 #define PROTOCOL_TYPE_ERR (TYPE_ERROR << 8)
110 * 6.5.1. FDA Session Management Services
113 /* Confirmed Service Id */
114 #define FDA_OPEN_SESSION 1
117 /* 6.5.1.1. FDA Open Session (Confirmed Service Id = 1) */
118 #define FDA_MSG_SESSION_OPEN_REQ \
119 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_REQ | \
120 FDA_CONFIRMED_SERVICE | FDA_OPEN_SESSION)
121 #define FDA_MSG_SESSION_OPEN_RSP \
122 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_RSP | \
123 FDA_CONFIRMED_SERVICE | FDA_OPEN_SESSION)
124 #define FDA_MSG_SESSION_OPEN_ERR \
125 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_ERR | \
126 FDA_CONFIRMED_SERVICE | FDA_OPEN_SESSION)
128 /* 6.5.1.2. FDA Idle (Confirmed Service Id = 3) */
129 #define FDA_MSG_SESSION_IDLE_REQ \
130 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_REQ | \
131 FDA_CONFIRMED_SERVICE | FDA_IDLE)
132 #define FDA_MSG_SESSION_IDLE_RSP \
133 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_RSP | \
134 FDA_CONFIRMED_SERVICE | FDA_IDLE)
135 #define FDA_MSG_SESSION_IDLE_ERR \
136 (PROTOCOL_FDA_MSG | PROTOCOL_TYPE_ERR | \
137 FDA_CONFIRMED_SERVICE | FDA_IDLE)
145 /* Unconfirmed Service Id */
146 #define HSE_SM_FIND_TAG_QUERY 1
147 #define HSE_SM_FIND_TAG_REPLY 2
148 #define HSE_SM_DEVICE_ANNUNCIATION 16
150 /* Confirmed Service Id */
151 #define HSE_SM_IDENTIFY 3
152 #define HSE_SM_CLEAR_ADDRESS 12
153 #define HSE_SM_SET_ASSIGNMENT 14
154 #define HSE_SM_CLEAR_ASSIGNMENT 15
156 /* 6.5.2.1. SM Find Tag Query (Unconfirmed Service Id = 1) */
157 #define SM_MSG_FIND_TAG_QUERY_REQ \
158 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
159 FDA_UNCONFIRMED_SERVICE | HSE_SM_FIND_TAG_QUERY)
161 /* 6.5.2.2. SM Find Tag Reply (Unconfirmed Service Id = 2) */
162 #define SM_MSG_FIND_TAG_REPLY_REQ \
163 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
164 FDA_UNCONFIRMED_SERVICE | HSE_SM_FIND_TAG_REPLY)
166 /* 6.5.2.3. SM Identify (Confirmed Service Id = 3) */
167 #define SM_MSG_IDENTIFY_REQ \
168 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
169 FDA_CONFIRMED_SERVICE | HSE_SM_IDENTIFY)
170 #define SM_MSG_IDENTIFY_RSP \
171 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_RSP | \
172 FDA_CONFIRMED_SERVICE | HSE_SM_IDENTIFY)
173 #define SM_MSG_IDENTIFY_ERR \
174 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_ERR | \
175 FDA_CONFIRMED_SERVICE | HSE_SM_IDENTIFY)
177 /* 6.5.2.4. SM Clear Address (Confirmed Service Id = 12) */
178 #define SM_MSG_CLEAR_ADDRESS_REQ \
179 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
180 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ADDRESS)
181 #define SM_MSG_CLEAR_ADDRESS_RSP \
182 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_RSP | \
183 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ADDRESS)
184 #define SM_MSG_CLEAR_ADDRESS_ERR \
185 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_ERR | \
186 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ADDRESS)
188 /* 6.5.2.5. SM Set Assignment Info (Confirmed Service Id = 14) */
189 #define SM_MSG_SET_ASSIGNMENT_REQ \
190 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
191 FDA_CONFIRMED_SERVICE | HSE_SM_SET_ASSIGNMENT)
192 #define SM_MSG_SET_ASSIGNMENT_RSP \
193 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_RSP | \
194 FDA_CONFIRMED_SERVICE | HSE_SM_SET_ASSIGNMENT)
195 #define SM_MSG_SET_ASSIGNMENT_ERR \
196 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_ERR | \
197 FDA_CONFIRMED_SERVICE | HSE_SM_SET_ASSIGNMENT)
199 /* 6.5.2.6. SM Clear Assignment Info (Confirmed Service Id = 15) */
200 #define SM_MSG_CLEAR_ASSIGNMENT_REQ \
201 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
202 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ASSIGNMENT)
203 #define SM_MSG_CLEAR_ASSIGNMENT_RSP \
204 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_RSP | \
205 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ASSIGNMENT)
206 #define SM_MSG_CLEAR_ASSIGNMENT_ERR \
207 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_ERR | \
208 FDA_CONFIRMED_SERVICE | HSE_SM_CLEAR_ASSIGNMENT)
210 /* 6.5.2.7. SM Device Annunciation (Unconfirmed Service Id = 16) */
211 #define SM_MSG_DEVICE_ANNUNCIATION_REQ \
212 (PROTOCOL_SM_MSG | PROTOCOL_TYPE_REQ | \
213 FDA_UNCONFIRMED_SERVICE | HSE_SM_DEVICE_ANNUNCIATION)
218 * 6.5.3. FMS Services
221 /* Unconfirmed Service Id */
222 #define HSE_FMS_INFORMATION_REPORT 0
223 #define HSE_FMS_UNSOLICITED_STATUS 1
224 #define HSE_FMS_EVENT_NOTIFICATION 2
225 #define HSE_FMS_INFORMATION_REPORT_WITH_SUBINDEX 16
226 #define HSE_FMS_INFORMATION_REPORT_ON_CHANGE 17
227 #define HSE_FMS_INFORMATION_REPORT_ON_CHANGE_WITH_SUBINDEX 18
228 #define HSE_FMS_ABORT 112
230 /* Confirmed Service Id */
231 #define HSE_FMS_STATUS 0
232 #define HSE_FMS_IDENTIFY 1
233 #define HSE_FMS_READ 2
234 #define HSE_FMS_WRITE 3
235 #define HSE_FMS_GET_OD 4
236 #define HSE_FMS_DEFINE_VARIABLE_LIST 7
237 #define HSE_FMS_DELETE_VARIABLE_LIST 8
238 #define HSE_FMS_INITIATE_DOWNLOAD_SEQUENCE 9
239 #define HSE_FMS_DOWNLOAD_SEGMENT 10
240 #define HSE_FMS_TERMINATE_DOWNLOAD_SEQUENCE 11
241 #define HSE_FMS_INITIATE_UPLOAD_SEQUENCE 12
242 #define HSE_FMS_UPLOAD_SEGMENT 13
243 #define HSE_FMS_TERMINATE_UPLOAD_SEQUENCE 14
244 #define HSE_FMS_REQUEST_DOMAIN_DOWNLOAD 15
245 #define HSE_FMS_REQUEST_DOMAIN_UPLOAD 16
246 #define HSE_FMS_CREATE_PROGRAM_INVOCATION 17
247 #define HSE_FMS_DELETE_PROGRAM_INVOCATION 18
248 #define HSE_FMS_START 19
249 #define HSE_FMS_STOP 20
250 #define HSE_FMS_RESUME 21
251 #define HSE_FMS_RESET 22
252 #define HSE_FMS_KILL 23
253 #define HSE_FMS_ALTER_EVENT_CONDITION_MONITORING 24
254 #define HSE_FMS_ACKNOWLEDGE_EVENT_NOTIFICATION 25
255 #define HSE_FMS_INITIATE_PUT_OD 28
256 #define HSE_FMS_PUT_OD 29
257 #define HSE_FMS_TERMINATE_PUT_OD 30
258 #define HSE_FMS_GENERIC_INITIATE_DOWNLOAD_SEQUENCE 31
259 #define HSE_FMS_GENERIC_DOWNLOAD_SEGMENT 32
260 #define HSE_FMS_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE 33
261 #define HSE_FMS_READ_WITH_SUBINDEX 82
262 #define HSE_FMS_WRITE_WITH_SUBINDEX 83
263 #define HSE_FMS_INITIATE 96
265 /* 6.5.3.1. FMS Reject */
267 /* 6.5.3.2. FMS Initiate (Confirmed Service Id = 96) */
268 #define FMS_MSG_INITIATE_REQ \
269 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
270 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE)
271 #define FMS_MSG_INITIATE_RSP \
272 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
273 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE)
274 #define FMS_MSG_INITIATE_ERR \
275 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
276 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE)
278 /* 6.5.3.3. FMS Abort (Unconfirmed Service Id = 112) */
279 #define FMS_MSG_ABORT_REQ \
280 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
281 FDA_UNCONFIRMED_SERVICE | HSE_FMS_ABORT)
283 /* 6.5.3.4. FMS Status (Confirmed Service Id = 0) */
284 #define FMS_MSG_STATUS_REQ \
285 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
286 FDA_CONFIRMED_SERVICE | HSE_FMS_STATUS)
287 #define FMS_MSG_STATUS_RSP \
288 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
289 FDA_CONFIRMED_SERVICE | HSE_FMS_STATUS)
290 #define FMS_MSG_STATUS_ERR \
291 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
292 FDA_CONFIRMED_SERVICE | HSE_FMS_STATUS)
294 /* 6.5.3.5. FMS Unsolicited Status (Unconfirmed Service Id = 1) */
295 #define FMS_MSG_UNSOLICITED_STATUS_REQ \
296 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
297 FDA_UNCONFIRMED_SERVICE | HSE_FMS_UNSOLICITED_STATUS)
299 /* 6.5.3.6. FMS Identify (Confirmed Service Id = 1) */
300 #define FMS_MSG_IDENTIFY_REQ \
301 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
302 FDA_CONFIRMED_SERVICE | HSE_FMS_IDENTIFY)
303 #define FMS_MSG_IDENTIFY_RSP \
304 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
305 FDA_CONFIRMED_SERVICE | HSE_FMS_IDENTIFY)
306 #define FMS_MSG_IDENTIFY_ERR \
307 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
308 FDA_CONFIRMED_SERVICE | HSE_FMS_IDENTIFY)
310 /* 6.5.3.7. FMS Get OD (Confirmed Service Id = 4) */
311 #define FMS_MSG_GET_OD_REQ \
312 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
313 FDA_CONFIRMED_SERVICE | HSE_FMS_GET_OD)
314 #define FMS_MSG_GET_OD_RSP \
315 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
316 FDA_CONFIRMED_SERVICE | HSE_FMS_GET_OD)
317 #define FMS_MSG_GET_OD_ERR \
318 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
319 FDA_CONFIRMED_SERVICE | HSE_FMS_GET_OD)
321 /* 6.5.3.8. FMS Initiate Put OD (Confirmed Service Id = 28) */
322 #define FMS_MSG_INITIATE_PUT_OD_REQ \
323 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
324 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_PUT_OD)
325 #define FMS_MSG_INITIATE_PUT_OD_RSP \
326 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
327 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_PUT_OD)
328 #define FMS_MSG_INITIATE_PUT_OD_ERR \
329 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
330 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_PUT_OD)
332 /* 6.5.3.9. FMS Put OD (Confirmed Service Id = 29) */
333 #define FMS_MSG_PUT_OD_REQ \
334 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
335 FDA_CONFIRMED_SERVICE | HSE_FMS_PUT_OD)
336 #define FMS_MSG_PUT_OD_RSP \
337 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
338 FDA_CONFIRMED_SERVICE | HSE_FMS_PUT_OD)
339 #define FMS_MSG_PUT_OD_ERR \
340 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
341 FDA_CONFIRMED_SERVICE | HSE_FMS_PUT_OD)
343 /* 6.5.3.10. FMS Terminate Put OD (Confirmed Service Id = 30) */
344 #define FMS_MSG_TERMINATE_PUT_OD_REQ \
345 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
346 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_PUT_OD)
347 #define FMS_MSG_TERMINATE_PUT_OD_RSP \
348 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
349 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_PUT_OD)
350 #define FMS_MSG_TERMINATE_PUT_OD_ERR \
351 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
352 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_PUT_OD)
354 /* 6.5.3.11. FMS Generic Initiate Download Sequence
355 (Confirmed Service Id = 31) */
356 #define FMS_MSG_GENERIC_INITIATE_DOWNLOAD_SEQUENCE_REQ \
357 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
358 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_INITIATE_DOWNLOAD_SEQUENCE)
359 #define FMS_MSG_GENERIC_INITIATE_DOWNLOAD_SEQUENCE_RSP \
360 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
361 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_INITIATE_DOWNLOAD_SEQUENCE)
362 #define FMS_MSG_GENERIC_INITIATE_DOWNLOAD_SEQUENCE_ERR \
363 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
364 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_INITIATE_DOWNLOAD_SEQUENCE)
366 /* 6.5.3.12. FMS Generic Download Segment (Confirmed Service Id = 32) */
367 #define FMS_MSG_GENERIC_DOWNLOAD_SEGMENT_REQ \
368 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
369 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_DOWNLOAD_SEGMENT)
370 #define FMS_MSG_GENERIC_DOWNLOAD_SEGMENT_RSP \
371 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
372 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_DOWNLOAD_SEGMENT)
373 #define FMS_MSG_GENERIC_DOWNLOAD_SEGMENT_ERR \
374 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
375 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_DOWNLOAD_SEGMENT)
377 /* 6.5.3.13. FMS Generic Terminate Download Sequence
378 (Confirmed Service Id = 33) */
379 #define FMS_MSG_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE_REQ \
380 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
381 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE)
382 #define FMS_MSG_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE_RSP \
383 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
384 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE)
385 #define FMS_MSG_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE_ERR \
386 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
387 FDA_CONFIRMED_SERVICE | HSE_FMS_GENERIC_TERMINATE_DOWNLOAD_SEQUENCE)
389 /* 6.5.3.14. FMS Initiate Download Sequence (Confirmed Service Id = 9) */
390 #define FMS_MSG_INITIATE_DOWNLOAD_SEQUENCE_REQ \
391 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
392 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_DOWNLOAD_SEQUENCE)
393 #define FMS_MSG_INITIATE_DOWNLOAD_SEQUENCE_RSP \
394 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
395 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_DOWNLOAD_SEQUENCE)
396 #define FMS_MSG_INITIATE_DOWNLOAD_SEQUENCE_ERR \
397 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
398 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_DOWNLOAD_SEQUENCE)
400 /* 6.5.3.15. FMS Download Segment (Confirmed Service Id = 10) */
401 #define FMS_MSG_DOWNLOAD_SEGMENT_REQ \
402 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
403 FDA_CONFIRMED_SERVICE | HSE_FMS_DOWNLOAD_SEGMENT)
404 #define FMS_MSG_DOWNLOAD_SEGMENT_RSP \
405 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
406 FDA_CONFIRMED_SERVICE | HSE_FMS_DOWNLOAD_SEGMENT)
407 #define FMS_MSG_DOWNLOAD_SEGMENT_ERR \
408 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
409 FDA_CONFIRMED_SERVICE | HSE_FMS_DOWNLOAD_SEGMENT)
411 /* 6.5.3.16. FMS Terminate Download Sequence (Confirmed Service Id = 11) */
412 #define FMS_MSG_TERMINATE_DOWNLOAD_SEQUENCE_REQ \
413 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
414 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_DOWNLOAD_SEQUENCE)
415 #define FMS_MSG_TERMINATE_DOWNLOAD_SEQUENCE_RSP \
416 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
417 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_DOWNLOAD_SEQUENCE)
418 #define FMS_MSG_TERMINATE_DOWNLOAD_SEQUENCE_ERR \
419 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
420 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_DOWNLOAD_SEQUENCE)
422 /* 6.5.3.17. FMS Initiate Upload Sequence (Confirmed Service Id = 12) */
423 #define FMS_MSG_INITIATE_UPLOAD_SEQUENCE_REQ \
424 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
425 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_UPLOAD_SEQUENCE)
426 #define FMS_MSG_INITIATE_UPLOAD_SEQUENCE_RSP \
427 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
428 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_UPLOAD_SEQUENCE)
429 #define FMS_MSG_INITIATE_UPLOAD_SEQUENCE_ERR \
430 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
431 FDA_CONFIRMED_SERVICE | HSE_FMS_INITIATE_UPLOAD_SEQUENCE)
433 /* 6.5.3.18. FMS Upload Segment (Confirmed Service Id = 13) */
434 #define FMS_MSG_UPLOAD_SEGMENT_REQ \
435 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
436 FDA_CONFIRMED_SERVICE | HSE_FMS_UPLOAD_SEGMENT)
437 #define FMS_MSG_UPLOAD_SEGMENT_RSP \
438 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
439 FDA_CONFIRMED_SERVICE | HSE_FMS_UPLOAD_SEGMENT)
440 #define FMS_MSG_UPLOAD_SEGMENT_ERR \
441 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
442 FDA_CONFIRMED_SERVICE | HSE_FMS_UPLOAD_SEGMENT)
444 /* 6.5.3.19. FMS Terminate Upload Sequence (Confirmed Service Id = 14) */
445 #define FMS_MSG_TERMINATE_UPLOAD_SEQUENCE_REQ \
446 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
447 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_UPLOAD_SEQUENCE)
448 #define FMS_MSG_TERMINATE_UPLOAD_SEQUENCE_RSP \
449 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
450 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_UPLOAD_SEQUENCE)
451 #define FMS_MSG_TERMINATE_UPLOAD_SEQUENCE_ERR \
452 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
453 FDA_CONFIRMED_SERVICE | HSE_FMS_TERMINATE_UPLOAD_SEQUENCE)
455 /* 6.5.3.20. FMS Request Domain Download (Confirmed Service Id = 15) */
456 #define FMS_MSG_REQUEST_DOMAIN_DOWNLOAD_REQ \
457 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
458 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_DOWNLOAD)
459 #define FMS_MSG_REQUEST_DOMAIN_DOWNLOAD_RSP \
460 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
461 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_DOWNLOAD)
462 #define FMS_MSG_REQUEST_DOMAIN_DOWNLOAD_ERR \
463 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
464 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_DOWNLOAD)
466 /* 6.5.3.21. FMS Request Domain Upload (Confirmed Service Id = 16) */
467 #define FMS_MSG_REQUEST_DOMAIN_UPLOAD_REQ \
468 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
469 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_UPLOAD)
470 #define FMS_MSG_REQUEST_DOMAIN_UPLOAD_RSP \
471 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
472 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_UPLOAD)
473 #define FMS_MSG_REQUEST_DOMAIN_UPLOAD_ERR \
474 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
475 FDA_CONFIRMED_SERVICE | HSE_FMS_REQUEST_DOMAIN_UPLOAD)
477 /* 6.5.3.22. FMS Create Program Invocation (Confirmed Service Id = 17) */
478 #define FMS_MSG_CREATE_PI_REQ \
479 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
480 FDA_CONFIRMED_SERVICE | HSE_FMS_CREATE_PROGRAM_INVOCATION)
481 #define FMS_MSG_CREATE_PI_RSP \
482 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
483 FDA_CONFIRMED_SERVICE | HSE_FMS_CREATE_PROGRAM_INVOCATION)
484 #define FMS_MSG_CREATE_PI_ERR \
485 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
486 FDA_CONFIRMED_SERVICE | HSE_FMS_CREATE_PROGRAM_INVOCATION)
488 /* 6.5.3.23. FMS Delete Program Invocation (Confirmed Service Id = 18) */
489 #define FMS_MSG_DELETE_PI_REQ \
490 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
491 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_PROGRAM_INVOCATION)
492 #define FMS_MSG_DELETE_PI_RSP \
493 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
494 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_PROGRAM_INVOCATION)
495 #define FMS_MSG_DELETE_PI_ERR \
496 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
497 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_PROGRAM_INVOCATION)
499 /* 6.5.3.24. FMS Start (Confirmed Service Id = 19) */
500 #define FMS_MSG_START_PI_REQ \
501 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
502 FDA_CONFIRMED_SERVICE | HSE_FMS_START)
503 #define FMS_MSG_START_PI_RSP \
504 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
505 FDA_CONFIRMED_SERVICE | HSE_FMS_START)
506 #define FMS_MSG_START_PI_ERR \
507 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
508 FDA_CONFIRMED_SERVICE | HSE_FMS_START)
510 /* 6.5.3.25. FMS Stop (Confirmed Service Id = 20) */
511 #define FMS_MSG_STOP_PI_REQ \
512 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
513 FDA_CONFIRMED_SERVICE | HSE_FMS_STOP)
514 #define FMS_MSG_STOP_PI_RSP \
515 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
516 FDA_CONFIRMED_SERVICE | HSE_FMS_STOP)
517 #define FMS_MSG_STOP_PI_ERR \
518 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
519 FDA_CONFIRMED_SERVICE | HSE_FMS_STOP)
521 /* 6.5.3.26. FMS Resume (Confirmed Service Id = 21) */
522 #define FMS_MSG_RESUME_PI_REQ \
523 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
524 FDA_CONFIRMED_SERVICE | HSE_FMS_RESUME)
525 #define FMS_MSG_RESUME_PI_RSP \
526 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
527 FDA_CONFIRMED_SERVICE | HSE_FMS_RESUME)
528 #define FMS_MSG_RESUME_PI_ERR \
529 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
530 FDA_CONFIRMED_SERVICE | HSE_FMS_RESUME)
532 /* 6.5.3.27. FMS Reset (Confirmed Service Id = 22) */
533 #define FMS_MSG_RESET_PI_REQ \
534 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
535 FDA_CONFIRMED_SERVICE | HSE_FMS_RESET)
536 #define FMS_MSG_RESET_PI_RSP \
537 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
538 FDA_CONFIRMED_SERVICE | HSE_FMS_RESET)
539 #define FMS_MSG_RESET_PI_ERR \
540 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
541 FDA_CONFIRMED_SERVICE | HSE_FMS_RESET)
543 /* 6.5.3.28. FMS Kill (Confirmed Service Id = 23) */
544 #define FMS_MSG_KILL_PI_REQ \
545 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
546 FDA_CONFIRMED_SERVICE | HSE_FMS_KILL)
547 #define FMS_MSG_KILL_PI_RSP \
548 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
549 FDA_CONFIRMED_SERVICE | HSE_FMS_KILL)
550 #define FMS_MSG_KILL_PI_ERR \
551 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
552 FDA_CONFIRMED_SERVICE | HSE_FMS_KILL)
554 /* 6.5.3.29. FMS Read (Confirmed Service Id = 2) */
555 #define FMS_MSG_READ_REQ \
556 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
557 FDA_CONFIRMED_SERVICE | HSE_FMS_READ)
558 #define FMS_MSG_READ_RSP \
559 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
560 FDA_CONFIRMED_SERVICE | HSE_FMS_READ)
561 #define FMS_MSG_READ_ERR \
562 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
563 FDA_CONFIRMED_SERVICE | HSE_FMS_READ)
565 /* 6.5.3.30. FMS Read with Subindex (Confirmed Service Id = 82) */
566 #define FMS_MSG_READ_SUBINDEX_REQ \
567 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
568 FDA_CONFIRMED_SERVICE | HSE_FMS_READ_WITH_SUBINDEX)
569 #define FMS_MSG_READ_SUBINDEX_RSP \
570 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
571 FDA_CONFIRMED_SERVICE | HSE_FMS_READ_WITH_SUBINDEX)
572 #define FMS_MSG_READ_SUBINDEX_ERR \
573 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
574 FDA_CONFIRMED_SERVICE | HSE_FMS_READ_WITH_SUBINDEX)
576 /* 6.5.3.31. FMS Write (Confirmed Service Id = 3) */
577 #define FMS_MSG_WRITE_REQ \
578 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
579 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE)
580 #define FMS_MSG_WRITE_RSP \
581 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
582 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE)
583 #define FMS_MSG_WRITE_ERR \
584 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
585 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE)
587 /* 6.5.3.32. FMS Write with Subindex (Confirmed Service Id = 83) */
588 #define FMS_MSG_WRITE_SUBINDEX_REQ \
589 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
590 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE_WITH_SUBINDEX)
591 #define FMS_MSG_WRITE_SUBINDEX_RSP \
592 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
593 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE_WITH_SUBINDEX)
594 #define FMS_MSG_WRITE_SUBINDEX_ERR \
595 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
596 FDA_CONFIRMED_SERVICE | HSE_FMS_WRITE_WITH_SUBINDEX)
598 /* 6.5.3.33. FMS Define Variable List (Confirmed Service Id = 7) */
599 #define FMS_MSG_DEFINE_VARIABLE_LIST_REQ \
600 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
601 FDA_CONFIRMED_SERVICE | HSE_FMS_DEFINE_VARIABLE_LIST)
602 #define FMS_MSG_DEFINE_VARIABLE_LIST_RSP \
603 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
604 FDA_CONFIRMED_SERVICE | HSE_FMS_DEFINE_VARIABLE_LIST)
605 #define FMS_MSG_DEFINE_VARIABLE_LIST_ERR \
606 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
607 FDA_CONFIRMED_SERVICE | HSE_FMS_DEFINE_VARIABLE_LIST)
609 /* 6.5.3.34. FMS Delete Variable List (Confirmed Service Id = 8) */
610 #define FMS_MSG_DELETE_VARIABLE_LIST_REQ \
611 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
612 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_VARIABLE_LIST)
613 #define FMS_MSG_DELETE_VARIABLE_LIST_RSP \
614 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
615 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_VARIABLE_LIST)
616 #define FMS_MSG_DELETE_VARIABLE_LIST_ERR \
617 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
618 FDA_CONFIRMED_SERVICE | HSE_FMS_DELETE_VARIABLE_LIST)
620 /* 6.5.3.35. FMS Information Report (Unconfirmed Service Id = 0) */
621 #define FMS_MSG_INFO_REPORT_REQ \
622 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
623 FDA_UNCONFIRMED_SERVICE | HSE_FMS_INFORMATION_REPORT)
625 /* 6.5.3.36. FMS Information Report with Subindex
626 (Unconfirmed Service Id = 16) */
627 #define FMS_MSG_INFO_REPORT_SUBINDEX_REQ \
628 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
629 FDA_UNCONFIRMED_SERVICE | HSE_FMS_INFORMATION_REPORT_WITH_SUBINDEX)
631 /* 6.5.3.37. FMS Information Report On Change (Unconfirmed Service Id = 17) */
632 #define FMS_MSG_INFO_REPORT_CHANGE_REQ \
633 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
634 FDA_UNCONFIRMED_SERVICE | HSE_FMS_INFORMATION_REPORT_ON_CHANGE)
636 /* 6.5.3.38. FMS Information Report On Change with Subindex
637 (Unconfirmed Service Id = 18) */
638 #define FMS_MSG_INFO_REPORT_CHANGE_SUBINDEX_REQ \
639 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | FDA_UNCONFIRMED_SERVICE | \
640 HSE_FMS_INFORMATION_REPORT_ON_CHANGE_WITH_SUBINDEX)
642 /* 6.5.3.39. FMS Event Notification (Unconfirmed Service Id = 2) */
643 #define FMS_MSG_EVENT_NOTIFICATION_REQ \
644 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
645 FDA_UNCONFIRMED_SERVICE | HSE_FMS_EVENT_NOTIFICATION)
647 /* 6.5.3.40. FMS Alter Event Condition Monitoring (Confirmed Service Id = 24) */
648 #define FMS_MSG_ALTER_EVENT_CONDITION_MONITORING_REQ \
649 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
650 FDA_CONFIRMED_SERVICE | HSE_FMS_ALTER_EVENT_CONDITION_MONITORING)
651 #define FMS_MSG_ALTER_EVENT_CONDITION_MONITORING_RSP \
652 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
653 FDA_CONFIRMED_SERVICE | HSE_FMS_ALTER_EVENT_CONDITION_MONITORING)
654 #define FMS_MSG_ALTER_EVENT_CONDITION_MONITORING_ERR \
655 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
656 FDA_CONFIRMED_SERVICE | HSE_FMS_ALTER_EVENT_CONDITION_MONITORING)
658 /* 6.5.3.41. FMS Acknowledge Event Notification (Confirmed Service Id = 25) */
659 #define FMS_MSG_ACKNOWLEDGE_EVENT_NOTIFICATION_REQ \
660 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_REQ | \
661 FDA_CONFIRMED_SERVICE | HSE_FMS_ACKNOWLEDGE_EVENT_NOTIFICATION)
662 #define FMS_MSG_ACKNOWLEDGE_EVENT_NOTIFICATION_RSP \
663 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_RSP | \
664 FDA_CONFIRMED_SERVICE | HSE_FMS_ACKNOWLEDGE_EVENT_NOTIFICATION)
665 #define FMS_MSG_ACKNOWLEDGE_EVENT_NOTIFICATION_ERR \
666 (PROTOCOL_FMS_MSG | PROTOCOL_TYPE_ERR | \
667 FDA_CONFIRMED_SERVICE | HSE_FMS_ACKNOWLEDGE_EVENT_NOTIFICATION)
672 * 6.5.4 LAN Redundancy Services
675 /* Unconfirmed Service Id */
678 /* Confirmed Service Id */
679 #define LAN_GET_INFO 1
680 #define LAN_PUT_INFO 2
681 #define LAN_GET_STATISTICS 3
683 /* 6.5.4.1. LAN Redundancy Get Information (Confirmed Service Id = 1) */
684 #define LAN_MSG_GET_INFO_REQ \
685 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_REQ | \
686 FDA_CONFIRMED_SERVICE | LAN_GET_INFO)
687 #define LAN_MSG_GET_INFO_RSP \
688 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_RSP | \
689 FDA_CONFIRMED_SERVICE | LAN_GET_INFO)
690 #define LAN_MSG_GET_INFO_ERR \
691 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_ERR | \
692 FDA_CONFIRMED_SERVICE | LAN_GET_INFO)
694 /* 6.5.4.2. LAN Redundancy Put Information (Confirmed Service Id = 2) */
695 #define LAN_MSG_PUT_INFO_REQ \
696 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_REQ | \
697 FDA_CONFIRMED_SERVICE | LAN_PUT_INFO)
698 #define LAN_MSG_PUT_INFO_RSP \
699 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_RSP | \
700 FDA_CONFIRMED_SERVICE | LAN_PUT_INFO)
701 #define LAN_MSG_PUT_INFO_ERR \
702 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_ERR | \
703 FDA_CONFIRMED_SERVICE | LAN_PUT_INFO)
705 /* 6.5.4.3. LAN Redundancy Get Statistics (Confirmed Service Id = 3) */
706 #define LAN_MSG_GET_STATISTICS_REQ \
707 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_REQ | \
708 FDA_CONFIRMED_SERVICE | LAN_GET_STATISTICS)
709 #define LAN_MSG_GET_STATISTICS_RSP \
710 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_RSP | \
711 FDA_CONFIRMED_SERVICE | LAN_GET_STATISTICS)
712 #define LAN_MSG_GET_STATISTICS_ERR \
713 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_ERR | \
714 FDA_CONFIRMED_SERVICE | LAN_GET_STATISTICS)
716 /* 6.5.4.4. Diagnostic Message (Unconfirmed Service Id = 1) */
717 #define LAN_MSG_DIAG_REQ \
718 (PROTOCOL_LAN_MSG | PROTOCOL_TYPE_REQ | \
719 FDA_UNCONFIRMED_SERVICE | LAN_DIAG)
720 #endif /* __PACKET_FF_H__ */