/src/wireshark/epan/dissectors/packet-uds.c
Line | Count | Source |
1 | | /* packet-uds.c |
2 | | * Routines for uds protocol packet disassembly |
3 | | * |
4 | | * Wireshark - Network traffic analyzer |
5 | | * By Gerald Combs <gerald@wireshark.org> |
6 | | * Copyright 1998 Gerald Combs |
7 | | * |
8 | | * SPDX-License-Identifier: GPL-2.0-or-later |
9 | | */ |
10 | | |
11 | | #include "config.h" |
12 | | |
13 | | #include <epan/packet.h> |
14 | | #include <epan/expert.h> |
15 | | #include <epan/uat.h> |
16 | | #include <epan/unit_strings.h> |
17 | | |
18 | | #include <wsutil/array.h> |
19 | | #include "packet-uds.h" |
20 | | #include "packet-doip.h" |
21 | | #include "packet-hsfz.h" |
22 | | #include "packet-iso10681.h" |
23 | | #include "packet-iso15765.h" |
24 | | #include "packet-ber.h" |
25 | | #include "packet-x509af.h" |
26 | | #include <wsutil/utf8_entities.h> |
27 | | |
28 | | void proto_register_uds(void); |
29 | | void proto_reg_handoff_uds(void); |
30 | | |
31 | 15 | #define DATAFILE_UDS_ROUTINE_IDS "UDS_routine_identifiers" |
32 | 15 | #define DATAFILE_UDS_DATA_IDS "UDS_data_identifiers" |
33 | 15 | #define DATAFILE_UDS_DTC_IDS "UDS_dtc_identifiers" |
34 | 15 | #define DATAFILE_UDS_ADDRESSES "UDS_diagnostic_addresses" |
35 | | |
36 | | #define UDS_RESPONSE_CODES_GR 0x10 |
37 | | #define UDS_RESPONSE_CODES_SNS 0x11 |
38 | | #define UDS_RESPONSE_CODES_SFNS 0x12 |
39 | | #define UDS_RESPONSE_CODES_IMLOIF 0x13 |
40 | | #define UDS_RESPONSE_CODES_RTL 0x14 |
41 | | #define UDS_RESPONSE_CODES_BRR 0x21 |
42 | | #define UDS_RESPONSE_CODES_CNC 0x22 |
43 | | #define UDS_RESPONSE_CODES_RSE 0x24 |
44 | | #define UDS_RESPONSE_CODES_NRFSC 0x25 |
45 | | #define UDS_RESPONSE_CODES_FPEORA 0x26 |
46 | | #define UDS_RESPONSE_CODES_ROOR 0x31 |
47 | | #define UDS_RESPONSE_CODES_SAD 0x33 |
48 | | #define UDS_RESPONSE_CODES_AR 0x34 |
49 | | #define UDS_RESPONSE_CODES_IK 0x35 |
50 | | #define UDS_RESPONSE_CODES_ENOA 0x36 |
51 | | #define UDS_RESPONSE_CODES_RTDNE 0x37 |
52 | | #define UDS_RESPONSE_CODES_SDTR 0x38 |
53 | | #define UDS_RESPONSE_CODES_SDTNA 0x39 |
54 | | #define UDS_RESPONSE_CODES_SDTF 0x3A |
55 | | #define UDS_RESPONSE_CODES_CVFITP 0x50 |
56 | | #define UDS_RESPONSE_CODES_CVFIS 0x51 |
57 | | #define UDS_RESPONSE_CODES_CVFICOT 0x52 |
58 | | #define UDS_RESPONSE_CODES_CVFIT 0x53 |
59 | | #define UDS_RESPONSE_CODES_CVFIF 0x54 |
60 | | #define UDS_RESPONSE_CODES_CVFIC 0x55 |
61 | | #define UDS_RESPONSE_CODES_CVFISD 0x56 |
62 | | #define UDS_RESPONSE_CODES_CVFICR 0x57 |
63 | | #define UDS_RESPONSE_CODES_OVF 0x58 |
64 | | #define UDS_RESPONSE_CODES_CCF 0x59 |
65 | | #define UDS_RESPONSE_CODES_SARF 0x5A |
66 | | #define UDS_RESPONSE_CODES_SKCDF 0x5B |
67 | | #define UDS_RESPONSE_CODES_CDUF 0x5C |
68 | | #define UDS_RESPONSE_CODES_DAF 0x5D |
69 | | #define UDS_RESPONSE_CODES_UDNA 0x70 |
70 | | #define UDS_RESPONSE_CODES_TDS 0x71 |
71 | | #define UDS_RESPONSE_CODES_GPF 0x72 |
72 | | #define UDS_RESPONSE_CODES_WBSC 0x73 |
73 | | #define UDS_RESPONSE_CODES_RCRRP 0x78 |
74 | | #define UDS_RESPONSE_CODES_SFNSIAS 0x7E |
75 | | #define UDS_RESPONSE_CODES_SNSIAS 0x7F |
76 | | #define UDS_RESPONSE_CODES_RPMTH 0x81 |
77 | | #define UDS_RESPONSE_CODES_RPMTL 0x82 |
78 | | #define UDS_RESPONSE_CODES_EIR 0x83 |
79 | | #define UDS_RESPONSE_CODES_EINR 0x84 |
80 | | #define UDS_RESPONSE_CODES_ERTTL 0x85 |
81 | | #define UDS_RESPONSE_CODES_TEMPTH 0x86 |
82 | | #define UDS_RESPONSE_CODES_TEMPTL 0x87 |
83 | | #define UDS_RESPONSE_CODES_VSTH 0x88 |
84 | | #define UDS_RESPONSE_CODES_VSTL 0x89 |
85 | | #define UDS_RESPONSE_CODES_TPTH 0x8a |
86 | | #define UDS_RESPONSE_CODES_TPTL 0x8b |
87 | | #define UDS_RESPONSE_CODES_TRNIN 0x8c |
88 | | #define UDS_RESPONSE_CODES_TRNIG 0x8d |
89 | | #define UDS_RESPONSE_CODES_BSNC 0x8f |
90 | | #define UDS_RESPONSE_CODES_SLNIP 0x90 |
91 | | #define UDS_RESPONSE_CODES_TCCL 0x91 |
92 | | #define UDS_RESPONSE_CODES_VTH 0x92 |
93 | | #define UDS_RESPONSE_CODES_VTL 0x93 |
94 | | #define UDS_RESPONSE_CODES_RTNA 0x94 |
95 | | |
96 | 105 | #define UDS_SUBFUNCTION_MASK 0x7f |
97 | 60 | #define UDS_SUPPRESS_POS_RSP_MSG_IND_MASK 0x80 |
98 | | |
99 | | #define UDS_DSC_TYPES_DEFAULT_SESSION 1 |
100 | | #define UDS_DSC_TYPES_PROGRAMMING_SESSION 2 |
101 | | #define UDS_DSC_TYPES_EXTENDED_DIAGNOSTIC_SESSION 3 |
102 | | #define UDS_DSC_TYPES_SAFETY_SYSTEM_DIAGNOSTIC_SESSION 4 |
103 | | |
104 | | #define UDS_ER_TYPES_HARD_RESET 1 |
105 | | #define UDS_ER_TYPES_KEY_OFF_ON_RESET 2 |
106 | | #define UDS_ER_TYPES_SOFT_RESET 3 |
107 | 0 | #define UDS_ER_TYPES_ENABLE_RAPID_POWER_SHUTDOWN 4 |
108 | | #define UDS_ER_TYPES_DISABLE_RAPID_POWER_SHUTDOWN 5 |
109 | | |
110 | 0 | #define UDS_ER_TYPE_ENABLE_RAPID_POWER_SHUTDOWN_INVALID 0xFF |
111 | | |
112 | 0 | #define UDS_RDTCI_TYPES_NUMBER_BY_STATUS_MASK 0x1 |
113 | 0 | #define UDS_RDTCI_TYPES_BY_STATUS_MASK 0x2 |
114 | 0 | #define UDS_RDTCI_TYPES_SNAPSHOT_IDENTIFICATION 0x3 |
115 | 0 | #define UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_DTC 0x4 |
116 | 0 | #define UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_RECORD 0x5 |
117 | 0 | #define UDS_RDTCI_TYPES_EXTENDED_RECORD_BY_DTC 0x6 |
118 | 0 | #define UDS_RDTCI_TYPES_NUM_DTC_BY_SEVERITY_MASK 0x7 |
119 | 0 | #define UDS_RDTCI_TYPES_BY_SEVERITY_MASK 0x8 |
120 | 0 | #define UDS_RDTCI_TYPES_SEVERITY_INFO_OF_DTC 0x9 |
121 | 0 | #define UDS_RDTCI_TYPES_SUPPORTED_DTC 0xA |
122 | 0 | #define UDS_RDTCI_TYPES_FIRST_TEST_FAILED_DTC 0xB |
123 | 0 | #define UDS_RDTCI_TYPES_FIRST_CONFIRMED_DTC 0xC |
124 | 0 | #define UDS_RDTCI_TYPES_MOST_RECENT_TEST_FAILED 0xD |
125 | 0 | #define UDS_RDTCI_TYPES_MOST_RECENT_CONFIRMED_DTC 0xE |
126 | 0 | #define UDS_RDTCI_TYPES_OUTDATED_RMMDTCBSM 0xF |
127 | | #define UDS_RDTCI_TYPES_OUTDATED_RMMDEDRBDN 0x10 |
128 | 0 | #define UDS_RDTCI_TYPES_OUTDATED_RNOMMDTCBSM 0x11 |
129 | 0 | #define UDS_RDTCI_TYPES_OUTDATED_RNOOEOBDDTCBSM 0x12 |
130 | 0 | #define UDS_RDTCI_TYPES_OUTDATED_ROBDDTCBSM 0x13 |
131 | 0 | #define UDS_RDTCI_TYPES_DTC_FAULT_DETECT_CTR 0x14 |
132 | 0 | #define UDS_RDTCI_TYPES_DTC_WITH_PERM_STATUS 0x15 |
133 | 0 | #define UDS_RDTCI_TYPES_DTC_EXT_DATA_REC_BY_NUM 0x16 |
134 | 0 | #define UDS_RDTCI_TYPES_USER_MEM_DTC_BY_STATUS_M 0x17 |
135 | 0 | #define UDS_RDTCI_TYPES_USER_MEM_DTC_REC_BY_DTC_N 0x18 |
136 | 0 | #define UDS_RDTCI_TYPES_USER_MEM_DTC_EXT_REC_BY_N 0x19 |
137 | 0 | #define UDS_RDTCI_TYPES_SUP_DTC_EXT_RECORD 0x1A |
138 | 0 | #define UDS_RDTCI_TYPES_WWH_OBD_DTC_BY_MASK_REC 0x42 |
139 | 0 | #define UDS_RDTCI_TYPES_WWH_OBD_DTC_PERM_STATUS 0x55 |
140 | 0 | #define UDS_RDTCI_TYPES_WWH_OBD_BY_GROUP_READY 0x56 |
141 | | |
142 | 45 | #define UDS_RDTCI_DTC_STATUS_TEST_FAILED 0x01 |
143 | 45 | #define UDS_RDTCI_DTC_STATUS_TEST_FAILED_THIS_OPER_CYCLE 0x02 |
144 | 45 | #define UDS_RDTCI_DTC_STATUS_PENDING_DTC 0x04 |
145 | 45 | #define UDS_RDTCI_DTC_STATUS_CONFIRMED_DTC 0x08 |
146 | 45 | #define UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_SINCE_LAST_CLEAR 0x10 |
147 | 45 | #define UDS_RDTCI_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR 0x20 |
148 | 45 | #define UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_THIS_OPER_CYCLE 0x40 |
149 | 45 | #define UDS_RDTCI_DTC_STATUS_WARNING_INDICATOR_REQUESTED 0x80 |
150 | | |
151 | | #define UDS_RSDBI_DATA_TYPE_UNSIGNED_NUM 0x00 |
152 | | #define UDS_RSDBI_DATA_TYPE_SIGNED_NUM 0x01 |
153 | 4 | #define UDS_RSDBI_DATA_TYPE_BITMAPPED_REPORTED_WO_MAP 0x02 |
154 | | #define UDS_RSDBI_DATA_TYPE_BITMAPPED_REPORTED_WITH_MAP 0x03 |
155 | | #define UDS_RSDBI_DATA_TYPE_BINARY_CODED_DECIMAL 0x04 |
156 | | #define UDS_RSDBI_DATA_TYPE_STATE_ENCODED_VARIABLE 0x05 |
157 | | #define UDS_RSDBI_DATA_TYPE_ASCII 0x06 |
158 | | #define UDS_RSDBI_DATA_TYPE_SIGNED_FLOAT 0x07 |
159 | | #define UDS_RSDBI_DATA_TYPE_PACKET 0x08 |
160 | 1 | #define UDS_RSDBI_DATA_TYPE_FORMULA 0x09 |
161 | 0 | #define UDS_RSDBI_DATA_TYPE_UNIT_FORMAT 0x0a |
162 | | #define UDS_RSDBI_DATA_TYPE_STATE_AND_CONNECTION_TYPE 0x0b |
163 | | |
164 | 8 | #define UDS_SA_TYPES_RESERVED 0x00 |
165 | 0 | #define UDS_SA_TYPES_REQUEST_SEED 0x01 |
166 | 0 | #define UDS_SA_TYPES_SEND_KEY 0x02 |
167 | 0 | #define UDS_SA_TYPES_REQUEST_SEED_ISO26021 0x03 |
168 | 0 | #define UDS_SA_TYPES_SEND_KEY_ISO26021 0x04 |
169 | 0 | #define UDS_SA_TYPES_SUPPLIER 0xFE |
170 | 1 | #define UDS_SA_TYPES_UNCLEAR 0xFF |
171 | | |
172 | | #define UDS_CC_TYPES_ENABLE_RX_AND_TX 0 |
173 | | #define UDS_CC_TYPES_ENABLE_RX_AND_DISABLE_TX 1 |
174 | | #define UDS_CC_TYPES_DISABLE_RX_AND_ENABLE_TX 2 |
175 | | #define UDS_CC_TYPES_DISABLE_RX_AND_TX 3 |
176 | 0 | #define UDS_CC_TYPES_ENABLE_RX_AND_DISABLE_TX_WITH_ENH_ADDR_INFO 4 |
177 | 0 | #define UDS_CC_TYPES_ENABLE_RX_AND_TX_WITH_ENH_ADDR_INFO 5 |
178 | | |
179 | 15 | #define UDS_CC_COMM_TYPE_COMM_TYPE_MASK 0x03 |
180 | 15 | #define UDS_CC_COMM_TYPE_SUBNET_NUMBER_MASK 0xF0 |
181 | | |
182 | 0 | #define UDS_ARS_TYPES_DEAUTHENTICATE 0x00 |
183 | 2 | #define UDS_ARS_TYPES_VERIFY_CERT_UNIDIRECTIONAL 0x01 |
184 | 0 | #define UDS_ARS_TYPES_VERIFY_CERT_BIDIRECTIONAL 0x02 |
185 | 0 | #define UDS_ARS_TYPES_PROOF_OF_OWNERSHIP 0x03 |
186 | 0 | #define UDS_ARS_TYPES_TRANSMIT_CERTIFICATE 0x04 |
187 | 39 | #define UDS_ARS_TYPES_REQUEST_CHALLENGE_FOR_AUTH 0x05 |
188 | 1 | #define UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_UNIDIR 0x06 |
189 | 0 | #define UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_BIDIR 0x07 |
190 | 0 | #define UDS_ARS_TYPES_AUTH_CONFIGURATION 0x08 |
191 | | |
192 | | #define UDS_ARS_AUTH_RET_REQUEST_ACCEPTED 0x00 |
193 | | #define UDS_ARS_AUTH_RET_GENERAL_REJECT 0x01 |
194 | | #define UDS_ARS_AUTH_RET_AUTH_CONFIG_APCE 0x02 |
195 | | #define UDS_ARS_AUTH_RET_AUTH_CONFIG_ACR_SYM 0x03 |
196 | | #define UDS_ARS_AUTH_RET_AUTH_CONFIG_ACR_ASYM 0x04 |
197 | | #define UDS_ARS_AUTH_RET_DEAUTH_SUCCESS 0x10 |
198 | | #define UDS_ARS_AUTH_RET_CERT_VER_OWN_VER_NEC 0x11 |
199 | | #define UDS_ARS_AUTH_RET_OWN_VER_AUTH_COMPL 0x12 |
200 | | #define UDS_ARS_AUTH_RET_CERT_VERIFIED 0x13 |
201 | | |
202 | 0 | #define UDS_DDDI_TYPES_DEFINE_BY_IDENTIFIER 0x01 |
203 | 0 | #define UDS_DDDI_TYPES_DEFINE_BY_MEM_ADDRESS 0x02 |
204 | 0 | #define UDS_DDDI_TYPES_CLEAR_DYN_DEF_DATA_ID 0x03 |
205 | | |
206 | | #define UDS_IOCBI_PARAMETERS_RETURN_CONTROL_TO_ECU 0 |
207 | | #define UDS_IOCBI_PARAMETERS_RESET_TO_DEFAULT 1 |
208 | | #define UDS_IOCBI_PARAMETERS_FREEZE_CURRENT_STATE 2 |
209 | | #define UDS_IOCBI_PARAMETERS_SHORT_TERM_ADJUSTMENT 3 |
210 | | |
211 | | #define UDS_RC_TYPES_START 1 |
212 | | #define UDS_RC_TYPES_STOP 2 |
213 | | #define UDS_RC_TYPES_REQUEST 3 |
214 | | |
215 | 15 | #define UDS_RD_COMPRESSION_METHOD_MASK 0xF0 |
216 | 15 | #define UDS_RD_ENCRYPTING_METHOD_MASK 0x0F |
217 | 15 | #define UDS_RD_MEMORY_SIZE_LENGTH_MASK 0xF0 |
218 | 15 | #define UDS_RD_MEMORY_ADDRESS_LENGTH_MASK 0x0F |
219 | 15 | #define UDS_RD_MAX_BLOCK_LEN_LEN_MASK 0xF0 |
220 | | |
221 | 0 | #define UDS_RFT_MODE_ADD_FILE 0x01 |
222 | 0 | #define UDS_RFT_MODE_DELETE_FILE 0x02 |
223 | 0 | #define UDS_RFT_MODE_REPLACE_FILE 0x03 |
224 | 0 | #define UDS_RFT_MODE_READ_FILE 0x04 |
225 | 0 | #define UDS_RFT_MODE_READ_DIR 0x05 |
226 | 0 | #define UDS_RFT_MODE_RESUME_FILE 0x06 |
227 | | |
228 | 15 | #define UDS_SDT_ADMIN_PARAM_REQ 0x0001 |
229 | 15 | #define UDS_SDT_ADMIN_PARAM_PRE_ESTABL_KEY 0x0008 |
230 | 15 | #define UDS_SDT_ADMIN_PARAM_ENCRYPTED 0x0010 |
231 | 15 | #define UDS_SDT_ADMIN_PARAM_SIGNED 0x0020 |
232 | 15 | #define UDS_SDT_ADMIN_PARAM_SIGN_ON_RESP_REQ 0x0040 |
233 | | |
234 | | #define UDS_CDTCS_ACTIONS_ON 1 |
235 | | #define UDS_CDTCS_ACTIONS_OFF 2 |
236 | | |
237 | 0 | #define UDS_LC_TYPES_VMTWFP 1 |
238 | 0 | #define UDS_LC_TYPES_VMTWSP 2 |
239 | 0 | #define UDS_LC_TYPES_TM 3 |
240 | | |
241 | | #define UDS_DID_BSIDID 0xF180 |
242 | | #define UDS_DID_ASIDID 0xF181 |
243 | | #define UDS_DID_ADIDID 0xF182 |
244 | | #define UDS_DID_BSFPDID 0xF183 |
245 | | #define UDS_DID_ASFPDID 0xF184 |
246 | | #define UDS_DID_ADFPDID 0xF185 |
247 | 0 | #define UDS_DID_ADSDID 0xF186 |
248 | | #define UDS_DID_VMSPNDID 0xF187 |
249 | | #define UDS_DID_VMECUSNDID 0xF188 |
250 | | #define UDS_DID_VMECUSVNDID 0xF189 |
251 | | #define UDS_DID_SSIDDID 0xF18A |
252 | | #define UDS_DID_ECUMDDID 0xF18B |
253 | | #define UDS_DID_ECUSNDID 0xF18C |
254 | | #define UDS_DID_SFUDID 0xF18D |
255 | | #define UDS_DID_VMKAPNDID 0xF18E |
256 | | #define UDS_DID_RXSWIN 0xF18F |
257 | 0 | #define UDS_DID_VINDID 0xF190 |
258 | | #define UDS_DID_VMECUHNDID 0xF191 |
259 | | #define UDS_DID_SSECUHWNDID 0xF192 |
260 | | #define UDS_DID_SSECUHWVNDID 0xF193 |
261 | | #define UDS_DID_SSECUSWNDID 0xF194 |
262 | | #define UDS_DID_SSECUSWVNDID 0xF195 |
263 | | #define UDS_DID_EROTANDID 0xF196 |
264 | | #define UDS_DID_SNOETDID 0xF197 |
265 | | #define UDS_DID_RSCOTSNDID 0xF198 |
266 | | #define UDS_DID_PDDID 0xF199 |
267 | | #define UDS_DID_CRSCOCESNDID 0xF19A |
268 | | #define UDS_DID_CDDID 0xF19B |
269 | | #define UDS_DID_CESWNDID 0xF19D |
270 | | #define UDS_DID_EIDDID 0xF19D |
271 | | #define UDS_DID_ODXFDID 0xF19E |
272 | | #define UDS_DID_EDID 0xF19F |
273 | | #define UDS_DID_ADDID_FA00 0xFA00 |
274 | | #define UDS_DID_ADDID_FA01 0xFA01 |
275 | | #define UDS_DID_ADDID_FA02 0xFA02 |
276 | | #define UDS_DID_ADDID_FA03 0xFA03 |
277 | | #define UDS_DID_ADDID_FA04 0xFA04 |
278 | | #define UDS_DID_ADDID_FA05 0xFA05 |
279 | | #define UDS_DID_ADDID_FA06 0xFA06 |
280 | | #define UDS_DID_ADDID_FA07 0xFA07 |
281 | | #define UDS_DID_ADDID_FA08 0xFA08 |
282 | | #define UDS_DID_ADDID_FA09 0xFA09 |
283 | | #define UDS_DID_ADDID_FA0A 0xFA0A |
284 | | #define UDS_DID_ADDID_FA0B 0xFA0B |
285 | | #define UDS_DID_ADDID_FA0C 0xFA0C |
286 | | #define UDS_DID_ADDID_FA0D 0xFA0D |
287 | | #define UDS_DID_ADDID_FA0E 0xFA0E |
288 | | #define UDS_DID_ADDID_FA0F 0xFA0F |
289 | | #define UDS_DID_NOEDRD 0xFA10 |
290 | | #define UDS_DID_EDRI 0xFA11 |
291 | | #define UDS_DID_EDRDAI 0xFA12 |
292 | 0 | #define UDS_DID_UDSVDID 0xFF00 |
293 | 0 | #define UDS_DID_RESRVDCPADLC 0xFF01 |
294 | | |
295 | | #define UDS_RID_EXSPLRI_ 0xE200 |
296 | | #define UDS_RID_DLRI_ 0xE201 |
297 | | #define UDS_RID_EM_ 0xFF00 |
298 | | #define UDS_RID_CPD_ 0xFF01 |
299 | | #define UDS_RID_FF02 0xFF02 |
300 | | |
301 | 17 | #define UDS_ROE_SUBFUNC_MASK 0b00111111 |
302 | 15 | #define UDS_ROE_STORE_MASK 0b01000000 |
303 | | #define UDS_ROE_SUBF_STPROE 0x00 |
304 | 0 | #define UDS_ROE_SUBF_ONDTCS 0x01 |
305 | 0 | #define UDS_ROE_SUBF_OCODID 0x03 |
306 | 0 | #define UDS_ROE_SUBF_RAE 0x04 |
307 | 2 | #define UDS_ROE_SUBF_OCOV 0x07 |
308 | 0 | #define UDS_ROE_SUBF_RMRDOSC 0x08 |
309 | 0 | #define UDS_ROE_SUBF_RDRIODSC 0x09 |
310 | 15 | #define UDS_ROE_OCOV_LOCAL_SIGN_MASK 0b1000000000000000 |
311 | 15 | #define UDS_ROE_OCOV_LOCAL_LEN_MASK 0b0111110000000000 |
312 | 15 | #define UDS_ROE_OCOV_LOCAL_OFFSET_MASK 0b0000001111111111 |
313 | 15 | #define UDS_ROE_DTC_STATUS_MASK_TF 0b00000001 |
314 | 15 | #define UDS_ROE_DTC_STATUS_MASK_TFTOC 0b00000010 |
315 | 15 | #define UDS_ROE_DTC_STATUS_MASK_PDTC 0b00000100 |
316 | 15 | #define UDS_ROE_DTC_STATUS_MASK_CDTC 0b00001000 |
317 | 15 | #define UDS_ROE_DTC_STATUS_MASK_TNCSLC 0b00010000 |
318 | 15 | #define UDS_ROE_DTC_STATUS_MASK_TFSLC 0b00100000 |
319 | 15 | #define UDS_ROE_DTC_STATUS_MASK_TNCTOC 0b01000000 |
320 | 15 | #define UDS_ROE_DTC_STATUS_MASK_WIR 0b10000000 |
321 | | |
322 | | /* |
323 | | * Enums |
324 | | */ |
325 | | |
326 | | /* Services */ |
327 | | static const value_string _uds_services[]= { |
328 | | {OBD_SERVICES_0x01, "OBD - Request Current Powertrain Diagnostic Data"}, |
329 | | {OBD_SERVICES_0x02, "OBD - Request Powertrain Freeze Frame Data"}, |
330 | | {OBD_SERVICES_0x03, "OBD - Request Emission-Related Diagnostic Trouble Codes"}, |
331 | | {OBD_SERVICES_0x04, "OBD - Clear/Reset Emission-Related Diagnostic Information"}, |
332 | | {OBD_SERVICES_0x05, "OBD - Request Oxygen Sensor Monitoring Test Results"}, |
333 | | {OBD_SERVICES_0x06, "OBD - Request On-Board Monitoring Test Results for Specific Monitored Systems"}, |
334 | | {OBD_SERVICES_0x07, "OBD - Request Emission-Related Diagnostic Trouble Codes Detected During Current or Last Completed Driving Cycle"}, |
335 | | {OBD_SERVICES_0x08, "OBD - Request Control of On-Board System, Test or Component"}, |
336 | | {OBD_SERVICES_0x09, "OBD - Request Vehicle Information"}, |
337 | | {OBD_SERVICES_0x0A, "OBD - Request Emission-Related Diagnostic Trouble Codes with Permanent Status"}, |
338 | | {OBD_SERVICES_0x0B, "OBD - Unknown Service"}, |
339 | | {OBD_SERVICES_0x0C, "OBD - Unknown Service"}, |
340 | | {OBD_SERVICES_0x0D, "OBD - Unknown Service"}, |
341 | | {OBD_SERVICES_0x0E, "OBD - Unknown Service"}, |
342 | | {OBD_SERVICES_0x0F, "OBD - Unknown Service"}, |
343 | | |
344 | | {UDS_SERVICES_DSC, "Diagnostic Session Control"}, |
345 | | {UDS_SERVICES_ER, "ECU Reset"}, |
346 | | {UDS_SERVICES_CDTCI, "Clear Diagnostic Information"}, |
347 | | {UDS_SERVICES_RDTCI, "Read DTC Information"}, |
348 | | {UDS_SERVICES_RDBI, "Read Data By Identifier"}, |
349 | | {UDS_SERVICES_RMBA, "Read Memory By Address"}, |
350 | | {UDS_SERVICES_RSDBI, "Read Scaling Data By Identifier"}, |
351 | | {UDS_SERVICES_SA, "Security Access"}, |
352 | | {UDS_SERVICES_CC, "Communication Control"}, |
353 | | {UDS_SERVICES_ARS, "Authentication"}, |
354 | | {UDS_SERVICES_RDBPI, "Read Data By Periodic Identifier"}, |
355 | | {UDS_SERVICES_DDDI, "Dynamically Define Data Identifier"}, |
356 | | {UDS_SERVICES_WDBI, "Write Data By Identifier"}, |
357 | | {UDS_SERVICES_IOCBI, "Input Output Control By Identifier"}, |
358 | | {UDS_SERVICES_RC, "Routine Control"}, |
359 | | {UDS_SERVICES_RD, "Request Download"}, |
360 | | {UDS_SERVICES_RU, "Request Upload"}, |
361 | | {UDS_SERVICES_TD, "Transfer Data"}, |
362 | | {UDS_SERVICES_RTE, "Request Transfer Exit"}, |
363 | | {UDS_SERVICES_RFT, "Request File Transfer"}, |
364 | | {UDS_SERVICES_WMBA, "Write Memory By Address"}, |
365 | | {UDS_SERVICES_TP, "Tester Present"}, |
366 | | {UDS_SERVICES_ERR, "Error"}, |
367 | | {UDS_SERVICES_SDT, "Secured Data Transmission"}, |
368 | | {UDS_SERVICES_CDTCS, "Control DTC Setting"}, |
369 | | {UDS_SERVICES_ROE, "Response On Event"}, |
370 | | {UDS_SERVICES_LC, "Link Control"}, |
371 | | {0, NULL} |
372 | | }; |
373 | | static value_string_ext uds_services_ext = VALUE_STRING_EXT_INIT(_uds_services); |
374 | | |
375 | | /* Response code */ |
376 | | static const value_string _uds_response_codes[]= { |
377 | | {UDS_RESPONSE_CODES_GR, "General reject"}, |
378 | | {UDS_RESPONSE_CODES_SNS, "Service not supported"}, |
379 | | {UDS_RESPONSE_CODES_SFNS, "SubFunction Not Supported"}, |
380 | | {UDS_RESPONSE_CODES_IMLOIF, "Incorrect Message Length or Invalid Format"}, |
381 | | {UDS_RESPONSE_CODES_RTL, "Response too long"}, |
382 | | {UDS_RESPONSE_CODES_BRR, "Busy repeat request"}, |
383 | | {UDS_RESPONSE_CODES_CNC, "Conditions Not Correct"}, |
384 | | {UDS_RESPONSE_CODES_RSE, "Request Sequence Error"}, |
385 | | {UDS_RESPONSE_CODES_NRFSC, "No response from sub-net component"}, |
386 | | {UDS_RESPONSE_CODES_FPEORA, "Failure prevents execution of requested action"}, |
387 | | {UDS_RESPONSE_CODES_ROOR, "Request Out of Range"}, |
388 | | {UDS_RESPONSE_CODES_SAD, "Security Access Denied"}, |
389 | | {UDS_RESPONSE_CODES_AR, "Authentication Required"}, |
390 | | {UDS_RESPONSE_CODES_IK, "Invalid Key"}, |
391 | | {UDS_RESPONSE_CODES_ENOA, "Exceeded Number Of Attempts"}, |
392 | | {UDS_RESPONSE_CODES_RTDNE, "Required Time Delay Not Expired"}, |
393 | | {UDS_RESPONSE_CODES_SDTR, "Secure Data Transmission Required"}, |
394 | | {UDS_RESPONSE_CODES_SDTNA, "Secure Data Transmission Not Allowed"}, |
395 | | {UDS_RESPONSE_CODES_SDTF, "Secure Data Verification Failed"}, |
396 | | {UDS_RESPONSE_CODES_CVFITP, "Certificate Verification Failed: Invalid Time Period"}, |
397 | | {UDS_RESPONSE_CODES_CVFIS, "Certificate Verification Failed: Invalid Signature"}, |
398 | | {UDS_RESPONSE_CODES_CVFICOT, "Certificate Verification Failed: Invalid Chain of Trust"}, |
399 | | {UDS_RESPONSE_CODES_CVFIT, "Certificate Verification Failed: Invalid Type"}, |
400 | | {UDS_RESPONSE_CODES_CVFIF, "Certificate Verification Failed: Invalid Format"}, |
401 | | {UDS_RESPONSE_CODES_CVFIC, "Certificate Verification Failed: Invalid Content"}, |
402 | | {UDS_RESPONSE_CODES_CVFISD, "Certificate Verification Failed: Invalid Scope"}, |
403 | | {UDS_RESPONSE_CODES_CVFICR, "Certificate Verification Failed: Invalid Certificate (revoked)"}, |
404 | | {UDS_RESPONSE_CODES_OVF, "Ownership Verification Failed"}, |
405 | | {UDS_RESPONSE_CODES_CCF, "Challenge Calculation Failed"}, |
406 | | {UDS_RESPONSE_CODES_SARF, "Setting Access Rights Failed"}, |
407 | | {UDS_RESPONSE_CODES_SKCDF, "Session Key Creation/Derivation Failed"}, |
408 | | {UDS_RESPONSE_CODES_CDUF, "Configuration Data Usage Failed"}, |
409 | | {UDS_RESPONSE_CODES_DAF, "DeAuthentication Failed"}, |
410 | | {UDS_RESPONSE_CODES_UDNA, "Upload/Download not accepted"}, |
411 | | {UDS_RESPONSE_CODES_TDS, "Transfer data suspended"}, |
412 | | {UDS_RESPONSE_CODES_GPF, "General Programming Failure"}, |
413 | | {UDS_RESPONSE_CODES_WBSC, "Wrong Block Sequence Counter"}, |
414 | | {UDS_RESPONSE_CODES_RCRRP, "Request correctly received, but response is pending"}, |
415 | | {UDS_RESPONSE_CODES_SFNSIAS, "Subfunction not supported in active session"}, |
416 | | {UDS_RESPONSE_CODES_SNSIAS, "Service not supported in active session"}, |
417 | | {UDS_RESPONSE_CODES_RPMTH, "RPM Too High"}, |
418 | | {UDS_RESPONSE_CODES_RPMTL, "RPM Too Low"}, |
419 | | {UDS_RESPONSE_CODES_EIR, "Engine Is Running"}, |
420 | | {UDS_RESPONSE_CODES_EINR, "Engine Is Not Running"}, |
421 | | {UDS_RESPONSE_CODES_ERTTL, "Run Time Too Low"}, |
422 | | {UDS_RESPONSE_CODES_TEMPTH, "Temperature Too High"}, |
423 | | {UDS_RESPONSE_CODES_TEMPTL, "Temperature Too Low"}, |
424 | | {UDS_RESPONSE_CODES_VSTH, "Vehicle Speed Too High"}, |
425 | | {UDS_RESPONSE_CODES_VSTL, "Vehicle Speed Too Low"}, |
426 | | {UDS_RESPONSE_CODES_TPTH, "Throttle/Pedal Too High"}, |
427 | | {UDS_RESPONSE_CODES_TPTL, "Throttle/Pedal Too Low"}, |
428 | | {UDS_RESPONSE_CODES_TRNIN, "Transmission Range Not In Neutral"}, |
429 | | {UDS_RESPONSE_CODES_TRNIG, "Transmission Range Not In Gear"}, |
430 | | {UDS_RESPONSE_CODES_BSNC, "Brake Switch(es) Not Closed"}, |
431 | | {UDS_RESPONSE_CODES_SLNIP, "Shifter/Lever Not in Park"}, |
432 | | {UDS_RESPONSE_CODES_TCCL, "Torque Converter Clutch Locked"}, |
433 | | {UDS_RESPONSE_CODES_VTH, "Voltage Too High"}, |
434 | | {UDS_RESPONSE_CODES_VTL, "Voltage Too Low"}, |
435 | | {UDS_RESPONSE_CODES_RTNA, "Resource Temporarily Not Available"}, |
436 | | {0, NULL} |
437 | | }; |
438 | | static value_string_ext uds_response_codes_ext = VALUE_STRING_EXT_INIT(_uds_response_codes); |
439 | | |
440 | | /* DSC */ |
441 | | static const value_string uds_dsc_types[] = { |
442 | | {0, "Reserved"}, |
443 | | {UDS_DSC_TYPES_DEFAULT_SESSION, "Default Session"}, |
444 | | {UDS_DSC_TYPES_PROGRAMMING_SESSION, "Programming Session"}, |
445 | | {UDS_DSC_TYPES_EXTENDED_DIAGNOSTIC_SESSION, "Extended Diagnostic Session"}, |
446 | | {UDS_DSC_TYPES_SAFETY_SYSTEM_DIAGNOSTIC_SESSION, "Safety System Diagnostic Session"}, |
447 | | {0, NULL} |
448 | | }; |
449 | | |
450 | | /* ER */ |
451 | | static const value_string uds_er_types[] = { |
452 | | {0, "Reserved"}, |
453 | | {UDS_ER_TYPES_HARD_RESET, "Hard Reset"}, |
454 | | {UDS_ER_TYPES_KEY_OFF_ON_RESET, "Key Off On Reset"}, |
455 | | {UDS_ER_TYPES_SOFT_RESET, "Soft Reset"}, |
456 | | {UDS_ER_TYPES_ENABLE_RAPID_POWER_SHUTDOWN, "Enable Rapid Power Shutdown"}, |
457 | | {UDS_ER_TYPES_DISABLE_RAPID_POWER_SHUTDOWN, "Disable Rapid Power Shutdown"}, |
458 | | {0, NULL} |
459 | | }; |
460 | | |
461 | | /* CDTCI */ |
462 | | static const value_string uds_cdtci_group_of_dtc[] = { |
463 | | {0xffff33, "Emissions-system group"}, |
464 | | {0xffffd0, "Safety-system group"}, |
465 | | {0xfffffe, "VOBD system"}, |
466 | | {0xffffff, "All Groups (all DTCs)"}, |
467 | | {0, NULL} |
468 | | }; |
469 | | |
470 | | /* RDTCI */ |
471 | | static const value_string _uds_rdtci_types[] = { |
472 | | {UDS_RDTCI_TYPES_NUMBER_BY_STATUS_MASK, "Report Number of DTC by Status Mask"}, |
473 | | {UDS_RDTCI_TYPES_BY_STATUS_MASK, "Report DTC by Status Mask"}, |
474 | | {UDS_RDTCI_TYPES_SNAPSHOT_IDENTIFICATION, "Report DTC Snapshot Identification"}, |
475 | | {UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_DTC, "Report DTC Snapshot Record by DTC Number"}, |
476 | | {UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_RECORD, "Report DTC Snapshot Record by Record Number"}, |
477 | | {UDS_RDTCI_TYPES_EXTENDED_RECORD_BY_DTC, "Report DTC Extended Data Record by DTC Number"}, |
478 | | {UDS_RDTCI_TYPES_NUM_DTC_BY_SEVERITY_MASK, "Report Number of DTC By Severity Mask"}, |
479 | | {UDS_RDTCI_TYPES_BY_SEVERITY_MASK, "Report DTC by Severity Mask"}, |
480 | | {UDS_RDTCI_TYPES_SEVERITY_INFO_OF_DTC, "Report Severity Information of DTC"}, |
481 | | {UDS_RDTCI_TYPES_SUPPORTED_DTC, "Report Supported DTC"}, |
482 | | {UDS_RDTCI_TYPES_FIRST_TEST_FAILED_DTC, "Report First Test Failed DTC"}, |
483 | | {UDS_RDTCI_TYPES_FIRST_CONFIRMED_DTC, "Report First Confirmed DTC"}, |
484 | | {UDS_RDTCI_TYPES_MOST_RECENT_TEST_FAILED, "Report Most Recent Test Failed DTC"}, |
485 | | {UDS_RDTCI_TYPES_MOST_RECENT_CONFIRMED_DTC, "Report Most Recent Confirmed DTC"}, |
486 | | {UDS_RDTCI_TYPES_OUTDATED_RMMDTCBSM, "Report Mirror Memory DTC By Status Mask (outdated 2013 revision)"}, |
487 | | {UDS_RDTCI_TYPES_OUTDATED_RMMDEDRBDN, "Report Mirror Memory DTC Ext Data Record by DTC Number (outdated 2013 revision)"}, |
488 | | {UDS_RDTCI_TYPES_OUTDATED_RNOMMDTCBSM, "Report Number of Mirror Memory DTC by Status Mask (outdated 2013 revision)"}, |
489 | | {UDS_RDTCI_TYPES_OUTDATED_RNOOEOBDDTCBSM, "Report Number of Emissions OBD DTC by Status Mask (outdated 2013 revision)"}, |
490 | | {UDS_RDTCI_TYPES_OUTDATED_ROBDDTCBSM, "Report Emissions OBD DTC By Status Mask (outdated 2013 revision)"}, |
491 | | {UDS_RDTCI_TYPES_DTC_FAULT_DETECT_CTR, "Report DTC Fault Detection Counter"}, |
492 | | {UDS_RDTCI_TYPES_DTC_WITH_PERM_STATUS, "Report DTC with Permanent Status"}, |
493 | | {UDS_RDTCI_TYPES_DTC_EXT_DATA_REC_BY_NUM, "Report DTC Extended Data Record by Record Number"}, |
494 | | {UDS_RDTCI_TYPES_USER_MEM_DTC_BY_STATUS_M, "Report User Defined Memory DTC By Status Mask"}, |
495 | | {UDS_RDTCI_TYPES_USER_MEM_DTC_REC_BY_DTC_N, "Report User Defined Memory DTC Snapshot Record By DTC Number"}, |
496 | | {UDS_RDTCI_TYPES_USER_MEM_DTC_EXT_REC_BY_N, "Report User Defined Memory DTC Extended Data Record by DTC Number"}, |
497 | | {UDS_RDTCI_TYPES_SUP_DTC_EXT_RECORD, "Report List of DTCs Supporting Specific Extended Data Record"}, |
498 | | {UDS_RDTCI_TYPES_WWH_OBD_DTC_BY_MASK_REC, "Report WWH-OBD DTC By Mask Record"}, |
499 | | {UDS_RDTCI_TYPES_WWH_OBD_DTC_PERM_STATUS, "Report WWH-OBD DTC With Permanent Status"}, |
500 | | {UDS_RDTCI_TYPES_WWH_OBD_BY_GROUP_READY, "Report WWH-OBD DTC By Readiness Group Identifier"}, |
501 | | {0, NULL} |
502 | | }; |
503 | | static value_string_ext uds_rdtci_types_ext = VALUE_STRING_EXT_INIT(_uds_rdtci_types); |
504 | | |
505 | | static const value_string uds_rdtci_format_id_types[] = { |
506 | | {0x00, "SAE J2012-DA DTC Format 00"}, |
507 | | {0x01, "ISO 14229-1 DTC Format"}, |
508 | | {0x02, "SAE J1939-73 DTC Format"}, |
509 | | {0x03, "ISO 11992-4 DTC Format"}, |
510 | | {0x04, "SAE J2012-DA DTC Format 04"}, |
511 | | {0, NULL} |
512 | | }; |
513 | | |
514 | | /* RSDBI */ |
515 | | static const value_string uds_rsdbi_data_types[] = { |
516 | | {UDS_RSDBI_DATA_TYPE_UNSIGNED_NUM, "Unsigned Numeric"}, |
517 | | {UDS_RSDBI_DATA_TYPE_SIGNED_NUM, "Signed Numeric"}, |
518 | | {UDS_RSDBI_DATA_TYPE_BITMAPPED_REPORTED_WO_MAP, "Bit Mapped Reported Without Mask"}, |
519 | | {UDS_RSDBI_DATA_TYPE_BITMAPPED_REPORTED_WITH_MAP, "Bit Mapped Reported With Mask"}, |
520 | | {UDS_RSDBI_DATA_TYPE_BINARY_CODED_DECIMAL, "Binary Coded Decimal"}, |
521 | | {UDS_RSDBI_DATA_TYPE_STATE_ENCODED_VARIABLE, "State Encoded Variable"}, |
522 | | {UDS_RSDBI_DATA_TYPE_ASCII, "ASCII"}, |
523 | | {UDS_RSDBI_DATA_TYPE_SIGNED_FLOAT, "Signed Floating Point"}, |
524 | | {UDS_RSDBI_DATA_TYPE_PACKET, "Packet"}, |
525 | | {UDS_RSDBI_DATA_TYPE_FORMULA, "Formula"}, |
526 | | {UDS_RSDBI_DATA_TYPE_UNIT_FORMAT, "Unit/Format"}, |
527 | | {UDS_RSDBI_DATA_TYPE_STATE_AND_CONNECTION_TYPE, "State And Connection Type"}, |
528 | | {0, NULL} |
529 | | }; |
530 | | |
531 | | static const value_string uds_rsdbi_formulas[] = { |
532 | | {0, "y = C0 * x + C1"}, |
533 | | {1, "y = C0 * (x + C1)"}, |
534 | | {2, "y = C0 / (x + C1) + C2"}, |
535 | | {3, "y = x / C0 + C1"}, |
536 | | {4, "y = (x + C0) / C1"}, |
537 | | {5, "y = (x + C0) / C1 + C2"}, |
538 | | {6, "y = C0 * x"}, |
539 | | {7, "y = x / C0"}, |
540 | | {8, "y = x + C0"}, |
541 | | {9, "y = x * C0 / C1"}, |
542 | | {0, NULL} |
543 | | }; |
544 | | |
545 | | static const value_string _uds_rsdbi_units[] = { |
546 | | {0x00, "No unit, no prefix"}, |
547 | | {0x01, "Metre [m]"}, |
548 | | {0x02, "Foot [ft]"}, |
549 | | {0x03, "Inch [in]"}, |
550 | | {0x04, "Yard [yd]"}, |
551 | | {0x05, "Mile (English) [mi]"}, |
552 | | {0x06, "Gram [g]"}, |
553 | | {0x07, "Ton (metric) [t]"}, |
554 | | {0x08, "Second [s]"}, |
555 | | {0x09, "Minute [m]"}, |
556 | | {0x0a, "Hour [h]"}, |
557 | | {0x0b, "Day [d]"}, |
558 | | {0x0c, "Year [y]"}, |
559 | | {0x0d, "Ampere [A]"}, |
560 | | {0x0e, "Volt [V]"}, |
561 | | {0x0f, "Coulomb [C]"}, |
562 | | |
563 | | {0x10, "Ohm [W]"}, /* sic! */ |
564 | | {0x11, "Farad [F]"}, |
565 | | {0x12, "Henry [H]"}, |
566 | | {0x13, "Siemens [S]"}, |
567 | | {0x14, "Weber [Wb]"}, |
568 | | {0x15, "Telsa [T]"}, |
569 | | {0x16, "Kelvin [K]"}, |
570 | | {0x17, "Celsius [" UTF8_DEGREE_SIGN "C]"}, |
571 | | {0x18, "Fahrenheit [" UTF8_DEGREE_SIGN "F]"}, |
572 | | {0x19, "Candela [cd]"}, |
573 | | {0x1a, "Radian [rad]"}, |
574 | | {0x1b, "Degree [" UTF8_DEGREE_SIGN "]"}, |
575 | | {0x1c, "Hertz [Hz]"}, |
576 | | {0x1d, "Joule [J]"}, |
577 | | {0x1e, "Newton [N]"}, |
578 | | {0x1f, "Kilopond [kp]"}, |
579 | | |
580 | | {0x20, "Pound force [lbf]"}, |
581 | | {0x21, "Watt [W]"}, |
582 | | {0x22, "Horse power (metric) [hk]"}, |
583 | | {0x23, "Horse power (UK and US) [hp]"}, |
584 | | {0x24, "Pascal [Pa]"}, |
585 | | {0x25, "Bar [bar]"}, |
586 | | {0x26, "Atmosphere [atm]"}, |
587 | | {0x27, "Pound force per square inch [psi]"}, |
588 | | {0x28, "Becquerel [Bq]"}, |
589 | | {0x29, "Lumen [lm]"}, |
590 | | {0x2a, "Lux [lx]"}, |
591 | | {0x2b, "Litre [l]"}, |
592 | | {0x2c, "Gallon (British)"}, |
593 | | {0x2d, "Gallon (US liq)"}, |
594 | | {0x2e, "Cubic inch [cu in]"}, |
595 | | {0x2f, "Meter per second [m/s]"}, |
596 | | |
597 | | {0x30, "Kilometer per hour [km/h]"}, |
598 | | {0x31, "Mile per hour [mph]"}, |
599 | | {0x32, "Revolutions per second [rps]"}, |
600 | | {0x33, "Revolutions per minute [rpm]"}, |
601 | | {0x34, "Counts"}, |
602 | | {0x35, "Percent"}, |
603 | | {0x36, "Milligram per stroke [mg/stroke]"}, |
604 | | {0x37, "Meter per square second [m/s" UTF8_SUPERSCRIPT_TWO "]"}, |
605 | | {0x38, "Newton meter [Nm]"}, |
606 | | {0x39, "Litre per minute [l/min]"}, |
607 | | {0x3a, "Watt per square meter [w/m" UTF8_SUPERSCRIPT_TWO "]"}, |
608 | | {0x3b, "Bar per second [bar/s]"}, |
609 | | {0x3c, "Radians per second [rad/s]"}, |
610 | | {0x3d, "Radians per square second [rad/s" UTF8_SUPERSCRIPT_TWO "]"}, |
611 | | {0x3e, "Kilogram per square meter [kg/m" UTF8_SUPERSCRIPT_TWO "]"}, |
612 | | {0x3f, "*reserved*"}, |
613 | | |
614 | | {0x40, "Exa (prefix) [E]"}, |
615 | | {0x41, "Peta (prefix) [P]"}, |
616 | | {0x42, "Tera (prefix) [T]"}, |
617 | | {0x43, "Giga (prefix) [G]"}, |
618 | | {0x44, "Mega (prefix) [M]"}, |
619 | | {0x45, "Kilo (prefix) [k]"}, |
620 | | {0x46, "Hecto (prefix) [h]"}, |
621 | | {0x47, "Deca (prefix) [da]"}, |
622 | | {0x48, "Deci (prefix) [d]"}, |
623 | | {0x49, "Centi (prefix) [c]"}, |
624 | | {0x4a, "Milli (prefix) [m]"}, |
625 | | {0x4b, "Micro (prefix) [m]"}, /* SIC! */ |
626 | | {0x4c, "Nano (prefix) [n]"}, |
627 | | {0x4d, "Pico (prefix) [p]"}, |
628 | | {0x4e, "Femto (prefix) [f]"}, |
629 | | {0x4f, "Atto (prefix) [a]"}, |
630 | | |
631 | | {0x50, "Date1 (Year-Month-Day)"}, |
632 | | {0x51, "Date2 (Day/Month/Year)"}, |
633 | | {0x52, "Date3 (Month/Day/Year)"}, |
634 | | {0x53, "Week (calender week)"}, |
635 | | {0x54, "Time1 (UTC Hour/Minute/Second)"}, |
636 | | {0x55, "Time2 (Hour/Minute/Second)"}, |
637 | | {0x56, "DateAndTime1 (Second/Minute/Hour/Day/Month/Year)"}, |
638 | | {0x57, "DateAndTime2 (Second/Minute/Hour/Day/Month/Year/Local minute offset/Local hour offset)"}, |
639 | | {0x58, "DateAndTime3 (Second/Minute/Hour/Month/Day/Year)"}, |
640 | | {0x59, "DateAndTime4 (Second/Minute/Hour/Month/Day/Year/Local minute offset/Local hour offset)"}, |
641 | | {0, NULL} |
642 | | }; |
643 | | static value_string_ext uds_rsdbi_units_ext = VALUE_STRING_EXT_INIT(_uds_rsdbi_units); |
644 | | |
645 | | /* CC */ |
646 | | static const value_string uds_cc_types[] = { |
647 | | {UDS_CC_TYPES_ENABLE_RX_AND_TX, "Enable RX and TX"}, |
648 | | {UDS_CC_TYPES_ENABLE_RX_AND_DISABLE_TX, "Enable RX and Disable TX"}, |
649 | | {UDS_CC_TYPES_DISABLE_RX_AND_ENABLE_TX, "Disable RX and Enable TX"}, |
650 | | {UDS_CC_TYPES_DISABLE_RX_AND_TX, "Disable RX and TX"}, |
651 | | {UDS_CC_TYPES_ENABLE_RX_AND_DISABLE_TX_WITH_ENH_ADDR_INFO, "Enable RX and Disable TX with Enhanced Address Information"}, |
652 | | {UDS_CC_TYPES_ENABLE_RX_AND_TX_WITH_ENH_ADDR_INFO, "Enable RX and TX with Enhanced Address Information"}, |
653 | | {0, NULL} |
654 | | }; |
655 | | |
656 | | static const value_string uds_cc_comm_types[] = { |
657 | | {0, "Reserved"}, |
658 | | {1, "Normal Communication Messages"}, |
659 | | {2, "Network Management Communication Messages"}, |
660 | | {3, "Network Management and Normal Communication Messages"}, |
661 | | {0, NULL} |
662 | | }; |
663 | | |
664 | | static const value_string uds_cc_subnet_number_types[] = { |
665 | | {0x0, "Disable/Enable specified Communication Type "}, |
666 | | /* 0x1 .. 0xe specific subnets numbers */ |
667 | | {0xf, "Disable/Enable network which request is received on"}, |
668 | | {0, NULL} |
669 | | }; |
670 | | |
671 | | /* ARS */ |
672 | | static const value_string uds_ars_types[] = { |
673 | | {UDS_ARS_TYPES_DEAUTHENTICATE, "DeAuthenticate"}, |
674 | | {UDS_ARS_TYPES_VERIFY_CERT_UNIDIRECTIONAL, "Verify Certificate Unidirectional"}, |
675 | | {UDS_ARS_TYPES_VERIFY_CERT_BIDIRECTIONAL, "Verify Certificate Bidirectional"}, |
676 | | {UDS_ARS_TYPES_PROOF_OF_OWNERSHIP, "Proof of Ownership"}, |
677 | | {UDS_ARS_TYPES_TRANSMIT_CERTIFICATE, "Transmit Certificate"}, |
678 | | {UDS_ARS_TYPES_REQUEST_CHALLENGE_FOR_AUTH, "Request Challenge for Authentication"}, |
679 | | {UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_UNIDIR, "Verify Proof of Ownership Unidirectional"}, |
680 | | {UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_BIDIR, "Verify Proof of Ownership Bidirectional"}, |
681 | | {UDS_ARS_TYPES_AUTH_CONFIGURATION, "Authentication Configuration"}, |
682 | | {0, NULL} |
683 | | }; |
684 | | |
685 | | static const value_string uds_ars_auth_ret_types[] = { |
686 | | {UDS_ARS_AUTH_RET_REQUEST_ACCEPTED, "Request Accepted"}, |
687 | | {UDS_ARS_AUTH_RET_GENERAL_REJECT, "General Reject"}, |
688 | | {UDS_ARS_AUTH_RET_AUTH_CONFIG_APCE, "Authentication Configuration APCE"}, |
689 | | {UDS_ARS_AUTH_RET_AUTH_CONFIG_ACR_SYM, "Authentication Configuration ACR with asymmetric cryptography"}, |
690 | | {UDS_ARS_AUTH_RET_AUTH_CONFIG_ACR_ASYM, "Authentication Configuration ACR with symmetric cryptography"}, |
691 | | {UDS_ARS_AUTH_RET_DEAUTH_SUCCESS, "DeAuthentication successful "}, |
692 | | {UDS_ARS_AUTH_RET_CERT_VER_OWN_VER_NEC, "Certificate Verified, Ownership Verification Necessary"}, |
693 | | {UDS_ARS_AUTH_RET_OWN_VER_AUTH_COMPL, "Ownership Verified, Authentication Complete "}, |
694 | | {UDS_ARS_AUTH_RET_CERT_VERIFIED, "Certificate Verified"}, |
695 | | {0, NULL} |
696 | | }; |
697 | | |
698 | | /* RDBPI */ |
699 | | static const value_string uds_rdbpi_transmission_mode[] = { |
700 | | {0, "Reserved"}, |
701 | | {1, "Send at Slow Rate"}, |
702 | | {2, "Send at Medium Rate"}, |
703 | | {3, "Send at Fast Rate"}, |
704 | | {4, "Stop Sending"}, |
705 | | {0, NULL} |
706 | | }; |
707 | | |
708 | | /* DDDI */ |
709 | | static const value_string uds_dddi_types[] = { |
710 | | {UDS_DDDI_TYPES_DEFINE_BY_IDENTIFIER, "Define by Identifier"}, |
711 | | {UDS_DDDI_TYPES_DEFINE_BY_MEM_ADDRESS, "Define by Memory Address"}, |
712 | | {UDS_DDDI_TYPES_CLEAR_DYN_DEF_DATA_ID, "Clear Dynamically Defined Data Identifier"}, |
713 | | {0, NULL} |
714 | | }; |
715 | | |
716 | | /* IOCBI */ |
717 | | static const value_string uds_iocbi_parameters[] = { |
718 | | {UDS_IOCBI_PARAMETERS_RETURN_CONTROL_TO_ECU, "Return Control To ECU"}, |
719 | | {UDS_IOCBI_PARAMETERS_RESET_TO_DEFAULT, "Reset To Default"}, |
720 | | {UDS_IOCBI_PARAMETERS_FREEZE_CURRENT_STATE, "Freeze Current State"}, |
721 | | {UDS_IOCBI_PARAMETERS_SHORT_TERM_ADJUSTMENT, "Short Term Adjustment"}, |
722 | | {0, NULL} |
723 | | }; |
724 | | |
725 | | /* RC */ |
726 | | static const value_string uds_rc_types[] = { |
727 | | {0, "Reserved"}, |
728 | | {UDS_RC_TYPES_START, "Start routine"}, |
729 | | {UDS_RC_TYPES_STOP, "Stop routine"}, |
730 | | {UDS_RC_TYPES_REQUEST, "Request routine result"}, |
731 | | {0, NULL} |
732 | | }; |
733 | | |
734 | | /* RFT */ |
735 | | static const value_string uds_rft_mode_types[] = { |
736 | | {0, "Reserved"}, |
737 | | {UDS_RFT_MODE_ADD_FILE, "Add File"}, |
738 | | {UDS_RFT_MODE_DELETE_FILE, "Delete File"}, |
739 | | {UDS_RFT_MODE_REPLACE_FILE, "Replace File"}, |
740 | | {UDS_RFT_MODE_READ_FILE, "Read File"}, |
741 | | {UDS_RFT_MODE_READ_DIR, "Read Dir"}, |
742 | | {UDS_RFT_MODE_RESUME_FILE, "Resume File"}, |
743 | | {0, NULL} |
744 | | }; |
745 | | |
746 | | /* CDTCS */ |
747 | | static const value_string uds_cdtcs_types[] = { |
748 | | {0, "Reserved"}, |
749 | | {UDS_CDTCS_ACTIONS_ON, "On"}, |
750 | | {UDS_CDTCS_ACTIONS_OFF, "Off"}, |
751 | | {0, NULL} |
752 | | }; |
753 | | |
754 | | /* LC */ |
755 | | static const value_string uds_lc_types[] = { |
756 | | {0x00, "Reserved"}, |
757 | | {UDS_LC_TYPES_VMTWFP, "Verify Mode Transition with fixed Parameter"}, |
758 | | {UDS_LC_TYPES_VMTWSP, "Verify Mode Transition with specific Parameter"}, |
759 | | {UDS_LC_TYPES_TM, "Transition Mode"}, |
760 | | {0, NULL} |
761 | | }; |
762 | | |
763 | | static const value_string uds_lc_lcmi_types[] = { |
764 | | {0x00, "Reserved"}, |
765 | | {0x01, "PC9600Baud"}, |
766 | | {0x02, "PC19200Baud"}, |
767 | | {0x03, "PC38400Baud"}, |
768 | | {0x04, "PC57600Baud"}, |
769 | | {0x05, "PC115200Baud"}, |
770 | | {0x10, "CAN125000Baud"}, |
771 | | {0x11, "CAN250000Baud"}, |
772 | | {0x12, "CAN500000Baud"}, |
773 | | {0x13, "CAN1000000Baud"}, |
774 | | {0x20, "ProgrammingSetup"}, |
775 | | {0, NULL} |
776 | | }; |
777 | | |
778 | | /* DIDS */ |
779 | | static const value_string _uds_standard_did_types[] = { |
780 | | {UDS_DID_BSIDID, "BootSoftwareIdentificationDataIdentifier"}, |
781 | | {UDS_DID_ASIDID, "applicationSoftwareIdentificationDataIdentifier"}, |
782 | | {UDS_DID_ADIDID, "applicationDataIdentificationDataIdentifier"}, |
783 | | {UDS_DID_BSFPDID, "bootSoftwareFingerprintDataIdentifier"}, |
784 | | {UDS_DID_ASFPDID, "applicationSoftwareFingerprintDataIdentifier"}, |
785 | | {UDS_DID_ADFPDID, "applicationDataFingerprintDataIdentifier"}, |
786 | | {UDS_DID_ADSDID, "ActiveDiagnosticSessionDataIdentifier"}, |
787 | | {UDS_DID_VMSPNDID, "vehicleManufacturerSparePartNumberDataIdentifier"}, |
788 | | {UDS_DID_VMECUSNDID, "vehicleManufacturerECUSoftwareNumberDataIdentifier"}, |
789 | | {UDS_DID_VMECUSVNDID, "vehicleManufacturerECUSoftwareVersionNumberDataIdentifier"}, |
790 | | {UDS_DID_SSIDDID, "systemSupplierIdentifierDataIdentifier"}, |
791 | | {UDS_DID_ECUMDDID, "ECUManufacturingDateDataIdentifier (year/month/day)"}, |
792 | | {UDS_DID_ECUSNDID, "ECUSerialNumberDataIdentifier"}, |
793 | | {UDS_DID_SFUDID, "supportedFunctionalUnitsDataIdentifier"}, |
794 | | {UDS_DID_VMKAPNDID, "VehicleManufacturerKitAssemblyPartNumberDataIdentifier"}, |
795 | | {UDS_DID_RXSWIN, "RegulationXSoftwareIdentificationNumbers (RxSWIN)"}, |
796 | | {UDS_DID_VINDID, "VINDataIdentifier"}, |
797 | | {UDS_DID_VMECUHNDID, "vehicleManufacturerECUHardwareNumberDataIdentifier"}, |
798 | | {UDS_DID_SSECUHWNDID, "systemSupplierECUHardwareNumberDataIdentifier"}, |
799 | | {UDS_DID_SSECUHWVNDID, "systemSupplierECUHardwareVersionNumberDataIdentifier"}, |
800 | | {UDS_DID_SSECUSWNDID, "systemSupplierECUSoftwareNumberDataIdentifier"}, |
801 | | {UDS_DID_SSECUSWVNDID, "systemSupplierECUSoftwareVersionNumberDataIdentifier"}, |
802 | | {UDS_DID_EROTANDID, "exhaustRegulationOrTypeApprovalNumberDataIdentifier"}, |
803 | | {UDS_DID_SNOETDID, "systemNameOrEngineTypeDataIdentifier"}, |
804 | | {UDS_DID_RSCOTSNDID, "repairShopCodeOrTesterSerialNumberDataIdentifier"}, |
805 | | {UDS_DID_PDDID, "programmingDateDataIdentifier (year/month/day)"}, |
806 | | {UDS_DID_CRSCOCESNDID, "calibrationRepairShopCodeOrCalibrationEquipmentSerialNumberDataIdentifier"}, |
807 | | {UDS_DID_CDDID, "calibrationDateDataIdentifier (year/month/day)"}, |
808 | | {UDS_DID_CESWNDID, "calibrationEquipmentSoftwareNumberDataIdentifier"}, |
809 | | {UDS_DID_EIDDID, "ECUInstallationDateDataIdentifier (year/month/day)"}, |
810 | | {UDS_DID_ODXFDID, "ODXFileDataIdentifier"}, |
811 | | {UDS_DID_EDID, "EntityDataIdentifier"}, |
812 | | {UDS_DID_ADDID_FA00, "AirbagDeployment: Number of PCUs (ISO 26021-2)"}, |
813 | | {UDS_DID_ADDID_FA01, "AirbagDeployment: Deployment Method Version (ISO 26021-2)"}, |
814 | | {UDS_DID_ADDID_FA02, "AirbagDeployment: Address Information of PCU (ISO 26021-2)"}, |
815 | | {UDS_DID_ADDID_FA03, "AirbagDeployment (ISO 26021-2)"}, |
816 | | {UDS_DID_ADDID_FA04, "AirbagDeployment (ISO 26021-2)"}, |
817 | | {UDS_DID_ADDID_FA05, "AirbagDeployment (ISO 26021-2)"}, |
818 | | {UDS_DID_ADDID_FA06, "AirbagDeployment: Deployment Loop Table of PCU (ISO 26021-2)"}, |
819 | | {UDS_DID_ADDID_FA07, "AirbagDeployment: Dismantler Info (ISO 26021-2)"}, |
820 | | {UDS_DID_ADDID_FA08, "AirbagDeployment (ISO 26021-2)"}, |
821 | | {UDS_DID_ADDID_FA09, "AirbagDeployment (ISO 26021-2)"}, |
822 | | {UDS_DID_ADDID_FA0A, "AirbagDeployment (ISO 26021-2)"}, |
823 | | {UDS_DID_ADDID_FA0B, "AirbagDeployment (ISO 26021-2)"}, |
824 | | {UDS_DID_ADDID_FA0C, "AirbagDeployment (ISO 26021-2)"}, |
825 | | {UDS_DID_ADDID_FA0D, "AirbagDeployment (ISO 26021-2)"}, |
826 | | {UDS_DID_ADDID_FA0E, "AirbagDeployment (ISO 26021-2)"}, |
827 | | {UDS_DID_ADDID_FA0F, "AirbagDeployment (ISO 26021-2)"}, |
828 | | {UDS_DID_NOEDRD, "NumberOfEDRDevices"}, |
829 | | {UDS_DID_EDRI, "EDRIdentification"}, |
830 | | {UDS_DID_EDRDAI, "EDRDeviceAddressInformation"}, |
831 | | {UDS_DID_UDSVDID, "UDSVersionDataIdentifier"}, |
832 | | {UDS_DID_RESRVDCPADLC, "ReservedForISO15765-5 (CAN, CAN-FD, CAN+CAN-FD, ...)"}, |
833 | | {0, NULL} |
834 | | }; |
835 | | static value_string_ext uds_standard_did_types_ext = VALUE_STRING_EXT_INIT(_uds_standard_did_types); |
836 | | |
837 | | /* ReservedForISO15765 */ |
838 | | static const value_string uds_did_resrvdcpadlc_types[] = { |
839 | | {0, "CAN Classic Only"}, |
840 | | {1, "CAN FD only"}, |
841 | | {2, "CAN Classic and CAN FD"}, |
842 | | {0, NULL} |
843 | | }; |
844 | | |
845 | | /* RIDS */ |
846 | | static const value_string uds_standard_rid_types[] = { |
847 | | {UDS_RID_EXSPLRI_, "Execute SPL"}, |
848 | | {UDS_RID_DLRI_, "DeployLoopRoutineID"}, |
849 | | {UDS_RID_EM_, "eraseMemory"}, |
850 | | {UDS_RID_CPD_, "checkProgrammingDependencies"}, |
851 | | {UDS_RID_FF02, "eraseMirrorMemoryDTCs (deprecated)"}, |
852 | | {0, NULL} |
853 | | }; |
854 | | |
855 | | /* DTCS */ |
856 | | static const value_string uds_standard_dtc_types[] = { |
857 | | /* TODO: Add DTCs! */ |
858 | | {0, NULL} |
859 | | }; |
860 | | |
861 | | /* ROE */ |
862 | | static const value_string uds_roe_types[] = { |
863 | | {0, "stop"}, |
864 | | {1, "onDTCStatusChange"}, |
865 | | {3, "onChangeOfDataIdentifier"}, |
866 | | {4, "reportActivatedEvents"}, |
867 | | {5, "start"}, |
868 | | {6, "clear"}, |
869 | | {7, "onComparisonOfValues"}, |
870 | | {8, "reportMostRecentDtcOnStatusChange"}, |
871 | | {9, "reportDTCRecordInformationOnDtcStatusChange"}, |
872 | | {0, NULL} |
873 | | }; |
874 | | |
875 | | static const value_string uds_roe_windowtime_types[] = { |
876 | | {2, "infinite"}, |
877 | | {3, "short"}, |
878 | | {4, "medium"}, |
879 | | {5, "long"}, |
880 | | {6, "power"}, |
881 | | {7, "ignition"}, |
882 | | {8, "manufacturerTrigger"}, |
883 | | {0, NULL} |
884 | | }; |
885 | | |
886 | | static const value_string uds_roe_ocov_logic_types[] = { |
887 | | {1, "<"}, |
888 | | {2, ">"}, |
889 | | {3, "="}, |
890 | | {4, "<>"}, |
891 | | {0, NULL} |
892 | | }; |
893 | | |
894 | | static const value_string uds_roe_localisation_sign_types[] = { |
895 | | {0, "without sign"}, |
896 | | {1, "with sign"}, |
897 | | {0, NULL} |
898 | | }; |
899 | | |
900 | | /* |
901 | | * Fields |
902 | | */ |
903 | | |
904 | | static int hf_uds_diag_addr; |
905 | | static int hf_uds_diag_addr_name; |
906 | | static int hf_uds_diag_source_addr; |
907 | | static int hf_uds_diag_source_addr_name; |
908 | | static int hf_uds_diag_target_addr; |
909 | | static int hf_uds_diag_target_addr_name; |
910 | | |
911 | | static int hf_uds_service; |
912 | | static int hf_uds_reply; |
913 | | |
914 | | static int hf_uds_subfunction; |
915 | | static int hf_uds_suppress_pos_rsp_msg_ind; |
916 | | static int hf_uds_data_record; |
917 | | |
918 | | static int hf_uds_compression_method; |
919 | | static int hf_uds_encrypting_method; |
920 | | static int hf_uds_memory_size_length; |
921 | | static int hf_uds_memory_address_length; |
922 | | static int hf_uds_memory_address; |
923 | | static int hf_uds_memory_size; |
924 | | static int hf_uds_max_block_len_len; |
925 | | static int hf_uds_max_block_len; |
926 | | |
927 | | static int hf_uds_dsc_subfunction; |
928 | | static int hf_uds_dsc_suppress_pos_rsp_msg_ind; |
929 | | static int hf_uds_dsc_parameter_record; |
930 | | static int hf_uds_dsc_default_p2_server_timer; |
931 | | static int hf_uds_dsc_enhanced_p2_server_timer; |
932 | | |
933 | | static int hf_uds_er_subfunction; |
934 | | static int hf_uds_er_power_down_time; |
935 | | |
936 | | static int hf_uds_cdtci_group_of_dtc; |
937 | | static int hf_uds_cdtci_memory_selection; |
938 | | |
939 | | static int hf_uds_rdtci_subfunction; |
940 | | static int hf_uds_rdtci_dtc_status_mask; |
941 | | static int hf_uds_rdtci_dtc_status_mask_tf; |
942 | | static int hf_uds_rdtci_dtc_status_mask_tftoc; |
943 | | static int hf_uds_rdtci_dtc_status_mask_pdtc; |
944 | | static int hf_uds_rdtci_dtc_status_mask_cdtc; |
945 | | static int hf_uds_rdtci_dtc_status_mask_tncslc; |
946 | | static int hf_uds_rdtci_dtc_status_mask_tfslc; |
947 | | static int hf_uds_rdtci_dtc_status_mask_tnctoc; |
948 | | static int hf_uds_rdtci_dtc_status_mask_wir; |
949 | | static int hf_uds_rdtci_dtc_mask_record; |
950 | | static int hf_uds_rdtci_dtc_snapshot_rec_no; |
951 | | static int hf_uds_rdtci_dtc_stored_data_rec_no; |
952 | | static int hf_uds_rdtci_dtc_ext_data_rec_no; |
953 | | static int hf_uds_rdtci_memory_selection; |
954 | | static int hf_uds_rdtci_user_def_dtc_snapshot_rec_no; |
955 | | static int hf_uds_rdtci_dtc_severity_mask; |
956 | | static int hf_uds_rdtci_functional_group_id; |
957 | | static int hf_uds_rdtci_dtc_readiness_group_id; |
958 | | static int hf_uds_rdtci_dtc_status_avail; |
959 | | static int hf_uds_rdtci_dtc_status_avail_tf; |
960 | | static int hf_uds_rdtci_dtc_status_avail_tftoc; |
961 | | static int hf_uds_rdtci_dtc_status_avail_pdtc; |
962 | | static int hf_uds_rdtci_dtc_status_avail_cdtc; |
963 | | static int hf_uds_rdtci_dtc_status_avail_tncslc; |
964 | | static int hf_uds_rdtci_dtc_status_avail_tfslc; |
965 | | static int hf_uds_rdtci_dtc_status_avail_tnctoc; |
966 | | static int hf_uds_rdtci_dtc_status_avail_wir; |
967 | | static int hf_uds_rdtci_dtc_id; |
968 | | static int hf_uds_rdtci_dtc_status; |
969 | | static int hf_uds_rdtci_dtc_status_tf; |
970 | | static int hf_uds_rdtci_dtc_status_tftoc; |
971 | | static int hf_uds_rdtci_dtc_status_pdtc; |
972 | | static int hf_uds_rdtci_dtc_status_cdtc; |
973 | | static int hf_uds_rdtci_dtc_status_tncslc; |
974 | | static int hf_uds_rdtci_dtc_status_tfslc; |
975 | | static int hf_uds_rdtci_dtc_status_tnctoc; |
976 | | static int hf_uds_rdtci_dtc_status_wir; |
977 | | static int hf_uds_rdtci_dtc_format_id; |
978 | | static int hf_uds_rdtci_dtc_count; |
979 | | static int hf_uds_rdtci_dtc_snapshot_record_number_of_ids; |
980 | | static int hf_uds_rdtci_dtc_stored_data_record_number_of_ids; |
981 | | static int hf_uds_rdtci_dtc_severity; |
982 | | static int hf_uds_rdtci_dtc_functional_unit; |
983 | | static int hf_uds_rdtci_dtc_fault_detect_counter; |
984 | | static int hf_uds_rdtci_dtc_severity_avail; |
985 | | static int hf_uds_rdtci_record; |
986 | | static int hf_uds_rdtci_record_unparsed; |
987 | | |
988 | | static int hf_uds_rdbi_data_identifier; |
989 | | |
990 | | static int hf_uds_rsdbi_data_identifier; |
991 | | static int hf_uds_rsdbi_scaling_byte; |
992 | | static int hf_uds_rsdbi_scaling_byte_data_type; |
993 | | static int hf_uds_rsdbi_scaling_byte_num_of_bytes; |
994 | | static int hf_uds_rsdbi_validity_mask; |
995 | | static int hf_uds_rsdbi_formula_identifier; |
996 | | static int hf_uds_rsdbi_formula_constant; |
997 | | static int hf_uds_rsdbi_formula_constant_exp; |
998 | | static int hf_uds_rsdbi_formula_constant_mantissa; |
999 | | static int hf_uds_rsdbi_unit; |
1000 | | |
1001 | | static int hf_uds_sa_subfunction; |
1002 | | static int hf_uds_sa_key; |
1003 | | static int hf_uds_sa_seed; |
1004 | | |
1005 | | static int hf_uds_cc_subfunction_no_suppress; |
1006 | | static int hf_uds_cc_comm_type_and_subnet_number; |
1007 | | static int hf_uds_cc_communication_type; |
1008 | | static int hf_uds_cc_subnet_number; |
1009 | | static int hf_uds_cc_node_identifier_number; |
1010 | | |
1011 | | static int hf_uds_ars_subfunction_no_suppress; |
1012 | | static int hf_uds_ars_comm_config; |
1013 | | static int hf_uds_ars_length_of_cert_client; |
1014 | | static int hf_uds_ars_cert_client; |
1015 | | static int hf_uds_ars_length_of_cert_server; |
1016 | | static int hf_uds_ars_cert_server; |
1017 | | static int hf_uds_ars_length_of_challenge_client; |
1018 | | static int hf_uds_ars_challenge_client; |
1019 | | static int hf_uds_ars_length_of_challenge_server; |
1020 | | static int hf_uds_ars_challenge_server; |
1021 | | static int hf_uds_ars_length_of_proof_of_ownership_client; |
1022 | | static int hf_uds_ars_proof_of_ownership_client; |
1023 | | static int hf_uds_ars_length_of_proof_of_ownership_server; |
1024 | | static int hf_uds_ars_proof_of_ownership_server; |
1025 | | static int hf_uds_ars_length_of_ephemeral_public_key_client; |
1026 | | static int hf_uds_ars_ephemeral_public_key_client; |
1027 | | static int hf_uds_ars_length_of_ephemeral_public_key_server; |
1028 | | static int hf_uds_ars_ephemeral_public_key_server; |
1029 | | static int hf_uds_ars_cert_eval_id; |
1030 | | static int hf_uds_ars_length_of_cert_data; |
1031 | | static int hf_uds_ars_cert_data; |
1032 | | static int hf_uds_ars_algo_indicator; |
1033 | | static int hf_uds_ars_length_of_additional_parameter; |
1034 | | static int hf_uds_ars_additional_parameter; |
1035 | | static int hf_uds_ars_length_of_needed_additional_parameter; |
1036 | | static int hf_uds_ars_needed_additional_parameter; |
1037 | | static int hf_uds_ars_auth_ret_param; |
1038 | | static int hf_uds_ars_length_of_session_key_info; |
1039 | | static int hf_uds_ars_session_key_info; |
1040 | | |
1041 | | static int hf_uds_signedCertificate; |
1042 | | |
1043 | | static int hf_uds_rdbpi_transmission_mode; |
1044 | | static int hf_uds_rdbpi_periodic_data_identifier; |
1045 | | |
1046 | | static int hf_uds_dddi_subfunction_no_suppress; |
1047 | | static int hf_uds_dddi_dyn_defined_data_identifier; |
1048 | | static int hf_uds_dddi_source_data_identifier; |
1049 | | static int hf_uds_dddi_position_in_source_data_record; |
1050 | | static int hf_uds_dddi_memory_size; |
1051 | | |
1052 | | static int hf_uds_wdbi_data_identifier; |
1053 | | |
1054 | | static int hf_uds_iocbi_data_identifier; |
1055 | | static int hf_uds_iocbi_parameter; |
1056 | | static int hf_uds_iocbi_state; |
1057 | | |
1058 | | static int hf_uds_rc_subfunction; |
1059 | | static int hf_uds_rc_identifier; |
1060 | | static int hf_uds_rc_option_record; |
1061 | | static int hf_uds_rc_info; |
1062 | | static int hf_uds_rc_status_record; |
1063 | | |
1064 | | static int hf_uds_td_sequence_counter; |
1065 | | static int hf_uds_td_record_data; |
1066 | | |
1067 | | static int hf_uds_rte_record_data; |
1068 | | |
1069 | | static int hf_uds_rft_mode_of_operation; |
1070 | | static int hf_uds_rft_length_of_file_path_and_name; |
1071 | | static int hf_uds_rft_file_path_and_name; |
1072 | | static int hf_uds_rft_file_size_param_length; |
1073 | | static int hf_uds_rft_file_size_uncompressed; |
1074 | | static int hf_uds_rft_file_size_compressed; |
1075 | | static int hf_uds_rft_length_format_identifier; |
1076 | | static int hf_uds_rft_max_num_of_block_length; |
1077 | | static int hf_uds_rft_file_size_or_dir_info_param_length; |
1078 | | static int hf_uds_rft_file_size_uncompressed_or_dir_info_length; |
1079 | | static int hf_uds_rft_file_position; |
1080 | | |
1081 | | static int hf_uds_tp_subfunction_no_suppress; |
1082 | | |
1083 | | static int hf_uds_err_sid; |
1084 | | static int hf_uds_err_code; |
1085 | | |
1086 | | static int hf_uds_sdt_administrative_param; |
1087 | | static int hf_uds_sdt_administrative_param_req; |
1088 | | static int hf_uds_sdt_administrative_param_pre_estab_key; |
1089 | | static int hf_uds_sdt_administrative_param_encrypted; |
1090 | | static int hf_uds_sdt_administrative_param_signed; |
1091 | | static int hf_uds_sdt_administrative_param_resp_sign_req; |
1092 | | static int hf_uds_sdt_signature_encryption_calculation; |
1093 | | static int hf_uds_sdt_signature_length; |
1094 | | static int hf_uds_sdt_anti_replay_counter; |
1095 | | static int hf_uds_sdt_encapsulated_message; |
1096 | | static int hf_uds_sdt_encapsulated_message_sid; |
1097 | | static int hf_uds_sdt_encapsulated_message_sid_reply; |
1098 | | static int hf_uds_sdt_signature_mac; |
1099 | | |
1100 | | static int hf_uds_cdtcs_subfunction; |
1101 | | static int hf_uds_cdtcs_subfunction_no_suppress; |
1102 | | static int hf_uds_cdtcs_subfunction_pos_rsp_msg_ind; |
1103 | | static int hf_uds_cdtcs_option_record; |
1104 | | static int hf_uds_cdtcs_type; |
1105 | | |
1106 | | static int hf_uds_lc_subfunction; |
1107 | | static int hf_uds_lc_subfunction_no_suppress; |
1108 | | static int hf_uds_lc_subfunction_pos_rsp_msg_ind; |
1109 | | static int hf_uds_lc_control_mode_id; |
1110 | | static int hf_uds_lc_link_record; |
1111 | | |
1112 | | static int hf_uds_did_reply_f186_diag_session; |
1113 | | static int hf_uds_did_reply_f190_vin; |
1114 | | static int hf_uds_did_reply_ff00_version; |
1115 | | static int hf_uds_did_reply_ff01_dlc_support; |
1116 | | |
1117 | | static int hf_uds_roe_subfunction; |
1118 | | static int hf_uds_roe_store_flag; |
1119 | | static int hf_uds_roe_window_time; |
1120 | | static int hf_uds_roe_NOIE; |
1121 | | static int hf_uds_roe_EVOAE; |
1122 | | static int hf_uds_roe_dtc_status_mask; |
1123 | | static int hf_uds_roe_dtc_status_mask_TF; |
1124 | | static int hf_uds_roe_dtc_status_mask_TFTOC; |
1125 | | static int hf_uds_roe_dtc_status_mask_PDTC; |
1126 | | static int hf_uds_roe_dtc_status_mask_CDTC; |
1127 | | static int hf_uds_roe_dtc_status_mask_TNCSLC; |
1128 | | static int hf_uds_roe_dtc_status_mask_TFSLC; |
1129 | | static int hf_uds_roe_dtc_status_mask_TNCTOC; |
1130 | | static int hf_uds_roe_dtc_status_mask_WIR; |
1131 | | static int hf_uds_roe_identifier; |
1132 | | static int hf_uds_roe_did; |
1133 | | static int hf_uds_roe_comparison; |
1134 | | static int hf_uds_roe_comparison_value; |
1135 | | static int hf_uds_roe_hysteresis_value; |
1136 | | static int hf_uds_roe_localization; |
1137 | | static int hf_uds_roe_localization_sign; |
1138 | | static int hf_uds_roe_localization_length; |
1139 | | static int hf_uds_roe_localization_offset; |
1140 | | |
1141 | | static int hf_uds_unparsed_bytes; |
1142 | | |
1143 | | /* Expert fields */ |
1144 | | static expert_field ei_uds_length_invalid; |
1145 | | |
1146 | | /* |
1147 | | * Trees |
1148 | | */ |
1149 | | static int ett_uds; |
1150 | | static int ett_uds_subfunction; |
1151 | | static int ett_uds_dtc_status_entry; |
1152 | | static int ett_uds_dtc_status_bits; |
1153 | | static int ett_uds_dtc_snapshot_entry; |
1154 | | static int ett_uds_dtc_counter_entry; |
1155 | | static int ett_uds_dsc_parameter_record; |
1156 | | static int ett_uds_rsdbi_scaling_byte; |
1157 | | static int ett_uds_rsdbi_formula_constant; |
1158 | | static int ett_uds_cc_communication_type; |
1159 | | static int ett_uds_ars_certificate; |
1160 | | static int ett_uds_ars_algo_indicator; |
1161 | | static int ett_uds_dddi_entry; |
1162 | | static int ett_uds_sdt_admin_param; |
1163 | | static int ett_uds_sdt_encap_message; |
1164 | | static int ett_uds_roe_dtc_status_mask; |
1165 | | static int ett_uds_roe_localization; |
1166 | | |
1167 | | static int proto_uds; |
1168 | | |
1169 | | static dissector_handle_t uds_handle; |
1170 | | static dissector_handle_t uds_handle_doip; |
1171 | | static dissector_handle_t uds_handle_hsfz; |
1172 | | static dissector_handle_t uds_handle_iso10681; |
1173 | | static dissector_handle_t uds_handle_iso15765; |
1174 | | static dissector_handle_t obd_ii_handle; |
1175 | | |
1176 | | /*** Subdissectors ***/ |
1177 | | static heur_dissector_list_t heur_subdissector_list; |
1178 | | static heur_dtbl_entry_t *heur_dtbl_entry; |
1179 | | |
1180 | | /*** Configuration ***/ |
1181 | | enum certificate_decoding_strategies { |
1182 | | cert_parsing_off = -1, |
1183 | | ber_cert_single_false = 0, |
1184 | | ber_cert_single_true = 1, |
1185 | | ber_cert_multi_false = 2, |
1186 | | ber_cert_multi_true = 3, |
1187 | | }; |
1188 | | |
1189 | | static const enum_val_t certificate_decoding_vals[] = { |
1190 | | {"0", "BER Certificate w/o implicit tag", ber_cert_single_false}, |
1191 | | {"1", "BER Certificate w implicit tag", ber_cert_single_true}, |
1192 | | {"2", "BER Certificates w/o implicit tag", ber_cert_multi_false}, |
1193 | | {"3", "BER Certificates w implicit tag", ber_cert_multi_true}, |
1194 | | {"off", "Do not parse", cert_parsing_off}, |
1195 | | {NULL, NULL, -1} |
1196 | | }; |
1197 | | |
1198 | | static int uds_certificate_decoding_config = (int)cert_parsing_off; |
1199 | | |
1200 | | static bool uds_dissect_small_sids_with_obd_ii = true; |
1201 | | static bool uds_clear_info_col = false; |
1202 | | |
1203 | | typedef struct _address_string { |
1204 | | unsigned address; |
1205 | | char *name; |
1206 | | } address_string_t; |
1207 | | |
1208 | | static void * |
1209 | 0 | copy_address_string_cb(void *n, const void *o, size_t size _U_) { |
1210 | 0 | address_string_t *new_rec = (address_string_t *)n; |
1211 | 0 | const address_string_t *old_rec = (const address_string_t *)o; |
1212 | |
|
1213 | 0 | new_rec->name = g_strdup(old_rec->name); |
1214 | 0 | new_rec->address = old_rec->address; |
1215 | 0 | return new_rec; |
1216 | 0 | } |
1217 | | |
1218 | | static bool |
1219 | 0 | update_address_string_cb(void *r, char **err) { |
1220 | 0 | address_string_t *rec = (address_string_t *)r; |
1221 | |
|
1222 | 0 | if (rec->name == NULL || rec->name[0] == 0) { |
1223 | 0 | *err = g_strdup("Name cannot be empty"); |
1224 | 0 | return false; |
1225 | 0 | } |
1226 | | |
1227 | 0 | return true; |
1228 | 0 | } |
1229 | | |
1230 | | static void |
1231 | 0 | free_address_string_cb(void *r) { |
1232 | 0 | address_string_t *rec = (address_string_t *)r; |
1233 | | |
1234 | | /* freeing result of g_strdup */ |
1235 | 0 | g_free(rec->name); |
1236 | 0 | rec->name = NULL; |
1237 | 0 | } |
1238 | | |
1239 | | typedef struct _generic_addr_id_string { |
1240 | | uint32_t address; |
1241 | | uint32_t id; |
1242 | | char *name; |
1243 | | } generic_addr_id_string_t; |
1244 | | |
1245 | | static void * |
1246 | 0 | copy_generic_one_id_string_cb(void *n, const void *o, size_t size _U_) { |
1247 | 0 | generic_addr_id_string_t *new_rec = (generic_addr_id_string_t *)n; |
1248 | 0 | const generic_addr_id_string_t *old_rec = (const generic_addr_id_string_t *)o; |
1249 | |
|
1250 | 0 | new_rec->name = g_strdup(old_rec->name); |
1251 | 0 | new_rec->id = old_rec->id; |
1252 | 0 | new_rec->address = old_rec->address; |
1253 | 0 | return new_rec; |
1254 | 0 | } |
1255 | | |
1256 | | static bool |
1257 | 0 | update_generic_addr_16bit_id_var(void *r, char **err, uint32_t limit) { |
1258 | 0 | generic_addr_id_string_t *rec = (generic_addr_id_string_t *)r; |
1259 | |
|
1260 | 0 | if (rec->id > limit) { |
1261 | 0 | *err = ws_strdup_printf("We currently only support identifiers <= %x (Addr: %x ID: %i Name: %s)", limit, rec->address, rec->id, rec->name); |
1262 | 0 | return false; |
1263 | 0 | } |
1264 | | |
1265 | 0 | if (rec->address > 0xffff && rec->address != UINT32_MAX) { |
1266 | 0 | *err = ws_strdup_printf("We currently only support 16 bit addresses with 0xffffffff = \"don't care\" (Addr: %x ID: %i Name: %s)", |
1267 | 0 | rec->address, rec->id, rec->name); |
1268 | 0 | return false; |
1269 | 0 | } |
1270 | | |
1271 | 0 | if (rec->name == NULL || rec->name[0] == 0) { |
1272 | 0 | *err = g_strdup("Name cannot be empty"); |
1273 | 0 | return false; |
1274 | 0 | } |
1275 | | |
1276 | 0 | return true; |
1277 | 0 | } |
1278 | | |
1279 | | static bool |
1280 | 0 | update_generic_addr_16bit_id_16bit(void *r, char **err) { |
1281 | 0 | return update_generic_addr_16bit_id_var(r, err, 0xffff); |
1282 | 0 | } |
1283 | | |
1284 | | static bool |
1285 | 0 | update_generic_addr_16bit_id_24bit(void *r, char **err) { |
1286 | 0 | return update_generic_addr_16bit_id_var(r, err, 0xffffff); |
1287 | 0 | } |
1288 | | |
1289 | | static void |
1290 | 0 | free_generic_one_id_string_cb(void *r) { |
1291 | 0 | generic_addr_id_string_t *rec = (generic_addr_id_string_t *)r; |
1292 | | |
1293 | | /* freeing result of g_strdup */ |
1294 | 0 | g_free(rec->name); |
1295 | 0 | rec->name = NULL; |
1296 | 0 | } |
1297 | | |
1298 | | static uint64_t |
1299 | 2.83k | calc_key(uint32_t addr, uint32_t id) { |
1300 | 2.83k | return ((uint64_t)id << 32) | (uint64_t)addr; |
1301 | 2.83k | } |
1302 | | |
1303 | | static char * |
1304 | 1.41k | generic_lookup_addr_id(uint32_t addr, uint32_t id, GHashTable *ht) { |
1305 | 1.41k | if (ht == NULL) { |
1306 | 0 | return NULL; |
1307 | 0 | } |
1308 | | |
1309 | 1.41k | uint64_t key = calc_key(addr, id); |
1310 | 1.41k | char *ret = g_hash_table_lookup(ht, &key); |
1311 | 1.41k | if (ret == NULL) { |
1312 | 1.41k | key = calc_key(UINT32_MAX, id); |
1313 | 1.41k | ret = g_hash_table_lookup(ht, &key); |
1314 | 1.41k | } |
1315 | | |
1316 | 1.41k | return ret; |
1317 | 1.41k | } |
1318 | | |
1319 | | |
1320 | | /* Routine IDs */ |
1321 | | static generic_addr_id_string_t *uds_uat_routine_ids; |
1322 | | static unsigned uds_uat_routine_id_num; |
1323 | | static GHashTable *uds_ht_routine_ids; |
1324 | | |
1325 | 0 | UAT_HEX_CB_DEF(uds_uat_routine_ids, address, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_routine_ids_address_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_routine_ids_address_tostr_cb |
1326 | 0 | UAT_HEX_CB_DEF(uds_uat_routine_ids, id, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_routine_ids_id_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_routine_ids_id_tostr_cb |
1327 | 0 | UAT_CSTRING_CB_DEF(uds_uat_routine_ids, name, generic_addr_id_string_t) |
1328 | | |
1329 | | static void |
1330 | 15 | reset_update_uds_routine_cb(void) { |
1331 | | /* destroy hash table, if it exists */ |
1332 | 15 | if (uds_ht_routine_ids) { |
1333 | 0 | g_hash_table_destroy(uds_ht_routine_ids); |
1334 | 0 | uds_ht_routine_ids = NULL; |
1335 | 0 | } |
1336 | 15 | } |
1337 | | |
1338 | | static void |
1339 | 15 | post_update_uds_routine_cb(void) { |
1340 | 15 | reset_update_uds_routine_cb(); |
1341 | | |
1342 | | /* create new hash table */ |
1343 | 15 | uds_ht_routine_ids = g_hash_table_new_full(g_int64_hash, g_int64_equal, g_free, NULL); |
1344 | | |
1345 | 15 | for (unsigned i = 0; i < uds_uat_routine_id_num; i++) { |
1346 | 0 | uint64_t *key = g_new(uint64_t, 1); |
1347 | 0 | *key = calc_key(uds_uat_routine_ids[i].address, uds_uat_routine_ids[i].id); |
1348 | 0 | g_hash_table_insert(uds_ht_routine_ids, key, uds_uat_routine_ids[i].name); |
1349 | 0 | } |
1350 | 15 | } |
1351 | | |
1352 | | static const char * |
1353 | 0 | uds_lookup_routine_name(uint32_t addr, uint16_t id) { |
1354 | 0 | const char *tmp = generic_lookup_addr_id(addr, id, uds_ht_routine_ids); |
1355 | |
|
1356 | 0 | if (tmp == NULL) { |
1357 | 0 | tmp = try_val_to_str(id, uds_standard_rid_types); |
1358 | 0 | } |
1359 | |
|
1360 | 0 | return tmp; |
1361 | 0 | } |
1362 | | |
1363 | | static void |
1364 | 0 | protoitem_append_routine_name(proto_item *ti, uint32_t addr, uint16_t data_identifier) { |
1365 | 0 | const char *routine_name = uds_lookup_routine_name(addr, data_identifier); |
1366 | 0 | if (routine_name != NULL) { |
1367 | 0 | proto_item_append_text(ti, " (%s)", routine_name); |
1368 | 0 | } |
1369 | 0 | } |
1370 | | |
1371 | | static void |
1372 | 0 | infocol_append_routine_name(packet_info *pinfo, uint32_t addr, uint16_t routine_identifier) { |
1373 | 0 | const char *routine_name = uds_lookup_routine_name(addr, routine_identifier); |
1374 | 0 | if (routine_name != NULL) { |
1375 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", routine_name); |
1376 | 0 | } |
1377 | 0 | } |
1378 | | |
1379 | | |
1380 | | /* Data IDs */ |
1381 | | static generic_addr_id_string_t *uds_uat_data_ids; |
1382 | | static unsigned uds_uat_data_id_num; |
1383 | | static GHashTable *uds_ht_data_ids; |
1384 | | |
1385 | 0 | UAT_HEX_CB_DEF(uds_uat_data_ids, address, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_data_ids_address_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_data_ids_address_tostr_cb |
1386 | 0 | UAT_HEX_CB_DEF(uds_uat_data_ids, id, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_data_ids_id_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_data_ids_id_tostr_cb |
1387 | 0 | UAT_CSTRING_CB_DEF(uds_uat_data_ids, name, generic_addr_id_string_t) |
1388 | | |
1389 | | static void |
1390 | 15 | reset_update_uds_data_cb(void) { |
1391 | | /* destroy hash table, if it exists */ |
1392 | 15 | if (uds_ht_data_ids) { |
1393 | 0 | g_hash_table_destroy(uds_ht_data_ids); |
1394 | 0 | uds_ht_data_ids = NULL; |
1395 | 0 | } |
1396 | 15 | } |
1397 | | |
1398 | | static void |
1399 | 15 | post_update_uds_data_cb(void) { |
1400 | 15 | reset_update_uds_data_cb(); |
1401 | | |
1402 | | /* create new hash table */ |
1403 | 15 | uds_ht_data_ids = g_hash_table_new_full(g_int64_hash, g_int64_equal, g_free, NULL); |
1404 | | |
1405 | 15 | for (unsigned i = 0; i < uds_uat_data_id_num; i++) { |
1406 | 0 | uint64_t *key = g_new(uint64_t, 1); |
1407 | 0 | *key = calc_key(uds_uat_data_ids[i].address, uds_uat_data_ids[i].id); |
1408 | 0 | g_hash_table_insert(uds_ht_data_ids, key, uds_uat_data_ids[i].name); |
1409 | 0 | } |
1410 | 15 | } |
1411 | | |
1412 | | static const char * |
1413 | 1.41k | uds_lookup_data_name(uint32_t addr, uint16_t id) { |
1414 | 1.41k | const char *tmp = generic_lookup_addr_id(addr, id, uds_ht_data_ids); |
1415 | | |
1416 | 1.41k | if (tmp == NULL) { |
1417 | 1.41k | tmp = try_val_to_str_ext(id, &uds_standard_did_types_ext); |
1418 | 1.41k | } |
1419 | | |
1420 | 1.41k | return tmp; |
1421 | 1.41k | } |
1422 | | |
1423 | | static void |
1424 | 709 | protoitem_append_data_name(proto_item *ti, uint32_t addr, uint16_t data_identifier) { |
1425 | 709 | const char *data_name = uds_lookup_data_name(addr, data_identifier); |
1426 | 709 | if (data_name != NULL) { |
1427 | 10 | proto_item_append_text(ti, " (%s)", data_name); |
1428 | 10 | } |
1429 | 709 | } |
1430 | | |
1431 | | static void |
1432 | 709 | infocol_append_data_name(packet_info *pinfo, uint32_t addr, uint16_t data_identifier) { |
1433 | 709 | const char *data_name = uds_lookup_data_name(addr, data_identifier); |
1434 | 709 | if (data_name != NULL) { |
1435 | 10 | col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", data_name); |
1436 | 10 | } |
1437 | 709 | } |
1438 | | |
1439 | | |
1440 | | /* DTC IDs */ |
1441 | | static generic_addr_id_string_t *uds_uat_dtc_ids; |
1442 | | static unsigned uds_uat_dtc_id_num; |
1443 | | static GHashTable *uds_ht_dtc_ids; |
1444 | | |
1445 | 0 | UAT_HEX_CB_DEF(uds_uat_dtc_ids, address, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_dtc_ids_address_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_dtc_ids_address_tostr_cb |
1446 | 0 | UAT_HEX_CB_DEF(uds_uat_dtc_ids, id, generic_addr_id_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_dtc_ids_id_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_dtc_ids_id_tostr_cb |
1447 | 0 | UAT_CSTRING_CB_DEF(uds_uat_dtc_ids, name, generic_addr_id_string_t) |
1448 | | |
1449 | | static void |
1450 | 15 | reset_update_uds_dtc_cb(void) { |
1451 | | /* destroy hash table, if it exists */ |
1452 | 15 | if (uds_ht_dtc_ids) { |
1453 | 0 | g_hash_table_destroy(uds_ht_dtc_ids); |
1454 | 0 | uds_ht_dtc_ids = NULL; |
1455 | 0 | } |
1456 | 15 | } |
1457 | | |
1458 | | static void |
1459 | 15 | post_update_uds_dtc_cb(void) { |
1460 | 15 | reset_update_uds_dtc_cb(); |
1461 | | |
1462 | | /* create new hash table */ |
1463 | 15 | uds_ht_dtc_ids = g_hash_table_new_full(g_int64_hash, g_int64_equal, g_free, NULL); |
1464 | | |
1465 | 15 | for (unsigned i = 0; i < uds_uat_dtc_id_num; i++) { |
1466 | 0 | uint64_t *key = g_new(uint64_t, 1); |
1467 | 0 | *key = calc_key(uds_uat_dtc_ids[i].address, uds_uat_dtc_ids[i].id); |
1468 | 0 | g_hash_table_insert(uds_ht_dtc_ids, key, uds_uat_dtc_ids[i].name); |
1469 | 0 | } |
1470 | 15 | } |
1471 | | |
1472 | | static const char * |
1473 | 0 | uds_lookup_dtc_name(uint32_t addr, uint32_t id) { |
1474 | 0 | const char *tmp = generic_lookup_addr_id(addr, id, uds_ht_dtc_ids); |
1475 | |
|
1476 | 0 | if (tmp == NULL) { |
1477 | 0 | tmp = try_val_to_str(id, uds_standard_dtc_types); |
1478 | 0 | } |
1479 | |
|
1480 | 0 | return tmp; |
1481 | 0 | } |
1482 | | |
1483 | | static void |
1484 | 0 | protoitem_append_dtc_name(proto_item *ti, uint32_t addr, uint32_t dtc_id) { |
1485 | 0 | const char *dtc_name = uds_lookup_dtc_name(addr, dtc_id); |
1486 | 0 | if (dtc_name != NULL) { |
1487 | 0 | proto_item_append_text(ti, " (%s)", dtc_name); |
1488 | 0 | } |
1489 | 0 | } |
1490 | | |
1491 | | |
1492 | | /* Addresses */ |
1493 | | static address_string_t *uds_uat_addresses; |
1494 | | static unsigned uds_uat_addresses_num; |
1495 | | static GHashTable *uds_ht_addresses; |
1496 | | |
1497 | 0 | UAT_HEX_CB_DEF(uds_uat_addresses, address, address_string_t) Unexecuted instantiation: packet-uds.c:uds_uat_addresses_address_set_cb Unexecuted instantiation: packet-uds.c:uds_uat_addresses_address_tostr_cb |
1498 | 0 | UAT_CSTRING_CB_DEF(uds_uat_addresses, name, address_string_t) |
1499 | | |
1500 | | static void |
1501 | 15 | reset_uds_address_cb(void) { |
1502 | | /* destroy hash table, if it exists */ |
1503 | 15 | if (uds_ht_addresses) { |
1504 | 0 | g_hash_table_destroy(uds_ht_addresses); |
1505 | 0 | uds_ht_addresses = NULL; |
1506 | 0 | } |
1507 | 15 | } |
1508 | | |
1509 | | static void |
1510 | 15 | post_update_uds_address_cb(void) { |
1511 | 15 | reset_uds_address_cb(); |
1512 | | |
1513 | | /* create new hash table */ |
1514 | 15 | uds_ht_addresses = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); |
1515 | | |
1516 | 15 | for (unsigned i = 0; i < uds_uat_addresses_num; i++) { |
1517 | 0 | g_hash_table_insert(uds_ht_addresses, GUINT_TO_POINTER(uds_uat_addresses[i].address), uds_uat_addresses[i].name); |
1518 | 0 | } |
1519 | 15 | } |
1520 | | |
1521 | | static void |
1522 | 360 | uds_proto_item_append_address_name(proto_item *ti, uint32_t addr) { |
1523 | 360 | if (uds_ht_addresses != NULL) { |
1524 | 360 | char *address_name = g_hash_table_lookup(uds_ht_addresses, GUINT_TO_POINTER(addr)); |
1525 | 360 | if (address_name != NULL) { |
1526 | 0 | proto_item_append_text(ti, " (%s)", address_name); |
1527 | 0 | } |
1528 | 360 | } |
1529 | 360 | } |
1530 | | |
1531 | | static proto_item * |
1532 | 240 | uds_proto_tree_add_address_item(proto_tree *tree, int hf, tvbuff_t *tvb, const int offset, const int size, unsigned addr, bool generated, bool hidden) { |
1533 | 240 | proto_item *ti; |
1534 | | |
1535 | 240 | ti = proto_tree_add_uint(tree, hf, tvb, offset, size, addr); |
1536 | 240 | uds_proto_item_append_address_name(ti, addr); |
1537 | | |
1538 | 240 | if (generated) { |
1539 | 240 | proto_item_set_generated(ti); |
1540 | 240 | } |
1541 | | |
1542 | 240 | if (hidden) { |
1543 | 120 | proto_item_set_hidden(ti); |
1544 | 120 | } |
1545 | | |
1546 | 240 | return ti; |
1547 | 240 | } |
1548 | | |
1549 | | static proto_item * |
1550 | 240 | uds_proto_tree_add_address_name(proto_tree *tree, packet_info* pinfo, int hf, tvbuff_t *tvb, const int offset, const int size, unsigned addr) { |
1551 | 240 | proto_item *ti; |
1552 | | |
1553 | 240 | char *address_name = NULL; |
1554 | 240 | if (uds_ht_addresses != NULL) { |
1555 | 240 | address_name = g_hash_table_lookup(uds_ht_addresses, GUINT_TO_POINTER(addr)); |
1556 | 240 | } |
1557 | | |
1558 | 240 | if (address_name != NULL) { |
1559 | 0 | ti = proto_tree_add_string(tree, hf, tvb, offset, size, address_name); |
1560 | 240 | } else { |
1561 | 240 | address_name = wmem_strdup_printf(pinfo->pool, "%d", addr); |
1562 | 240 | ti = proto_tree_add_string(tree, hf, tvb, offset, size, address_name); |
1563 | 240 | } |
1564 | | |
1565 | 240 | proto_item_set_generated(ti); |
1566 | 240 | proto_item_set_hidden(ti); |
1567 | | |
1568 | 240 | return ti; |
1569 | 240 | } |
1570 | | |
1571 | | static void |
1572 | 120 | uds_proto_item_append_address_text(proto_item *ti, uint8_t address_length, const char *name, uint32_t value) { |
1573 | 120 | if (ti == NULL) { |
1574 | 0 | return; |
1575 | 0 | } |
1576 | | |
1577 | 120 | switch (address_length) { |
1578 | 0 | case 1: |
1579 | 0 | proto_item_append_text(ti, ", %s: 0x%02x", name, value); |
1580 | 0 | break; |
1581 | 120 | case 2: |
1582 | 120 | proto_item_append_text(ti, ", %s: 0x%04x", name, value); |
1583 | 120 | break; |
1584 | 120 | } |
1585 | 120 | } |
1586 | | |
1587 | | /*** Configuration End ***/ |
1588 | | |
1589 | | static bool |
1590 | | call_heur_subdissector_uds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *uds_tree, uint8_t service, bool reply, uint32_t id, uint32_t uds_address) |
1591 | 0 | { |
1592 | 0 | uds_info_t uds_info; |
1593 | |
|
1594 | 0 | uds_info.id = id; |
1595 | 0 | uds_info.uds_address = uds_address; |
1596 | 0 | uds_info.reply = reply; |
1597 | 0 | uds_info.service = service; |
1598 | |
|
1599 | 0 | bool ret = dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &heur_dtbl_entry, &uds_info); |
1600 | |
|
1601 | 0 | if (!ret) { |
1602 | 0 | if (service == UDS_SERVICES_RDBI && reply && id == UDS_DID_ADSDID) { |
1603 | 0 | proto_tree_add_item(uds_tree, hf_uds_did_reply_f186_diag_session, tvb, 0, 1, ENC_NA); |
1604 | 0 | return true; |
1605 | 0 | } |
1606 | | |
1607 | 0 | if (service == UDS_SERVICES_RDBI && reply && id == UDS_DID_VINDID) { |
1608 | 0 | proto_tree_add_item(uds_tree, hf_uds_did_reply_f190_vin, tvb, 0, 17, ENC_ASCII); |
1609 | 0 | return true; |
1610 | 0 | } |
1611 | | |
1612 | 0 | if (service == UDS_SERVICES_RDBI && reply && id == UDS_DID_UDSVDID) { |
1613 | 0 | uint32_t tmp = tvb_get_uint32(tvb, 0, ENC_BIG_ENDIAN); |
1614 | 0 | proto_tree_add_uint_format(uds_tree, hf_uds_did_reply_ff00_version, tvb, 0, 4, tmp, "UDS Version: %d.%d.%d.%d", |
1615 | 0 | (tmp & 0xff000000) >> 24, (tmp & 0x00ff0000) >> 16, (tmp & 0x0000ff00) >> 8, tmp & 0x000000ff); |
1616 | 0 | return true; |
1617 | 0 | } |
1618 | | |
1619 | 0 | if (service == UDS_SERVICES_RDBI && reply && id == UDS_DID_RESRVDCPADLC) { |
1620 | 0 | proto_tree_add_item(uds_tree, hf_uds_did_reply_ff01_dlc_support, tvb, 0, 1, ENC_NA); |
1621 | 0 | return true; |
1622 | 0 | } |
1623 | 0 | } |
1624 | | |
1625 | 0 | return ret; |
1626 | 0 | } |
1627 | | |
1628 | | static unsigned |
1629 | 5 | uds_sa_subfunction_to_type(uint8_t subf) { |
1630 | 5 | subf = subf & 0x7f; |
1631 | | |
1632 | 5 | if (subf == 0x00 || ((0x43 <= subf) && (subf <= 0x5e)) || (subf == 0x7f)) { |
1633 | 5 | return UDS_SA_TYPES_RESERVED; |
1634 | 5 | } |
1635 | | |
1636 | 0 | if (subf == 0x5f) { |
1637 | 0 | return UDS_SA_TYPES_REQUEST_SEED_ISO26021; |
1638 | 0 | } |
1639 | | |
1640 | 0 | if (subf == 0x60) { |
1641 | 0 | return UDS_SA_TYPES_SEND_KEY_ISO26021; |
1642 | 0 | } |
1643 | | |
1644 | 0 | if ((0x61 <= subf) && (subf <= 0x7e)) { |
1645 | 0 | return UDS_SA_TYPES_SUPPLIER; |
1646 | 0 | } |
1647 | | |
1648 | 0 | if ((subf & 0x01) == 0x01) { |
1649 | 0 | return UDS_SA_TYPES_REQUEST_SEED; |
1650 | 0 | } |
1651 | | |
1652 | 0 | if ((subf & 0x01) == 0x00) { |
1653 | 0 | return UDS_SA_TYPES_SEND_KEY; |
1654 | 0 | } |
1655 | | |
1656 | 0 | return UDS_SA_TYPES_UNCLEAR; |
1657 | 0 | } |
1658 | | |
1659 | | static char * |
1660 | 3 | uds_sa_subfunction_to_string(uint8_t subf) { |
1661 | 3 | switch (uds_sa_subfunction_to_type(subf)) { |
1662 | 3 | case UDS_SA_TYPES_RESERVED: |
1663 | 3 | return "Reserved"; |
1664 | 0 | case UDS_SA_TYPES_SUPPLIER: |
1665 | 0 | return "System Supplier Specific"; |
1666 | 0 | case UDS_SA_TYPES_REQUEST_SEED: |
1667 | 0 | return "Request Seed"; |
1668 | 0 | case UDS_SA_TYPES_SEND_KEY: |
1669 | 0 | return "Send Key"; |
1670 | 0 | case UDS_SA_TYPES_REQUEST_SEED_ISO26021: |
1671 | 0 | return "Request Seed ISO26021"; |
1672 | 0 | case UDS_SA_TYPES_SEND_KEY_ISO26021: |
1673 | 0 | return "Send Key ISO26021"; |
1674 | 3 | } |
1675 | | |
1676 | 0 | return "Unknown"; |
1677 | 3 | } |
1678 | | |
1679 | | static void |
1680 | 1 | uds_sa_subfunction_format(char *ret, uint32_t value) { |
1681 | 1 | if (uds_sa_subfunction_to_type(value) == UDS_SA_TYPES_UNCLEAR) { |
1682 | 0 | snprintf(ret, ITEM_LABEL_LENGTH, "0x%02x", value); |
1683 | 0 | return; |
1684 | 0 | } |
1685 | | |
1686 | 1 | snprintf(ret, ITEM_LABEL_LENGTH, "%s (0x%02x)", uds_sa_subfunction_to_string(value), value); |
1687 | 1 | } |
1688 | | |
1689 | | static int |
1690 | 0 | dissect_uds_dtc_and_status_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *uds_tree, uint32_t offset, uint32_t ecu_address, bool severity_present, bool func_unit_present) { |
1691 | 0 | static int * const dtc_status_flags[] = { |
1692 | 0 | &hf_uds_rdtci_dtc_status_wir, |
1693 | 0 | &hf_uds_rdtci_dtc_status_tnctoc, |
1694 | 0 | &hf_uds_rdtci_dtc_status_tfslc, |
1695 | 0 | &hf_uds_rdtci_dtc_status_tncslc, |
1696 | 0 | &hf_uds_rdtci_dtc_status_cdtc, |
1697 | 0 | &hf_uds_rdtci_dtc_status_pdtc, |
1698 | 0 | &hf_uds_rdtci_dtc_status_tftoc, |
1699 | 0 | &hf_uds_rdtci_dtc_status_tf, |
1700 | 0 | NULL |
1701 | 0 | }; |
1702 | |
|
1703 | 0 | proto_item *ti_status_record, *ti; |
1704 | 0 | proto_tree *entry_tree; |
1705 | |
|
1706 | 0 | if (severity_present) { |
1707 | 0 | entry_tree = proto_tree_add_subtree(uds_tree, tvb, offset, 4, ett_uds_dtc_status_entry, &ti_status_record, "DTC and Severity Record"); |
1708 | |
|
1709 | 0 | unsigned severity; |
1710 | 0 | proto_tree_add_item_ret_uint(entry_tree, hf_uds_rdtci_dtc_severity, tvb, offset, 1, ENC_NA, &severity); |
1711 | 0 | offset += 1; |
1712 | |
|
1713 | 0 | if (func_unit_present) { |
1714 | 0 | unsigned functional_unit; |
1715 | 0 | proto_tree_add_item_ret_uint(entry_tree, hf_uds_rdtci_dtc_functional_unit, tvb, offset, 1, ENC_NA, &functional_unit); |
1716 | 0 | offset += 1; |
1717 | |
|
1718 | 0 | proto_item_append_text(ti_status_record, ", Severity:0x%02x, Functional Unit:0x%02x", severity, functional_unit); |
1719 | 0 | } else { |
1720 | 0 | proto_item_append_text(ti_status_record, ", Severity:0x%02x", severity); |
1721 | 0 | } |
1722 | 0 | } else { |
1723 | 0 | entry_tree = proto_tree_add_subtree(uds_tree, tvb, offset, 4, ett_uds_dtc_status_entry, &ti_status_record, "DTC and Status Record"); |
1724 | 0 | } |
1725 | |
|
1726 | 0 | unsigned dtc_id; |
1727 | 0 | ti = proto_tree_add_item_ret_uint(entry_tree, hf_uds_rdtci_dtc_id, tvb, offset, 3, ENC_BIG_ENDIAN, &dtc_id); |
1728 | 0 | protoitem_append_dtc_name(ti, ecu_address, dtc_id); |
1729 | 0 | offset += 3; |
1730 | |
|
1731 | 0 | uint64_t dtc_status; |
1732 | 0 | proto_tree_add_bitmask_with_flags_ret_uint64(entry_tree, tvb, offset, hf_uds_rdtci_dtc_status, ett_uds_dtc_status_bits, dtc_status_flags, ENC_NA, BMT_NO_APPEND, &dtc_status); |
1733 | 0 | offset += 1; |
1734 | |
|
1735 | 0 | const char *dtc_name = uds_lookup_dtc_name(ecu_address, dtc_id); |
1736 | 0 | if (dtc_name == NULL) { |
1737 | 0 | proto_item_append_text(ti_status_record, ", DTC:0x%06x, Status:0x%02x", dtc_id, (uint32_t)dtc_status); |
1738 | 0 | } else { |
1739 | 0 | proto_item_append_text(ti_status_record, ", DTC:0x%06x (%s), Status:0x%02x", dtc_id, dtc_name, (uint32_t)dtc_status); |
1740 | 0 | } |
1741 | |
|
1742 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%06x:0x%02x", dtc_id, (uint32_t)dtc_status); |
1743 | |
|
1744 | 0 | return offset; |
1745 | 0 | } |
1746 | | |
1747 | | static int |
1748 | 0 | dissect_uds_dtc_and_fault_detection_counter_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *uds_tree, uint32_t offset, uint32_t ecu_address) { |
1749 | 0 | proto_item *ti_status_record, *ti; |
1750 | 0 | proto_tree *entry_tree; |
1751 | |
|
1752 | 0 | entry_tree = proto_tree_add_subtree(uds_tree, tvb, offset, 4, ett_uds_dtc_counter_entry, &ti_status_record, "DTC and Fault Detection Counter Record"); |
1753 | |
|
1754 | 0 | unsigned dtc_id; |
1755 | 0 | ti = proto_tree_add_item_ret_uint(entry_tree, hf_uds_rdtci_dtc_id, tvb, offset, 3, ENC_BIG_ENDIAN, &dtc_id); |
1756 | 0 | protoitem_append_dtc_name(ti, ecu_address, dtc_id); |
1757 | 0 | offset += 3; |
1758 | |
|
1759 | 0 | unsigned counter; |
1760 | 0 | proto_tree_add_item_ret_uint(entry_tree, hf_uds_rdtci_dtc_fault_detect_counter, tvb, offset, 1, ENC_NA, &counter); |
1761 | 0 | offset += 1; |
1762 | |
|
1763 | 0 | const char *dtc_name = uds_lookup_dtc_name(ecu_address, dtc_id); |
1764 | 0 | if (dtc_name == NULL) { |
1765 | 0 | proto_item_append_text(ti_status_record, ", DTC:0x%06x, Counter:%04d", dtc_id, counter); |
1766 | 0 | } else { |
1767 | 0 | proto_item_append_text(ti_status_record, ", DTC:0x%06x (%s), Counter:%04d", dtc_id, dtc_name, counter); |
1768 | 0 | } |
1769 | |
|
1770 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%06x:%04d", dtc_id, counter); |
1771 | |
|
1772 | 0 | return offset; |
1773 | 0 | } |
1774 | | |
1775 | | static uint32_t |
1776 | 43 | dissect_uds_subfunction(tvbuff_t *tvb, packet_info *pinfo, proto_tree *uds_tree, uint32_t offset, uint32_t *subfunc_value, int hf, const value_string *vs, bool suppress_bit) { |
1777 | 43 | proto_item *ti = proto_tree_add_item(uds_tree, hf_uds_subfunction, tvb, offset, 1, ENC_NA); |
1778 | 43 | proto_tree *subfunction_tree = proto_item_add_subtree(ti, ett_uds_subfunction); |
1779 | 43 | proto_tree_add_item_ret_uint(subfunction_tree, hf, tvb, offset, 1, ENC_NA, subfunc_value); |
1780 | | |
1781 | 43 | if (vs != NULL) { |
1782 | 43 | char* str = val_to_str(pinfo->pool, *subfunc_value, vs, "Unknown (0x%02x)"); |
1783 | 43 | proto_item_append_text(ti, " (%s)", str); |
1784 | 43 | col_append_fstr(pinfo->cinfo, COL_INFO, " SubFunction: %s", str); |
1785 | 43 | } else { |
1786 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " SubFunction: 0x%02x", *subfunc_value); |
1787 | 0 | } |
1788 | | |
1789 | 43 | if (suppress_bit) { |
1790 | 0 | bool suppress; |
1791 | |
|
1792 | 0 | proto_tree_add_item_ret_boolean(subfunction_tree, hf_uds_suppress_pos_rsp_msg_ind, tvb, offset, 1, ENC_NA, &suppress); |
1793 | |
|
1794 | 0 | if (suppress) { |
1795 | 0 | col_append_str(pinfo->cinfo, COL_INFO, " (Reply suppressed)"); |
1796 | 0 | } |
1797 | 0 | } |
1798 | 43 | offset += 1; |
1799 | | |
1800 | 43 | return offset; |
1801 | 43 | } |
1802 | | |
1803 | | static int |
1804 | 1 | dissect_uds_rdtci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *uds_tree, uint32_t ecu_address, uint8_t sid, uint32_t offset, uint32_t data_length) { |
1805 | 1 | uint32_t enum_val; |
1806 | | |
1807 | 1 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_subfunction, tvb, offset, 1, ENC_NA, &enum_val); |
1808 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(pinfo->pool, enum_val, &uds_rdtci_types_ext, "Unknown (0x%02x)")); |
1809 | 1 | offset += 1; |
1810 | | |
1811 | 1 | if (sid & UDS_REPLY_MASK) { |
1812 | 0 | static int * const dtc_status_avail_mask_flags[] = { |
1813 | 0 | &hf_uds_rdtci_dtc_status_avail_wir, |
1814 | 0 | &hf_uds_rdtci_dtc_status_avail_tnctoc, |
1815 | 0 | &hf_uds_rdtci_dtc_status_avail_tfslc, |
1816 | 0 | &hf_uds_rdtci_dtc_status_avail_tncslc, |
1817 | 0 | &hf_uds_rdtci_dtc_status_avail_cdtc, |
1818 | 0 | &hf_uds_rdtci_dtc_status_avail_pdtc, |
1819 | 0 | &hf_uds_rdtci_dtc_status_avail_tftoc, |
1820 | 0 | &hf_uds_rdtci_dtc_status_avail_tf, |
1821 | 0 | NULL |
1822 | 0 | }; |
1823 | |
|
1824 | 0 | switch (enum_val) { |
1825 | 0 | case UDS_RDTCI_TYPES_NUMBER_BY_STATUS_MASK: |
1826 | 0 | case UDS_RDTCI_TYPES_NUM_DTC_BY_SEVERITY_MASK: |
1827 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RNOMMDTCBSM: |
1828 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RNOOEOBDDTCBSM: { |
1829 | 0 | uint64_t dtc_status_avail_mask; |
1830 | 0 | proto_tree_add_bitmask_with_flags_ret_uint64(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_avail, ett_uds_dtc_status_bits, dtc_status_avail_mask_flags, ENC_NA, BMT_NO_APPEND, &dtc_status_avail_mask); |
1831 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x", (uint32_t)dtc_status_avail_mask); |
1832 | 0 | offset += 1; |
1833 | |
|
1834 | 0 | uint32_t dtc_format; |
1835 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_format_id, tvb, offset, 1, ENC_NA, &dtc_format); |
1836 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, dtc_format, uds_rdtci_format_id_types, "Unknown Format (0x%02x)")); |
1837 | 0 | offset += 1; |
1838 | |
|
1839 | 0 | uint32_t dtc_count; |
1840 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_count, tvb, offset, 2, ENC_BIG_ENDIAN, &dtc_count); |
1841 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %d DTCs", dtc_count); |
1842 | 0 | offset += 2; |
1843 | 0 | break; |
1844 | 0 | } |
1845 | | |
1846 | 0 | case UDS_RDTCI_TYPES_BY_STATUS_MASK: |
1847 | 0 | case UDS_RDTCI_TYPES_SUPPORTED_DTC: |
1848 | 0 | case UDS_RDTCI_TYPES_FIRST_TEST_FAILED_DTC: |
1849 | 0 | case UDS_RDTCI_TYPES_FIRST_CONFIRMED_DTC: |
1850 | 0 | case UDS_RDTCI_TYPES_MOST_RECENT_TEST_FAILED: |
1851 | 0 | case UDS_RDTCI_TYPES_MOST_RECENT_CONFIRMED_DTC: |
1852 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RMMDTCBSM: |
1853 | 0 | case UDS_RDTCI_TYPES_OUTDATED_ROBDDTCBSM: |
1854 | 0 | case UDS_RDTCI_TYPES_DTC_WITH_PERM_STATUS: { |
1855 | 0 | uint64_t dtc_status_avail_mask; |
1856 | 0 | proto_tree_add_bitmask_with_flags_ret_uint64(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_avail, ett_uds_dtc_status_bits, dtc_status_avail_mask_flags, ENC_NA, BMT_NO_APPEND, &dtc_status_avail_mask); |
1857 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x", (uint32_t)dtc_status_avail_mask); |
1858 | 0 | offset += 1; |
1859 | |
|
1860 | 0 | while (offset + 4 <= data_length) { |
1861 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1862 | 0 | } |
1863 | 0 | } |
1864 | 0 | break; |
1865 | | |
1866 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_IDENTIFICATION: |
1867 | 0 | while (offset + 4 <= data_length) { |
1868 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1869 | 0 | } |
1870 | 0 | break; |
1871 | | |
1872 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_DTC: { |
1873 | | /* this cannot fully be parsed without configuration data (length of DID data) */ |
1874 | |
|
1875 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1876 | |
|
1877 | 0 | if (offset < data_length) { |
1878 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_snapshot_rec_no, tvb, offset, 1, ENC_NA); |
1879 | 0 | offset += 1; |
1880 | 0 | } |
1881 | |
|
1882 | 0 | if (offset < data_length) { |
1883 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_snapshot_record_number_of_ids, tvb, offset, 1, ENC_NA); |
1884 | 0 | offset += 1; |
1885 | 0 | } |
1886 | |
|
1887 | 0 | if (offset < data_length) { |
1888 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1889 | 0 | offset = data_length; |
1890 | 0 | } |
1891 | 0 | } |
1892 | 0 | break; |
1893 | | |
1894 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_RECORD: { |
1895 | | /* this cannot fully be parsed without configuration data (length of DID data) */ |
1896 | |
|
1897 | 0 | uint32_t count; |
1898 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_stored_data_rec_no, tvb, offset, 1, ENC_NA, &count); |
1899 | 0 | offset += 1; |
1900 | |
|
1901 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %d Stored Data Records: ", count); |
1902 | |
|
1903 | 0 | if (count > 0) { |
1904 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1905 | |
|
1906 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_stored_data_record_number_of_ids, tvb, offset, 1, ENC_NA); |
1907 | 0 | offset += 1; |
1908 | |
|
1909 | 0 | if (offset < data_length) { |
1910 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1911 | 0 | offset = data_length; |
1912 | 0 | } |
1913 | 0 | } |
1914 | 0 | } |
1915 | 0 | break; |
1916 | | |
1917 | 0 | case UDS_RDTCI_TYPES_EXTENDED_RECORD_BY_DTC: |
1918 | | /* this cannot fully be parsed without configuration data (length of DID data) */ |
1919 | |
|
1920 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1921 | |
|
1922 | 0 | if (offset < data_length) { |
1923 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
1924 | 0 | offset += 1; |
1925 | 0 | } |
1926 | |
|
1927 | 0 | if (offset < data_length) { |
1928 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1929 | 0 | offset = data_length; |
1930 | 0 | } |
1931 | 0 | break; |
1932 | | |
1933 | 0 | case UDS_RDTCI_TYPES_BY_SEVERITY_MASK: |
1934 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, true, true); |
1935 | 0 | break; |
1936 | | |
1937 | 0 | case UDS_RDTCI_TYPES_SEVERITY_INFO_OF_DTC: |
1938 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, true, true); |
1939 | |
|
1940 | 0 | while (offset + 6 <= data_length) { |
1941 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, true, true); |
1942 | 0 | } |
1943 | 0 | break; |
1944 | | |
1945 | 0 | case UDS_RDTCI_TYPES_DTC_FAULT_DETECT_CTR: |
1946 | 0 | while (offset + 4 <= data_length) { |
1947 | 0 | offset = dissect_uds_dtc_and_fault_detection_counter_record(tvb, pinfo, uds_tree, offset, ecu_address); |
1948 | 0 | } |
1949 | 0 | break; |
1950 | | |
1951 | 0 | case UDS_RDTCI_TYPES_DTC_EXT_DATA_REC_BY_NUM: |
1952 | | /* this cannot fully be parsed without configuration data (length of data records) */ |
1953 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
1954 | 0 | offset += 1; |
1955 | |
|
1956 | 0 | if (offset < data_length) { |
1957 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1958 | 0 | offset = data_length; |
1959 | 0 | } |
1960 | 0 | break; |
1961 | | |
1962 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_BY_STATUS_M: |
1963 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
1964 | 0 | offset += 1; |
1965 | |
|
1966 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_status_avail, tvb, offset, 1, ENC_NA); |
1967 | 0 | offset += 1; |
1968 | |
|
1969 | 0 | while (offset + 4 <= data_length) { |
1970 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1971 | 0 | } |
1972 | 0 | break; |
1973 | | |
1974 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_REC_BY_DTC_N: |
1975 | | /* this cannot fully be parsed without configuration data (length of DID data) */ |
1976 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
1977 | 0 | offset += 1; |
1978 | |
|
1979 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1980 | |
|
1981 | 0 | if (offset < data_length) { |
1982 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1983 | 0 | offset = data_length; |
1984 | 0 | } |
1985 | 0 | break; |
1986 | | |
1987 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_EXT_REC_BY_N: |
1988 | | /* this cannot fully be parsed without configuration data (length of extended data) */ |
1989 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
1990 | 0 | offset += 1; |
1991 | |
|
1992 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
1993 | |
|
1994 | 0 | if (offset < data_length) { |
1995 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record_unparsed, tvb, offset, data_length - offset, ENC_NA); |
1996 | 0 | offset = data_length; |
1997 | 0 | } |
1998 | 0 | break; |
1999 | | |
2000 | 0 | case UDS_RDTCI_TYPES_SUP_DTC_EXT_RECORD: { |
2001 | 0 | unsigned status; |
2002 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_status_avail, tvb, offset, 1, ENC_NA, &status); |
2003 | 0 | offset += 1; |
2004 | |
|
2005 | 0 | unsigned rec_no; |
2006 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA, &rec_no); |
2007 | 0 | offset += 1; |
2008 | |
|
2009 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x 0x%02x", status, rec_no); |
2010 | |
|
2011 | 0 | while (offset + 4 <= data_length) { |
2012 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
2013 | 0 | } |
2014 | 0 | } |
2015 | 0 | break; |
2016 | | |
2017 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_DTC_BY_MASK_REC: { |
2018 | 0 | unsigned func_group; |
2019 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA, &func_group); |
2020 | 0 | offset += 1; |
2021 | |
|
2022 | 0 | unsigned status; |
2023 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_status_avail, tvb, offset, 1, ENC_NA, &status); |
2024 | 0 | offset += 1; |
2025 | |
|
2026 | 0 | unsigned severity; |
2027 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_severity_avail, tvb, offset, 1, ENC_NA, &severity); |
2028 | 0 | offset += 1; |
2029 | |
|
2030 | 0 | unsigned format; |
2031 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_format_id, tvb, offset, 1, ENC_NA, &format); |
2032 | 0 | offset += 1; |
2033 | |
|
2034 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x 0x%02x 0x%02x 0x%02x", func_group, status, severity, format); |
2035 | |
|
2036 | 0 | while (offset + 5 <= data_length) { |
2037 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, true, false); |
2038 | 0 | } |
2039 | 0 | } |
2040 | 0 | break; |
2041 | | |
2042 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_DTC_PERM_STATUS: { |
2043 | 0 | unsigned func_group; |
2044 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA, &func_group); |
2045 | 0 | offset += 1; |
2046 | |
|
2047 | 0 | unsigned status; |
2048 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_status_avail, tvb, offset, 1, ENC_NA, &status); |
2049 | 0 | offset += 1; |
2050 | |
|
2051 | 0 | unsigned format; |
2052 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_format_id, tvb, offset, 1, ENC_NA, &format); |
2053 | 0 | offset += 1; |
2054 | |
|
2055 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x 0x%02x 0x%02x", func_group, status, format); |
2056 | |
|
2057 | 0 | while (offset + 4 <= data_length) { |
2058 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
2059 | 0 | } |
2060 | 0 | } |
2061 | 0 | break; |
2062 | | |
2063 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_BY_GROUP_READY: { |
2064 | 0 | unsigned func_group; |
2065 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA, &func_group); |
2066 | 0 | offset += 1; |
2067 | |
|
2068 | 0 | unsigned status; |
2069 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_status_avail, tvb, offset, 1, ENC_NA, &status); |
2070 | 0 | offset += 1; |
2071 | |
|
2072 | 0 | unsigned format; |
2073 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_format_id, tvb, offset, 1, ENC_NA, &format); |
2074 | 0 | offset += 1; |
2075 | |
|
2076 | 0 | unsigned readiness; |
2077 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdtci_dtc_readiness_group_id, tvb, offset, 1, ENC_NA, &readiness); |
2078 | 0 | offset += 1; |
2079 | |
|
2080 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x 0x%02x 0x%02x 0x%02x", func_group, status, format, readiness); |
2081 | |
|
2082 | 0 | while (offset + 4 <= data_length) { |
2083 | 0 | offset = dissect_uds_dtc_and_status_record(tvb, pinfo, uds_tree, offset, ecu_address, false, false); |
2084 | 0 | } |
2085 | 0 | } |
2086 | 0 | break; |
2087 | | |
2088 | 0 | default: |
2089 | 0 | if (offset < data_length) { |
2090 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record, tvb, offset, data_length - offset, ENC_NA); |
2091 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2092 | 0 | offset = data_length; |
2093 | 0 | } |
2094 | 0 | } |
2095 | 1 | } else { |
2096 | 1 | static int * const dtc_status_mask_flags[] = { |
2097 | 1 | &hf_uds_rdtci_dtc_status_mask_wir, |
2098 | 1 | &hf_uds_rdtci_dtc_status_mask_tnctoc, |
2099 | 1 | &hf_uds_rdtci_dtc_status_mask_tfslc, |
2100 | 1 | &hf_uds_rdtci_dtc_status_mask_tncslc, |
2101 | 1 | &hf_uds_rdtci_dtc_status_mask_cdtc, |
2102 | 1 | &hf_uds_rdtci_dtc_status_mask_pdtc, |
2103 | 1 | &hf_uds_rdtci_dtc_status_mask_tftoc, |
2104 | 1 | &hf_uds_rdtci_dtc_status_mask_tf, |
2105 | 1 | NULL |
2106 | 1 | }; |
2107 | | |
2108 | 1 | switch (enum_val) { |
2109 | 0 | case UDS_RDTCI_TYPES_NUMBER_BY_STATUS_MASK: |
2110 | 0 | case UDS_RDTCI_TYPES_BY_STATUS_MASK: |
2111 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RMMDTCBSM: |
2112 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RNOMMDTCBSM: |
2113 | 0 | case UDS_RDTCI_TYPES_OUTDATED_RNOOEOBDDTCBSM: |
2114 | 0 | case UDS_RDTCI_TYPES_OUTDATED_ROBDDTCBSM: { |
2115 | 0 | uint64_t status_mask; |
2116 | 0 | proto_tree_add_bitmask_with_flags_ret_uint64(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_mask, ett_uds_dtc_status_bits, dtc_status_mask_flags, ENC_NA, BMT_NO_APPEND, &status_mask); |
2117 | 0 | offset += 1; |
2118 | |
|
2119 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%02x", (uint32_t)status_mask); |
2120 | 0 | } |
2121 | 0 | break; |
2122 | | |
2123 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_IDENTIFICATION: |
2124 | | /* no additional params */ |
2125 | 0 | break; |
2126 | | |
2127 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_DTC: |
2128 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_mask_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
2129 | 0 | offset += 3; |
2130 | |
|
2131 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_snapshot_rec_no, tvb, offset, 1, ENC_NA); |
2132 | 0 | offset += 1; |
2133 | 0 | break; |
2134 | | |
2135 | 0 | case UDS_RDTCI_TYPES_SNAPSHOT_RECORD_BY_RECORD: |
2136 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_stored_data_rec_no, tvb, offset, 1, ENC_NA); |
2137 | 0 | offset += 1; |
2138 | 0 | break; |
2139 | | |
2140 | 0 | case UDS_RDTCI_TYPES_EXTENDED_RECORD_BY_DTC: |
2141 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_mask_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
2142 | 0 | offset += 3; |
2143 | |
|
2144 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
2145 | 0 | offset += 1; |
2146 | 0 | break; |
2147 | | |
2148 | 0 | case UDS_RDTCI_TYPES_NUM_DTC_BY_SEVERITY_MASK: |
2149 | 0 | case UDS_RDTCI_TYPES_BY_SEVERITY_MASK: |
2150 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_severity_mask, tvb, offset, 1, ENC_NA); |
2151 | 0 | offset += 1; |
2152 | |
|
2153 | 0 | proto_tree_add_bitmask(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_mask, ett_uds_dtc_status_bits, dtc_status_mask_flags, ENC_NA); |
2154 | 0 | offset += 1; |
2155 | 0 | break; |
2156 | | |
2157 | 0 | case UDS_RDTCI_TYPES_SEVERITY_INFO_OF_DTC: |
2158 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_mask_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
2159 | 0 | offset += 3; |
2160 | 0 | break; |
2161 | | |
2162 | 0 | case UDS_RDTCI_TYPES_SUPPORTED_DTC: |
2163 | 0 | case UDS_RDTCI_TYPES_FIRST_TEST_FAILED_DTC: |
2164 | 0 | case UDS_RDTCI_TYPES_FIRST_CONFIRMED_DTC: |
2165 | 0 | case UDS_RDTCI_TYPES_MOST_RECENT_TEST_FAILED: |
2166 | 0 | case UDS_RDTCI_TYPES_MOST_RECENT_CONFIRMED_DTC: |
2167 | 0 | case UDS_RDTCI_TYPES_DTC_FAULT_DETECT_CTR: |
2168 | 0 | case UDS_RDTCI_TYPES_DTC_WITH_PERM_STATUS: |
2169 | | /* no additional params */ |
2170 | 0 | break; |
2171 | | |
2172 | 0 | case UDS_RDTCI_TYPES_DTC_EXT_DATA_REC_BY_NUM: |
2173 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
2174 | 0 | offset += 1; |
2175 | 0 | break; |
2176 | | |
2177 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_BY_STATUS_M: |
2178 | 0 | proto_tree_add_bitmask(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_mask, ett_uds_dtc_status_bits, dtc_status_mask_flags, ENC_NA); |
2179 | 0 | offset += 1; |
2180 | |
|
2181 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
2182 | 0 | offset += 1; |
2183 | 0 | break; |
2184 | | |
2185 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_REC_BY_DTC_N: |
2186 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_mask_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
2187 | 0 | offset += 3; |
2188 | |
|
2189 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_user_def_dtc_snapshot_rec_no, tvb, offset, 1, ENC_NA); |
2190 | 0 | offset += 1; |
2191 | |
|
2192 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
2193 | 0 | offset += 1; |
2194 | 0 | break; |
2195 | | |
2196 | 0 | case UDS_RDTCI_TYPES_USER_MEM_DTC_EXT_REC_BY_N: |
2197 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_mask_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
2198 | 0 | offset += 3; |
2199 | |
|
2200 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
2201 | 0 | offset += 1; |
2202 | |
|
2203 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_memory_selection, tvb, offset, 1, ENC_NA); |
2204 | 0 | offset += 1; |
2205 | 0 | break; |
2206 | | |
2207 | 0 | case UDS_RDTCI_TYPES_SUP_DTC_EXT_RECORD: |
2208 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_ext_data_rec_no, tvb, offset, 1, ENC_NA); |
2209 | 0 | offset += 1; |
2210 | 0 | break; |
2211 | | |
2212 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_DTC_BY_MASK_REC: |
2213 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA); |
2214 | 0 | offset += 1; |
2215 | |
|
2216 | 0 | proto_tree_add_bitmask(uds_tree, tvb, offset, hf_uds_rdtci_dtc_status_mask, ett_uds_dtc_status_bits, dtc_status_mask_flags, ENC_NA); |
2217 | 0 | offset += 1; |
2218 | |
|
2219 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_severity_mask, tvb, offset, 1, ENC_NA); |
2220 | 0 | offset += 1; |
2221 | 0 | break; |
2222 | | |
2223 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_DTC_PERM_STATUS: |
2224 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA); |
2225 | 0 | offset += 1; |
2226 | 0 | break; |
2227 | | |
2228 | 0 | case UDS_RDTCI_TYPES_WWH_OBD_BY_GROUP_READY: |
2229 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_functional_group_id, tvb, offset, 1, ENC_NA); |
2230 | 0 | offset += 1; |
2231 | |
|
2232 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdtci_dtc_readiness_group_id, tvb, offset, 1, ENC_NA); |
2233 | 0 | offset += 1; |
2234 | 0 | break; |
2235 | | |
2236 | 1 | default: |
2237 | 1 | if (offset < data_length) { |
2238 | 1 | proto_tree_add_item(uds_tree, hf_uds_rdtci_record, tvb, offset, data_length - offset, ENC_NA); |
2239 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2240 | 1 | offset = data_length; |
2241 | 1 | } |
2242 | 1 | } |
2243 | 1 | } |
2244 | | |
2245 | 0 | return offset; |
2246 | 1 | } |
2247 | | |
2248 | | static int |
2249 | 1 | dissect_uds_memory_addr_size(tvbuff_t *tvb, packet_info *pinfo, proto_tree *uds_tree, uint32_t offset, bool withDataFormatIdentifier) { |
2250 | 1 | proto_item *ti; |
2251 | 1 | uint32_t compression, encrypting; |
2252 | | |
2253 | 1 | if (withDataFormatIdentifier) { |
2254 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_compression_method, tvb, offset, 1, ENC_NA, &compression); |
2255 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_encrypting_method, tvb, offset, 1, ENC_NA, &encrypting); |
2256 | 0 | offset += 1; |
2257 | 0 | } |
2258 | | |
2259 | 1 | uint32_t memory_size_length, memory_address_length; |
2260 | 1 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_memory_size_length, tvb, offset, 1, ENC_NA, &memory_size_length); |
2261 | 1 | if (memory_size_length == 0) { |
2262 | 1 | expert_add_info(pinfo, ti, &ei_uds_length_invalid); |
2263 | 1 | } |
2264 | 1 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_memory_address_length, tvb, offset, 1, ENC_NA, &memory_address_length); |
2265 | 1 | if (memory_address_length == 0) { |
2266 | 0 | expert_add_info(pinfo, ti, &ei_uds_length_invalid); |
2267 | 0 | } |
2268 | 1 | offset += 1; |
2269 | | |
2270 | 1 | uint64_t memory_address; |
2271 | 1 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_memory_address, tvb, offset, memory_address_length, ENC_BIG_ENDIAN, &memory_address); |
2272 | 1 | offset += memory_address_length; |
2273 | | |
2274 | 1 | uint64_t memory_size; |
2275 | 1 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_memory_size, tvb, offset, memory_size_length, ENC_BIG_ENDIAN, &memory_size); |
2276 | 1 | offset += memory_size_length; |
2277 | | |
2278 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%" PRIx64 " bytes at 0x%" PRIx64, memory_size, memory_address); |
2279 | | |
2280 | 1 | if (withDataFormatIdentifier) { |
2281 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " (Compression:0x%x Encrypting:0x%x)", compression, encrypting); |
2282 | 0 | } |
2283 | | |
2284 | 1 | return offset; |
2285 | 1 | } |
2286 | | |
2287 | | static int |
2288 | 0 | dissect_uds_certificates_into_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *ti, uint32_t offset, unsigned length) { |
2289 | 0 | asn1_ctx_t asn1_ctx; |
2290 | |
|
2291 | 0 | if (!tree || !tvb || !ti || length == 0 || uds_certificate_decoding_config == cert_parsing_off) { |
2292 | 0 | return 0; |
2293 | 0 | } |
2294 | | |
2295 | 0 | tvbuff_t *sub_tvb = tvb_new_subset_length(tvb, offset, length); |
2296 | |
|
2297 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
2298 | 0 | proto_tree *cert_tree = proto_item_add_subtree(ti, ett_uds_ars_certificate); |
2299 | |
|
2300 | 0 | switch (uds_certificate_decoding_config) { |
2301 | 0 | case ber_cert_single_false: |
2302 | 0 | return dissect_x509af_Certificate(false, sub_tvb, 0, &asn1_ctx, cert_tree, hf_uds_signedCertificate); |
2303 | | |
2304 | 0 | case ber_cert_single_true: |
2305 | 0 | return dissect_x509af_Certificate(true, sub_tvb, 0, &asn1_ctx, cert_tree, hf_uds_signedCertificate); |
2306 | | |
2307 | 0 | case ber_cert_multi_false: |
2308 | 0 | return dissect_x509af_Certificates(false, sub_tvb, 0, &asn1_ctx, cert_tree, hf_uds_signedCertificate); |
2309 | | |
2310 | 0 | case ber_cert_multi_true: |
2311 | 0 | return dissect_x509af_Certificates(true, sub_tvb, 0, &asn1_ctx, cert_tree, hf_uds_signedCertificate); |
2312 | 0 | } |
2313 | | |
2314 | 0 | return 0; |
2315 | 0 | } |
2316 | | |
2317 | | static int |
2318 | 70 | dissect_uds_internal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t source_address, uint16_t target_address, uint8_t number_of_addresses_valid, uint8_t address_size) { |
2319 | 70 | proto_tree *uds_tree; |
2320 | 70 | proto_tree *subfunction_tree; |
2321 | 70 | proto_item *ti; |
2322 | 70 | uint8_t sid, service; |
2323 | 70 | uint32_t enum_val; |
2324 | 70 | const char *service_name; |
2325 | 70 | uint32_t ecu_address; |
2326 | 70 | uint32_t data_length = tvb_reported_length(tvb); |
2327 | 70 | tvbuff_t *payload_tvb; |
2328 | | |
2329 | 70 | uint32_t offset = 0; |
2330 | | |
2331 | 70 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "UDS"); |
2332 | | |
2333 | 70 | if (uds_clear_info_col) { |
2334 | 0 | col_clear(pinfo->cinfo, COL_INFO); |
2335 | 70 | } else { |
2336 | 70 | col_append_str(pinfo->cinfo, COL_INFO, " "); |
2337 | 70 | } |
2338 | | |
2339 | 70 | sid = tvb_get_uint8(tvb, offset); |
2340 | 70 | service = sid & UDS_SID_MASK; |
2341 | | |
2342 | 70 | if (service < UDS_SERVICES_MIN && uds_dissect_small_sids_with_obd_ii && (obd_ii_handle != NULL)) { |
2343 | 10 | return call_dissector(obd_ii_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree); |
2344 | 10 | } |
2345 | | |
2346 | 60 | service_name = val_to_str_ext(pinfo->pool, service, &uds_services_ext, "Unknown (0x%02x)"); |
2347 | | |
2348 | 60 | col_append_fstr(pinfo->cinfo, COL_INFO, "%-7s %-36s", (sid & UDS_REPLY_MASK)? "Reply": "Request", service_name); |
2349 | | |
2350 | 60 | ti = proto_tree_add_item(tree, proto_uds, tvb, offset, -1, ENC_NA); |
2351 | 60 | uds_tree = proto_item_add_subtree(ti, ett_uds); |
2352 | | |
2353 | 60 | if (sid & UDS_REPLY_MASK) { |
2354 | 48 | ecu_address = source_address; |
2355 | 48 | } else { |
2356 | 12 | ecu_address = target_address; |
2357 | 12 | } |
2358 | | |
2359 | 60 | switch (number_of_addresses_valid) { |
2360 | 0 | case 0: |
2361 | 0 | ecu_address = UINT32_MAX; |
2362 | 0 | break; |
2363 | 0 | case 1: |
2364 | 0 | uds_proto_item_append_address_text(ti, address_size, "Address", source_address); |
2365 | 0 | uds_proto_item_append_address_name(ti, source_address); |
2366 | |
|
2367 | 0 | uds_proto_tree_add_address_item(uds_tree, hf_uds_diag_addr, tvb, 0, 0, source_address, true, false); |
2368 | 0 | uds_proto_tree_add_address_name(uds_tree, pinfo, hf_uds_diag_addr_name, tvb, 0, 0, source_address); |
2369 | 0 | break; |
2370 | 60 | case 2: |
2371 | 60 | uds_proto_item_append_address_text(ti, address_size, "Source", source_address); |
2372 | 60 | uds_proto_item_append_address_name(ti, source_address); |
2373 | 60 | uds_proto_item_append_address_text(ti, address_size, "Target", target_address); |
2374 | 60 | uds_proto_item_append_address_name(ti, target_address); |
2375 | | |
2376 | 60 | uds_proto_tree_add_address_item(uds_tree, hf_uds_diag_source_addr, tvb, 0, 0, source_address, true, false); |
2377 | 60 | uds_proto_tree_add_address_name(uds_tree, pinfo, hf_uds_diag_source_addr_name, tvb, 0, 0, source_address); |
2378 | | |
2379 | 60 | uds_proto_tree_add_address_item(uds_tree, hf_uds_diag_addr, tvb, 0, 0, source_address, true, true); |
2380 | 60 | uds_proto_tree_add_address_name(uds_tree, pinfo, hf_uds_diag_addr_name, tvb, 0, 0, source_address); |
2381 | | |
2382 | 60 | uds_proto_tree_add_address_item(uds_tree, hf_uds_diag_target_addr, tvb, 0, 0, target_address, true, false); |
2383 | 60 | uds_proto_tree_add_address_name(uds_tree, pinfo, hf_uds_diag_target_addr_name, tvb, 0, 0, target_address); |
2384 | | |
2385 | 60 | uds_proto_tree_add_address_item(uds_tree, hf_uds_diag_addr, tvb, 0, 0, target_address, true, true); |
2386 | 60 | uds_proto_tree_add_address_name(uds_tree, pinfo, hf_uds_diag_addr_name, tvb, 0, 0, target_address); |
2387 | 60 | break; |
2388 | 60 | } |
2389 | | |
2390 | 60 | proto_tree_add_item(uds_tree, hf_uds_service, tvb, offset, 1, ENC_NA); |
2391 | 60 | proto_tree_add_item(uds_tree, hf_uds_reply, tvb, offset, 1, ENC_NA); |
2392 | 60 | offset += 1; |
2393 | | |
2394 | 60 | switch (service) { |
2395 | 1 | case UDS_SERVICES_DSC: |
2396 | 1 | { |
2397 | 1 | bool suppress; |
2398 | 1 | proto_tree_add_item_ret_boolean(uds_tree, hf_uds_dsc_suppress_pos_rsp_msg_ind, tvb, offset, 1, ENC_NA, &suppress); |
2399 | 1 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_dsc_subfunction, tvb, offset, 1, ENC_NA, &enum_val); |
2400 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_dsc_types, "Unknown (0x%02x)")); |
2401 | 1 | if (suppress) { |
2402 | 0 | col_append_str(pinfo->cinfo, COL_INFO, " (Reply suppressed)"); |
2403 | 0 | } |
2404 | 1 | } |
2405 | 1 | offset += 1; |
2406 | | |
2407 | 1 | if (sid & UDS_REPLY_MASK) { |
2408 | 1 | ti = proto_tree_add_item(uds_tree, hf_uds_dsc_parameter_record, tvb, offset, data_length - offset, ENC_NA); |
2409 | 1 | proto_tree *param_tree = proto_item_add_subtree(ti, ett_uds_dsc_parameter_record); |
2410 | | |
2411 | 1 | uint32_t default_p2; |
2412 | 1 | proto_tree_add_item_ret_uint(param_tree, hf_uds_dsc_default_p2_server_timer, tvb, offset, 2, ENC_BIG_ENDIAN, &default_p2); |
2413 | 1 | offset += 2; |
2414 | | |
2415 | 1 | uint32_t enhanced_p2 = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN) * 10; |
2416 | 1 | proto_tree_add_uint(param_tree, hf_uds_dsc_enhanced_p2_server_timer, tvb, offset, 2, enhanced_p2); |
2417 | 1 | offset += 2; |
2418 | | |
2419 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " P2-default:%5dms P2-enhanced:%6dms", default_p2, enhanced_p2); |
2420 | 1 | } |
2421 | 1 | break; |
2422 | | |
2423 | 0 | case UDS_SERVICES_ER: |
2424 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_er_subfunction, tvb, offset, 1, ENC_NA, &enum_val); |
2425 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_er_types, "Unknown (0x%02x)")); |
2426 | 0 | offset += 1; |
2427 | |
|
2428 | 0 | if ((sid & UDS_REPLY_MASK) && (enum_val == UDS_ER_TYPES_ENABLE_RAPID_POWER_SHUTDOWN)) { |
2429 | 0 | uint32_t tmp; |
2430 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_er_power_down_time, tvb, offset, 1, ENC_NA, &tmp); |
2431 | 0 | if (tmp == UDS_ER_TYPE_ENABLE_RAPID_POWER_SHUTDOWN_INVALID) { |
2432 | 0 | proto_item_append_text(ti, " (Failure or time not available!)"); |
2433 | 0 | } |
2434 | 0 | offset += 1; |
2435 | 0 | } |
2436 | 0 | break; |
2437 | | |
2438 | 0 | case UDS_SERVICES_CDTCI: |
2439 | 0 | if (sid & UDS_REPLY_MASK) { |
2440 | | /* do nothing */ |
2441 | 0 | } else { |
2442 | 0 | proto_tree_add_item(uds_tree, hf_uds_cdtci_group_of_dtc, tvb, offset, 3, ENC_BIG_ENDIAN); |
2443 | 0 | offset += 3; |
2444 | |
|
2445 | 0 | if (offset + 1 <= data_length) { |
2446 | 0 | proto_tree_add_item(uds_tree, hf_uds_cdtci_memory_selection, tvb, offset, 1, ENC_NA); |
2447 | 0 | } |
2448 | 0 | } |
2449 | 0 | break; |
2450 | | |
2451 | 1 | case UDS_SERVICES_RDTCI: |
2452 | 1 | offset = dissect_uds_rdtci(tvb, pinfo, uds_tree, ecu_address, sid, offset, data_length); |
2453 | 1 | break; |
2454 | | |
2455 | 3 | case UDS_SERVICES_RDBI: |
2456 | 3 | if (sid & UDS_REPLY_MASK) { |
2457 | | /* Can't know the size of the data for each identifier, Decode like if there is only one identifier */ |
2458 | 0 | uint32_t data_identifier; |
2459 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdbi_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &data_identifier); |
2460 | 0 | protoitem_append_data_name(ti, ecu_address, (uint16_t)data_identifier); |
2461 | 0 | offset += 2; |
2462 | |
|
2463 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x", data_identifier); |
2464 | 0 | infocol_append_data_name(pinfo, ecu_address, data_identifier); |
2465 | |
|
2466 | 0 | bool dissection_ok = false; |
2467 | 0 | if (data_length > offset) { |
2468 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2469 | |
|
2470 | 0 | payload_tvb = tvb_new_subset_length(tvb, offset, data_length - offset); |
2471 | 0 | dissection_ok = call_heur_subdissector_uds(payload_tvb, pinfo, tree, uds_tree, service, true, data_identifier, ecu_address); |
2472 | 0 | } |
2473 | |
|
2474 | 0 | if (!dissection_ok) { |
2475 | | /* ISO14229: at least one byte for data record. Just make sure, we show an error, if less than 1 byte left! */ |
2476 | 0 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, MAX(1, data_length - offset), ENC_NA); |
2477 | 0 | } |
2478 | |
|
2479 | 0 | offset = data_length; |
2480 | | |
2481 | |
|
2482 | 3 | } else { |
2483 | | /* ISO14229: data identifiers are 2 bytes and at least one has to be present. */ |
2484 | 711 | do { |
2485 | 711 | uint32_t data_identifier; |
2486 | 711 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdbi_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &data_identifier); |
2487 | 711 | protoitem_append_data_name(ti, ecu_address, (uint16_t)data_identifier); |
2488 | | |
2489 | 711 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x", data_identifier); |
2490 | 711 | infocol_append_data_name(pinfo, ecu_address, data_identifier); |
2491 | 711 | offset += 2; |
2492 | 711 | } while (data_length >= offset + 2); |
2493 | 3 | } |
2494 | 3 | break; |
2495 | | |
2496 | 0 | case UDS_SERVICES_RMBA: |
2497 | 0 | if (sid & UDS_REPLY_MASK) { |
2498 | 0 | if (offset < data_length) { |
2499 | 0 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, data_length - offset, ENC_NA); |
2500 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2501 | 0 | offset = data_length; |
2502 | 0 | } |
2503 | 0 | } else { |
2504 | 0 | offset = dissect_uds_memory_addr_size(tvb, pinfo, uds_tree, offset, false); |
2505 | 0 | } |
2506 | 0 | break; |
2507 | | |
2508 | 3 | case UDS_SERVICES_RSDBI: |
2509 | 3 | proto_tree_add_item(uds_tree, hf_uds_rsdbi_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
2510 | 3 | offset += 2; |
2511 | | |
2512 | 3 | if (sid & UDS_REPLY_MASK) { |
2513 | 87 | do { |
2514 | 87 | proto_tree *tmp_tree; |
2515 | 87 | ti = proto_tree_add_item(uds_tree, hf_uds_rsdbi_scaling_byte, tvb, offset, 1, ENC_NA); |
2516 | 87 | tmp_tree = proto_item_add_subtree(ti, ett_uds_rsdbi_scaling_byte); |
2517 | 87 | unsigned data_type, num_of_bytes; |
2518 | 87 | proto_tree_add_item_ret_uint(tmp_tree, hf_uds_rsdbi_scaling_byte_data_type, tvb, offset, 1, ENC_NA, &data_type); |
2519 | 87 | proto_tree_add_item_ret_uint(tmp_tree, hf_uds_rsdbi_scaling_byte_num_of_bytes, tvb, offset, 1, ENC_NA, &num_of_bytes); |
2520 | 87 | proto_item_append_text(ti, ", %s, %d", val_to_str(pinfo->pool, data_type, uds_rsdbi_data_types, "Unknown (0x%x)"), num_of_bytes); |
2521 | 87 | offset += 1; |
2522 | | |
2523 | | /* lets parse the extension, if needed... */ |
2524 | 87 | unsigned next_pos; |
2525 | 87 | switch (data_type) { |
2526 | 4 | case UDS_RSDBI_DATA_TYPE_BITMAPPED_REPORTED_WO_MAP: |
2527 | 4 | proto_tree_add_item(uds_tree, hf_uds_rsdbi_validity_mask, tvb, offset, num_of_bytes, ENC_NA); |
2528 | 4 | offset += num_of_bytes; |
2529 | 4 | break; |
2530 | 1 | case UDS_RSDBI_DATA_TYPE_FORMULA: |
2531 | 1 | proto_tree_add_item(uds_tree, hf_uds_rsdbi_formula_identifier, tvb, offset, 1, ENC_NA); |
2532 | 1 | next_pos = offset + num_of_bytes; |
2533 | 6 | while (offset + 2 <= next_pos) { |
2534 | 5 | ti = proto_tree_add_item(uds_tree, hf_uds_rsdbi_formula_constant, tvb, offset, 2, ENC_NA); |
2535 | 5 | proto_tree *const_tree = proto_item_add_subtree(ti, ett_uds_rsdbi_formula_constant); |
2536 | 5 | proto_tree_add_item(const_tree, hf_uds_rsdbi_formula_constant_exp, tvb, offset, 2, ENC_BIG_ENDIAN); |
2537 | 5 | proto_tree_add_item(const_tree, hf_uds_rsdbi_formula_constant_mantissa, tvb, offset, 2, ENC_BIG_ENDIAN); |
2538 | 5 | offset += 2; |
2539 | 5 | } |
2540 | 1 | break; |
2541 | 0 | case UDS_RSDBI_DATA_TYPE_UNIT_FORMAT: |
2542 | 0 | proto_tree_add_item(uds_tree, hf_uds_rsdbi_unit, tvb, offset, 1, ENC_NA); |
2543 | 0 | offset += num_of_bytes; |
2544 | 0 | break; |
2545 | 87 | } |
2546 | 87 | } while (offset < data_length); |
2547 | | |
2548 | 2 | } |
2549 | 1 | break; |
2550 | | |
2551 | 1 | case UDS_SERVICES_SA: |
2552 | 1 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_sa_subfunction, tvb, offset, 1, ENC_NA, &enum_val); |
2553 | 1 | proto_item_append_text(ti, " (%s)", uds_sa_subfunction_to_string(enum_val)); |
2554 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s (0x%02x)", uds_sa_subfunction_to_string(enum_val), enum_val); |
2555 | 1 | offset += 1; |
2556 | | |
2557 | 1 | if (data_length > offset) { |
2558 | 1 | if (sid & UDS_REPLY_MASK) { |
2559 | 1 | switch (uds_sa_subfunction_to_type(enum_val)) { |
2560 | 0 | case UDS_SA_TYPES_SEND_KEY: /* fall through */ |
2561 | 0 | case UDS_SA_TYPES_SEND_KEY_ISO26021: |
2562 | | /* do nothing */ |
2563 | 0 | break; |
2564 | 0 | case UDS_SA_TYPES_REQUEST_SEED: /* fall through */ |
2565 | 0 | case UDS_SA_TYPES_REQUEST_SEED_ISO26021: |
2566 | 0 | proto_tree_add_item(uds_tree, hf_uds_sa_seed, tvb, offset, data_length - offset, ENC_NA); |
2567 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2568 | 0 | break; |
2569 | 1 | default: |
2570 | 1 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, data_length - offset, ENC_NA); |
2571 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2572 | 1 | } |
2573 | 1 | } else { |
2574 | 0 | switch (uds_sa_subfunction_to_type(enum_val)) { |
2575 | 0 | case UDS_SA_TYPES_SEND_KEY: /* fall through */ |
2576 | 0 | case UDS_SA_TYPES_SEND_KEY_ISO26021: |
2577 | 0 | proto_tree_add_item(uds_tree, hf_uds_sa_key, tvb, offset, data_length - offset, ENC_NA); |
2578 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2579 | 0 | break; |
2580 | 0 | case UDS_SA_TYPES_REQUEST_SEED: /* fall through */ |
2581 | 0 | case UDS_SA_TYPES_REQUEST_SEED_ISO26021: |
2582 | 0 | default: |
2583 | 0 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, data_length - offset, ENC_NA); |
2584 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2585 | 0 | } |
2586 | 0 | } |
2587 | 0 | offset = data_length; |
2588 | 0 | } |
2589 | 0 | break; |
2590 | | |
2591 | 0 | case UDS_SERVICES_CC: |
2592 | 0 | if (sid & UDS_REPLY_MASK) { |
2593 | 0 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_cc_subfunction_no_suppress, uds_cc_types, false); |
2594 | 0 | } else { |
2595 | 0 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_cc_subfunction_no_suppress, uds_cc_types, true); |
2596 | |
|
2597 | 0 | proto_tree *comm_type_tree; |
2598 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_cc_comm_type_and_subnet_number, tvb, offset, 1, ENC_NA); |
2599 | 0 | comm_type_tree = proto_item_add_subtree(ti, ett_uds_cc_communication_type); |
2600 | 0 | proto_tree_add_item(comm_type_tree, hf_uds_cc_communication_type, tvb, offset, 1, ENC_NA); |
2601 | 0 | proto_tree_add_item(comm_type_tree, hf_uds_cc_subnet_number, tvb, offset, 1, ENC_NA); |
2602 | 0 | offset += 1; |
2603 | |
|
2604 | 0 | if (enum_val == UDS_CC_TYPES_ENABLE_RX_AND_DISABLE_TX_WITH_ENH_ADDR_INFO || enum_val == UDS_CC_TYPES_ENABLE_RX_AND_TX_WITH_ENH_ADDR_INFO) { |
2605 | 0 | proto_tree_add_item(uds_tree, hf_uds_cc_node_identifier_number, tvb, offset, 2, ENC_BIG_ENDIAN); |
2606 | 0 | offset += 2; |
2607 | 0 | } |
2608 | 0 | } |
2609 | 0 | break; |
2610 | | |
2611 | 42 | case UDS_SERVICES_ARS: |
2612 | 42 | if (sid & UDS_REPLY_MASK) { |
2613 | 42 | unsigned length_field; |
2614 | 42 | proto_tree *algo_tree; |
2615 | | |
2616 | 42 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_ars_subfunction_no_suppress, uds_ars_types, false); |
2617 | | |
2618 | 42 | switch (enum_val) { |
2619 | 0 | case UDS_ARS_TYPES_DEAUTHENTICATE: /* fall through */ |
2620 | 0 | case UDS_ARS_TYPES_TRANSMIT_CERTIFICATE: /* fall through */ |
2621 | 0 | case UDS_ARS_TYPES_AUTH_CONFIGURATION: |
2622 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2623 | 0 | offset += 1; |
2624 | 0 | break; |
2625 | | |
2626 | 2 | case UDS_ARS_TYPES_VERIFY_CERT_UNIDIRECTIONAL: |
2627 | 2 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2628 | 2 | offset += 1; |
2629 | | |
2630 | 2 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_challenge_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2631 | 2 | offset += 2; |
2632 | | |
2633 | 2 | proto_tree_add_item(uds_tree, hf_uds_ars_challenge_server, tvb, offset, length_field, ENC_NA); |
2634 | 2 | offset += length_field; |
2635 | | |
2636 | 2 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_ephemeral_public_key_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2637 | 2 | offset += 2; |
2638 | | |
2639 | 2 | if (length_field > 0) { |
2640 | 1 | proto_tree_add_item(uds_tree, hf_uds_ars_ephemeral_public_key_server, tvb, offset, length_field, ENC_NA); |
2641 | 1 | offset += length_field; |
2642 | 1 | } |
2643 | 2 | break; |
2644 | | |
2645 | 0 | case UDS_ARS_TYPES_VERIFY_CERT_BIDIRECTIONAL: |
2646 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2647 | 0 | offset += 1; |
2648 | |
|
2649 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_challenge_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2650 | 0 | offset += 2; |
2651 | |
|
2652 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_challenge_server, tvb, offset, length_field, ENC_NA); |
2653 | 0 | offset += length_field; |
2654 | |
|
2655 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_cert_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2656 | 0 | offset += 2; |
2657 | |
|
2658 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_cert_server, tvb, offset, length_field, ENC_NA); |
2659 | 0 | dissect_uds_certificates_into_tree(tvb, pinfo, uds_tree, ti, offset, length_field); |
2660 | 0 | offset += length_field; |
2661 | |
|
2662 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_proof_of_ownership_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2663 | 0 | offset += 2; |
2664 | |
|
2665 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_proof_of_ownership_server, tvb, offset, length_field, ENC_NA); |
2666 | 0 | offset += length_field; |
2667 | |
|
2668 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_ephemeral_public_key_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2669 | 0 | offset += 2; |
2670 | |
|
2671 | 0 | if (length_field > 0) { |
2672 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_ephemeral_public_key_server, tvb, offset, length_field, ENC_NA); |
2673 | 0 | offset += length_field; |
2674 | 0 | } |
2675 | 0 | break; |
2676 | | |
2677 | 0 | case UDS_ARS_TYPES_PROOF_OF_OWNERSHIP: |
2678 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2679 | 0 | offset += 1; |
2680 | |
|
2681 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_session_key_info, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2682 | 0 | offset += 2; |
2683 | |
|
2684 | 0 | if (length_field > 0) { |
2685 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_session_key_info, tvb, offset, length_field, ENC_NA); |
2686 | 0 | offset += length_field; |
2687 | 0 | } |
2688 | 0 | break; |
2689 | | |
2690 | 39 | case UDS_ARS_TYPES_REQUEST_CHALLENGE_FOR_AUTH: |
2691 | 39 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2692 | 39 | offset += 1; |
2693 | | |
2694 | 39 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_algo_indicator, tvb, offset, 16, ENC_NA); |
2695 | 39 | algo_tree = proto_item_add_subtree(ti, ett_uds_ars_algo_indicator); |
2696 | 39 | dissect_unknown_ber(pinfo, tvb, offset, algo_tree); |
2697 | 39 | offset += 16; |
2698 | | |
2699 | 39 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_challenge_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2700 | 39 | offset += 2; |
2701 | | |
2702 | 39 | proto_tree_add_item(uds_tree, hf_uds_ars_challenge_server, tvb, offset, length_field, ENC_NA); |
2703 | 39 | offset += length_field; |
2704 | | |
2705 | 39 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_needed_additional_parameter, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2706 | 39 | offset += 2; |
2707 | | |
2708 | 39 | if (length_field > 0) { |
2709 | 2 | proto_tree_add_item(uds_tree, hf_uds_ars_needed_additional_parameter, tvb, offset, length_field, ENC_NA); |
2710 | 2 | offset += length_field; |
2711 | 2 | } |
2712 | 39 | break; |
2713 | | |
2714 | 1 | case UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_UNIDIR: |
2715 | 1 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2716 | 1 | offset += 1; |
2717 | | |
2718 | 1 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_algo_indicator, tvb, offset, 16, ENC_NA); |
2719 | 1 | algo_tree = proto_item_add_subtree(ti, ett_uds_ars_algo_indicator); |
2720 | 1 | dissect_unknown_ber(pinfo, tvb, offset, algo_tree); |
2721 | 1 | offset += 16; |
2722 | | |
2723 | 1 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_session_key_info, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2724 | 1 | offset += 2; |
2725 | | |
2726 | 1 | if (length_field > 0) { |
2727 | 1 | proto_tree_add_item(uds_tree, hf_uds_ars_session_key_info, tvb, offset, length_field, ENC_NA); |
2728 | 1 | offset += length_field; |
2729 | 1 | } |
2730 | 1 | break; |
2731 | | |
2732 | 0 | case UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_BIDIR: |
2733 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_auth_ret_param, tvb, offset, 1, ENC_NA); |
2734 | 0 | offset += 1; |
2735 | |
|
2736 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_algo_indicator, tvb, offset, 16, ENC_NA); |
2737 | 0 | algo_tree = proto_item_add_subtree(ti, ett_uds_ars_algo_indicator); |
2738 | 0 | dissect_unknown_ber(pinfo, tvb, offset, algo_tree); |
2739 | 0 | offset += 16; |
2740 | |
|
2741 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_proof_of_ownership_server, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2742 | 0 | offset += 2; |
2743 | |
|
2744 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_proof_of_ownership_server, tvb, offset, length_field, ENC_NA); |
2745 | 0 | offset += length_field; |
2746 | |
|
2747 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_session_key_info, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
2748 | 0 | offset += 2; |
2749 | |
|
2750 | 0 | if (length_field > 0) { |
2751 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_session_key_info, tvb, offset, length_field, ENC_NA); |
2752 | 0 | offset += length_field; |
2753 | 0 | } |
2754 | |
|
2755 | 0 | break; |
2756 | 42 | } |
2757 | 42 | } else { |
2758 | 0 | proto_tree *algo_tree; |
2759 | 0 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_ars_subfunction_no_suppress, uds_ars_types, true); |
2760 | |
|
2761 | 0 | switch (enum_val) { |
2762 | 0 | case UDS_ARS_TYPES_DEAUTHENTICATE: /* fall through */ |
2763 | 0 | case UDS_ARS_TYPES_AUTH_CONFIGURATION: |
2764 | | /* do nothing */ |
2765 | 0 | break; |
2766 | | |
2767 | 0 | case UDS_ARS_TYPES_VERIFY_CERT_UNIDIRECTIONAL: /* fall through */ |
2768 | 0 | case UDS_ARS_TYPES_VERIFY_CERT_BIDIRECTIONAL: { |
2769 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_comm_config, tvb, offset, 1, ENC_NA); |
2770 | 0 | offset += 1; |
2771 | |
|
2772 | 0 | unsigned length_cert_client; |
2773 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_cert_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_cert_client); |
2774 | 0 | offset += 2; |
2775 | |
|
2776 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_cert_client, tvb, offset, length_cert_client, ENC_NA); |
2777 | 0 | dissect_uds_certificates_into_tree(tvb, pinfo, uds_tree, ti, offset, length_cert_client); |
2778 | 0 | offset += length_cert_client; |
2779 | |
|
2780 | 0 | unsigned length_challenge_client; |
2781 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_challenge_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_challenge_client); |
2782 | 0 | offset += 2; |
2783 | |
|
2784 | 0 | if (length_challenge_client > 0 || enum_val == UDS_ARS_TYPES_VERIFY_CERT_BIDIRECTIONAL) { |
2785 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_challenge_client, tvb, offset, length_challenge_client, ENC_NA); |
2786 | 0 | offset += length_challenge_client; |
2787 | 0 | } |
2788 | 0 | } |
2789 | 0 | break; |
2790 | | |
2791 | 0 | case UDS_ARS_TYPES_PROOF_OF_OWNERSHIP: { |
2792 | 0 | unsigned length_proof_of_ownership_client; |
2793 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_proof_of_ownership_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_proof_of_ownership_client); |
2794 | 0 | offset += 2; |
2795 | |
|
2796 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_proof_of_ownership_client, tvb, offset, length_proof_of_ownership_client, ENC_NA); |
2797 | 0 | offset += length_proof_of_ownership_client; |
2798 | |
|
2799 | 0 | unsigned length_ephemeral_public_key_client; |
2800 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_ephemeral_public_key_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_ephemeral_public_key_client); |
2801 | 0 | offset += 2; |
2802 | |
|
2803 | 0 | if (length_ephemeral_public_key_client > 0) { |
2804 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_ephemeral_public_key_client, tvb, offset, length_ephemeral_public_key_client, ENC_NA); |
2805 | 0 | offset += length_ephemeral_public_key_client; |
2806 | 0 | } |
2807 | 0 | } |
2808 | 0 | break; |
2809 | | |
2810 | | |
2811 | 0 | case UDS_ARS_TYPES_TRANSMIT_CERTIFICATE: { |
2812 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_cert_eval_id, tvb, offset, 2, ENC_NA); |
2813 | 0 | offset += 2; |
2814 | |
|
2815 | 0 | unsigned length_cert_data; |
2816 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_cert_data, tvb, offset, 2, ENC_BIG_ENDIAN, &length_cert_data); |
2817 | 0 | offset += 2; |
2818 | |
|
2819 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_cert_data, tvb, offset, length_cert_data, ENC_NA); |
2820 | 0 | offset += length_cert_data; |
2821 | 0 | } |
2822 | 0 | break; |
2823 | | |
2824 | 0 | case UDS_ARS_TYPES_REQUEST_CHALLENGE_FOR_AUTH: { |
2825 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_comm_config, tvb, offset, 1, ENC_NA); |
2826 | 0 | offset += 1; |
2827 | |
|
2828 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_algo_indicator, tvb, offset, 16, ENC_NA); |
2829 | 0 | algo_tree = proto_item_add_subtree(ti, ett_uds_ars_algo_indicator); |
2830 | 0 | dissect_unknown_ber(pinfo, tvb, offset, algo_tree); |
2831 | 0 | offset += 16; |
2832 | 0 | } |
2833 | 0 | break; |
2834 | | |
2835 | 0 | case UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_UNIDIR: /* fall through */ |
2836 | 0 | case UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_BIDIR: { |
2837 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_ars_algo_indicator, tvb, offset, 16, ENC_NA); |
2838 | 0 | algo_tree = proto_item_add_subtree(ti, ett_uds_ars_algo_indicator); |
2839 | 0 | dissect_unknown_ber(pinfo, tvb, offset, algo_tree); |
2840 | 0 | offset += 16; |
2841 | |
|
2842 | 0 | unsigned length_proof_of_ownership_client; |
2843 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_proof_of_ownership_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_proof_of_ownership_client); |
2844 | 0 | offset += 2; |
2845 | |
|
2846 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_proof_of_ownership_client, tvb, offset, length_proof_of_ownership_client, ENC_NA); |
2847 | 0 | offset += length_proof_of_ownership_client; |
2848 | |
|
2849 | 0 | unsigned length_challenge_client; |
2850 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_challenge_client, tvb, offset, 2, ENC_BIG_ENDIAN, &length_challenge_client); |
2851 | 0 | offset += 2; |
2852 | |
|
2853 | 0 | if (length_challenge_client > 0 || enum_val == UDS_ARS_TYPES_VERIFY_PROOF_OF_OWN_BIDIR) { |
2854 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_challenge_client, tvb, offset, length_challenge_client, ENC_NA); |
2855 | 0 | offset += length_challenge_client; |
2856 | 0 | } |
2857 | |
|
2858 | 0 | unsigned length_additional_parameter; |
2859 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_ars_length_of_additional_parameter, tvb, offset, 2, ENC_BIG_ENDIAN, &length_additional_parameter); |
2860 | 0 | offset += 2; |
2861 | |
|
2862 | 0 | if (length_additional_parameter > 0) { |
2863 | 0 | proto_tree_add_item(uds_tree, hf_uds_ars_additional_parameter, tvb, offset, length_additional_parameter, ENC_NA); |
2864 | 0 | offset += length_additional_parameter; |
2865 | 0 | } |
2866 | 0 | } |
2867 | 0 | break; |
2868 | 0 | } |
2869 | 0 | } |
2870 | 1 | break; |
2871 | | |
2872 | 1 | case UDS_SERVICES_RDBPI: |
2873 | 1 | if ((sid & UDS_REPLY_MASK) == 0) { |
2874 | 1 | unsigned transmission_mode; |
2875 | 1 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rdbpi_transmission_mode, tvb, offset, 1, ENC_NA, &transmission_mode); |
2876 | 1 | offset += 1; |
2877 | | |
2878 | | /* For transmission mode 1 (send at slow rate), mode 2 (medium rate), and mode 3 (fast rate), require at least 1 pdid! */ |
2879 | 1 | if (1 <= transmission_mode && transmission_mode <= 3) { |
2880 | 0 | proto_tree_add_item(uds_tree, hf_uds_rdbpi_periodic_data_identifier, tvb, offset, 1, ENC_NA); |
2881 | 0 | offset += 1; |
2882 | 0 | } |
2883 | | |
2884 | 527 | while (offset < data_length) { |
2885 | 526 | proto_tree_add_item(uds_tree, hf_uds_rdbpi_periodic_data_identifier, tvb, offset, 1, ENC_NA); |
2886 | 526 | offset += 1; |
2887 | 526 | } |
2888 | 1 | } |
2889 | 1 | break; |
2890 | | |
2891 | 1 | case UDS_SERVICES_DDDI: |
2892 | 1 | if (sid & UDS_REPLY_MASK) { |
2893 | 1 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_dddi_subfunction_no_suppress, uds_dddi_types, false); |
2894 | | |
2895 | 1 | if (offset + 2 <= data_length) { |
2896 | 1 | proto_tree_add_item(uds_tree, hf_uds_dddi_dyn_defined_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
2897 | 1 | offset += 2; |
2898 | 1 | } |
2899 | 1 | } else { |
2900 | 0 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_dddi_subfunction_no_suppress, uds_dddi_types, true); |
2901 | |
|
2902 | 0 | switch (enum_val) { |
2903 | 0 | case UDS_DDDI_TYPES_DEFINE_BY_IDENTIFIER: |
2904 | 0 | proto_tree_add_item(uds_tree, hf_uds_dddi_dyn_defined_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
2905 | 0 | offset += 2; |
2906 | |
|
2907 | 0 | do { |
2908 | 0 | proto_tree *tmp_tree; |
2909 | 0 | tmp_tree = proto_tree_add_subtree(uds_tree, tvb, offset, 4, ett_uds_dddi_entry, &ti, "Element"); |
2910 | |
|
2911 | 0 | unsigned source_data_id; |
2912 | 0 | proto_tree_add_item_ret_uint(tmp_tree, hf_uds_dddi_source_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &source_data_id); |
2913 | 0 | offset += 2; |
2914 | |
|
2915 | 0 | unsigned position; |
2916 | 0 | proto_tree_add_item_ret_uint(tmp_tree, hf_uds_dddi_position_in_source_data_record, tvb, offset, 1, ENC_NA, &position); |
2917 | 0 | offset += 1; |
2918 | |
|
2919 | 0 | unsigned mem_size; |
2920 | 0 | proto_tree_add_item_ret_uint(tmp_tree, hf_uds_dddi_memory_size, tvb, offset, 1, ENC_NA, &mem_size); |
2921 | 0 | offset += 1; |
2922 | |
|
2923 | 0 | proto_item_append_text(ti, " %d with Source ID 0x%04x and %d byte(s)", position, source_data_id, mem_size); |
2924 | 0 | } while (offset + 4 <= data_length); |
2925 | |
|
2926 | 0 | break; |
2927 | | |
2928 | 0 | case UDS_DDDI_TYPES_DEFINE_BY_MEM_ADDRESS: |
2929 | 0 | proto_tree_add_item(uds_tree, hf_uds_dddi_dyn_defined_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
2930 | 0 | offset += 2; |
2931 | |
|
2932 | 0 | uint32_t memory_size_length, memory_address_length; |
2933 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_memory_size_length, tvb, offset, 1, ENC_NA, &memory_size_length); |
2934 | 0 | if (memory_size_length == 0) { |
2935 | 0 | expert_add_info(pinfo, ti, &ei_uds_length_invalid); |
2936 | 0 | } |
2937 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_memory_address_length, tvb, offset, 1, ENC_NA, &memory_address_length); |
2938 | 0 | if (memory_address_length == 0) { |
2939 | 0 | expert_add_info(pinfo, ti, &ei_uds_length_invalid); |
2940 | 0 | } |
2941 | 0 | offset += 1; |
2942 | 0 | if ((memory_size_length + memory_address_length) == 0) { |
2943 | | /* Avoid an infinite loop if both are invalid. */ |
2944 | 0 | break; |
2945 | 0 | } |
2946 | | |
2947 | 0 | do { |
2948 | 0 | uint64_t memory_address; |
2949 | 0 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_memory_address, tvb, offset, memory_address_length, ENC_BIG_ENDIAN, &memory_address); |
2950 | 0 | offset += memory_address_length; |
2951 | |
|
2952 | 0 | uint64_t memory_size; |
2953 | 0 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_memory_size, tvb, offset, memory_size_length, ENC_BIG_ENDIAN, &memory_size); |
2954 | 0 | offset += memory_size_length; |
2955 | 0 | } while (offset + memory_address_length + memory_size_length <= data_length); |
2956 | 0 | break; |
2957 | | |
2958 | 0 | case UDS_DDDI_TYPES_CLEAR_DYN_DEF_DATA_ID: |
2959 | 0 | if (offset + 2 <= data_length) { |
2960 | 0 | proto_tree_add_item(uds_tree, hf_uds_dddi_dyn_defined_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
2961 | 0 | offset += 2; |
2962 | 0 | } |
2963 | 0 | break; |
2964 | 0 | } |
2965 | 0 | } |
2966 | 1 | break; |
2967 | | |
2968 | 1 | case UDS_SERVICES_WDBI: |
2969 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_wdbi_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &enum_val); |
2970 | 0 | protoitem_append_data_name(ti, ecu_address, (uint16_t)enum_val); |
2971 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x", enum_val); |
2972 | 0 | infocol_append_data_name(pinfo, ecu_address, enum_val); |
2973 | 0 | offset += 2; |
2974 | |
|
2975 | 0 | if (!(sid & UDS_REPLY_MASK)) { |
2976 | 0 | bool dissection_ok = false; |
2977 | 0 | if (data_length > offset) { |
2978 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
2979 | |
|
2980 | 0 | payload_tvb = tvb_new_subset_length(tvb, offset, data_length - offset); |
2981 | 0 | dissection_ok = call_heur_subdissector_uds(payload_tvb, pinfo, tree, uds_tree, service, false, enum_val, ecu_address); |
2982 | 0 | } |
2983 | |
|
2984 | 0 | if (!dissection_ok) { |
2985 | | /* ISO14229: at least one byte for data record. Just make sure, we show an error, if less than 1 byte left! */ |
2986 | 0 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, MAX(1, data_length - offset), ENC_NA); |
2987 | 0 | } |
2988 | |
|
2989 | 0 | offset = data_length; |
2990 | 0 | } |
2991 | 0 | break; |
2992 | | |
2993 | 1 | case UDS_SERVICES_IOCBI: { |
2994 | 1 | uint32_t data_identifier; |
2995 | 1 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_iocbi_data_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &data_identifier); |
2996 | 1 | protoitem_append_data_name(ti, ecu_address, (uint16_t)data_identifier); |
2997 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x", data_identifier); |
2998 | 1 | infocol_append_data_name(pinfo, ecu_address, data_identifier); |
2999 | 1 | offset += 2; |
3000 | | |
3001 | 1 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_iocbi_parameter, tvb, offset, 1, ENC_NA, &enum_val); |
3002 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_iocbi_parameters, "Unknown (0x%02x)")); |
3003 | 1 | offset += 1; |
3004 | | |
3005 | | /* The exact format depends on vehicle manufacturer and config. Not much we can do here. */ |
3006 | 1 | if (data_length > offset) { |
3007 | 1 | proto_tree_add_item(uds_tree, hf_uds_iocbi_state, tvb, offset, data_length - offset, ENC_NA); |
3008 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3009 | 1 | } |
3010 | 1 | offset = data_length; |
3011 | 1 | break; |
3012 | 1 | } |
3013 | | |
3014 | 0 | case UDS_SERVICES_RC: { |
3015 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rc_subfunction, tvb, offset, 1, ENC_NA, &enum_val); |
3016 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_rc_types, "Unknown (0x%02x)")); |
3017 | 0 | offset += 1; |
3018 | |
|
3019 | 0 | uint32_t identifier; |
3020 | 0 | ti = proto_tree_add_item_ret_uint(uds_tree, hf_uds_rc_identifier, tvb, offset, 2, ENC_BIG_ENDIAN, &identifier); |
3021 | 0 | protoitem_append_routine_name(ti, ecu_address, identifier); |
3022 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%04x", identifier); |
3023 | 0 | infocol_append_routine_name(pinfo, ecu_address, identifier); |
3024 | 0 | offset += 2; |
3025 | |
|
3026 | 0 | if (sid & UDS_REPLY_MASK) { |
3027 | 0 | if (data_length > offset) { |
3028 | 0 | uint32_t info; |
3029 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rc_info, tvb, offset, 1, ENC_NA, &info); |
3030 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%x", info); |
3031 | 0 | offset += 1; |
3032 | |
|
3033 | 0 | if (data_length > offset) { |
3034 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3035 | |
|
3036 | 0 | payload_tvb = tvb_new_subset_length(tvb, offset, data_length - offset); |
3037 | 0 | if (!call_heur_subdissector_uds(payload_tvb, pinfo, tree, uds_tree, service, true, identifier, ecu_address)) { |
3038 | 0 | proto_tree_add_item(uds_tree, hf_uds_rc_status_record, tvb, offset, data_length - offset, ENC_NA); |
3039 | 0 | } |
3040 | |
|
3041 | 0 | offset = data_length; |
3042 | 0 | } |
3043 | 0 | } |
3044 | 0 | } else { |
3045 | 0 | if (data_length > offset) { |
3046 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3047 | |
|
3048 | 0 | payload_tvb = tvb_new_subset_length(tvb, offset, data_length - offset); |
3049 | 0 | if (!call_heur_subdissector_uds(payload_tvb, pinfo, tree, uds_tree, service, false, identifier, ecu_address)) { |
3050 | 0 | proto_tree_add_item(uds_tree, hf_uds_rc_option_record, tvb, offset, data_length - offset, ENC_NA); |
3051 | 0 | } |
3052 | |
|
3053 | 0 | offset = data_length; |
3054 | 0 | } |
3055 | 0 | } |
3056 | 0 | break; |
3057 | 1 | } |
3058 | | |
3059 | 0 | case UDS_SERVICES_RD: /* fall through */ |
3060 | 0 | case UDS_SERVICES_RU: |
3061 | 0 | if (sid & UDS_REPLY_MASK) { |
3062 | 0 | uint32_t max_block_length_length; |
3063 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_max_block_len_len, tvb, offset, 1, ENC_NA, &max_block_length_length); |
3064 | 0 | offset += 1; |
3065 | |
|
3066 | 0 | uint64_t max_block_length; |
3067 | 0 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_max_block_len, tvb, offset, max_block_length_length, ENC_BIG_ENDIAN, &max_block_length); |
3068 | 0 | offset += max_block_length_length; |
3069 | |
|
3070 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " Max Block Length 0x%" PRIx64, max_block_length); |
3071 | 0 | } else { |
3072 | 0 | offset = dissect_uds_memory_addr_size(tvb, pinfo, uds_tree, offset, true); |
3073 | 0 | } |
3074 | 0 | break; |
3075 | | |
3076 | 0 | case UDS_SERVICES_TD: { |
3077 | 0 | uint32_t sequence_no; |
3078 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_td_sequence_counter, tvb, offset, 1, ENC_NA, &sequence_no); |
3079 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " Block Sequence Counter %d", sequence_no); |
3080 | 0 | offset += 1; |
3081 | |
|
3082 | 0 | if (data_length > offset) { |
3083 | 0 | proto_tree_add_item(uds_tree, hf_uds_td_record_data, tvb, offset, data_length - offset, ENC_NA); |
3084 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3085 | 0 | offset = data_length; |
3086 | 0 | } |
3087 | 0 | break; |
3088 | 0 | } |
3089 | | |
3090 | 0 | case UDS_SERVICES_RTE: |
3091 | 0 | if (data_length > offset) { |
3092 | 0 | proto_tree_add_item(uds_tree, hf_uds_rte_record_data, tvb, offset, data_length - offset, ENC_NA); |
3093 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3094 | 0 | offset = data_length; |
3095 | 0 | } |
3096 | 0 | break; |
3097 | | |
3098 | 0 | case UDS_SERVICES_RFT: { |
3099 | 0 | unsigned mode_of_op; |
3100 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rft_mode_of_operation, tvb, offset, 1, ENC_NA, &mode_of_op); |
3101 | 0 | offset += 1; |
3102 | |
|
3103 | 0 | if (sid & UDS_REPLY_MASK) { |
3104 | 0 | if (mode_of_op != UDS_RFT_MODE_DELETE_FILE) { |
3105 | 0 | uint32_t length_max_num_block_len; |
3106 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rft_length_format_identifier, tvb, offset, 1, ENC_NA, &length_max_num_block_len); |
3107 | 0 | offset += 1; |
3108 | |
|
3109 | 0 | proto_tree_add_item(uds_tree, hf_uds_rft_max_num_of_block_length, tvb, offset, length_max_num_block_len, ENC_BIG_ENDIAN); |
3110 | 0 | offset += length_max_num_block_len; |
3111 | 0 | } |
3112 | |
|
3113 | 0 | if (mode_of_op != UDS_RFT_MODE_DELETE_FILE) { |
3114 | 0 | proto_tree_add_item(uds_tree, hf_uds_compression_method, tvb, offset, 1, ENC_NA); |
3115 | 0 | proto_tree_add_item(uds_tree, hf_uds_encrypting_method, tvb, offset, 1, ENC_NA); |
3116 | 0 | offset += 1; |
3117 | 0 | } |
3118 | |
|
3119 | 0 | if (mode_of_op != UDS_RFT_MODE_ADD_FILE && mode_of_op != UDS_RFT_MODE_DELETE_FILE && mode_of_op != UDS_RFT_MODE_REPLACE_FILE && mode_of_op != UDS_RFT_MODE_RESUME_FILE) { |
3120 | 0 | unsigned length_field; |
3121 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rft_file_size_or_dir_info_param_length, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
3122 | 0 | offset += 2; |
3123 | |
|
3124 | 0 | proto_tree_add_item(uds_tree, hf_uds_rft_file_size_uncompressed_or_dir_info_length, tvb, offset, length_field, ENC_BIG_ENDIAN); |
3125 | 0 | offset += length_field; |
3126 | |
|
3127 | 0 | if (mode_of_op != UDS_RFT_MODE_READ_DIR) { |
3128 | 0 | proto_tree_add_item(uds_tree, hf_uds_rft_file_size_compressed, tvb, offset, length_field, ENC_BIG_ENDIAN); |
3129 | 0 | offset += length_field; |
3130 | 0 | } |
3131 | 0 | } |
3132 | |
|
3133 | 0 | if (mode_of_op != UDS_RFT_MODE_ADD_FILE && mode_of_op != UDS_RFT_MODE_DELETE_FILE && mode_of_op != UDS_RFT_MODE_REPLACE_FILE && mode_of_op != UDS_RFT_MODE_READ_FILE |
3134 | 0 | && mode_of_op != UDS_RFT_MODE_READ_DIR) { |
3135 | 0 | proto_tree_add_item(uds_tree, hf_uds_rft_file_position, tvb, offset, 8, ENC_BIG_ENDIAN); |
3136 | 0 | offset += 8; |
3137 | 0 | } |
3138 | 0 | } else { |
3139 | 0 | unsigned length_field; |
3140 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rft_length_of_file_path_and_name, tvb, offset, 2, ENC_BIG_ENDIAN, &length_field); |
3141 | 0 | offset += 2; |
3142 | |
|
3143 | 0 | proto_tree_add_item(uds_tree, hf_uds_rft_file_path_and_name, tvb, offset, length_field, ENC_ASCII); |
3144 | 0 | offset += length_field; |
3145 | |
|
3146 | 0 | if (mode_of_op != UDS_RFT_MODE_DELETE_FILE && mode_of_op != UDS_RFT_MODE_READ_DIR) { |
3147 | 0 | proto_tree_add_item(uds_tree, hf_uds_compression_method, tvb, offset, 1, ENC_NA); |
3148 | 0 | proto_tree_add_item(uds_tree, hf_uds_encrypting_method, tvb, offset, 1, ENC_NA); |
3149 | 0 | offset += 1; |
3150 | 0 | } |
3151 | |
|
3152 | 0 | if (mode_of_op != UDS_RFT_MODE_DELETE_FILE && mode_of_op != UDS_RFT_MODE_READ_FILE && mode_of_op != UDS_RFT_MODE_READ_DIR) { |
3153 | 0 | uint32_t fileSizeParameterLength; |
3154 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_rft_file_size_param_length, tvb, offset, 1, ENC_NA, &fileSizeParameterLength); |
3155 | 0 | offset += 1; |
3156 | |
|
3157 | 0 | uint64_t filesize_uncompressed, filesize_compressed; |
3158 | 0 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_rft_file_size_uncompressed, tvb, offset, fileSizeParameterLength, ENC_BIG_ENDIAN, &filesize_uncompressed); |
3159 | 0 | offset += fileSizeParameterLength; |
3160 | |
|
3161 | 0 | proto_tree_add_item_ret_uint64(uds_tree, hf_uds_rft_file_size_compressed, tvb, offset, fileSizeParameterLength, ENC_BIG_ENDIAN, &filesize_compressed); |
3162 | 0 | offset += fileSizeParameterLength; |
3163 | 0 | } |
3164 | |
|
3165 | 0 | } |
3166 | 0 | } |
3167 | 0 | break; |
3168 | | |
3169 | 1 | case UDS_SERVICES_WMBA: |
3170 | 1 | offset = dissect_uds_memory_addr_size(tvb, pinfo, uds_tree, offset, false); |
3171 | | |
3172 | 1 | if (sid & UDS_REPLY_MASK) { |
3173 | | /* do nothing */ |
3174 | 1 | } else { |
3175 | 1 | if (offset < data_length) { |
3176 | 1 | proto_tree_add_item(uds_tree, hf_uds_data_record, tvb, offset, data_length - offset, ENC_NA); |
3177 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3178 | 1 | offset = data_length; |
3179 | 1 | } |
3180 | 1 | } |
3181 | 1 | break; |
3182 | | |
3183 | 0 | case UDS_SERVICES_TP: |
3184 | 0 | offset = dissect_uds_subfunction(tvb, pinfo, uds_tree, offset, &enum_val, hf_uds_tp_subfunction_no_suppress, NULL, !(sid & UDS_REPLY_MASK)); |
3185 | 0 | break; |
3186 | | |
3187 | 0 | case UDS_SERVICES_ERR: |
3188 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_err_sid, tvb, offset, 1, ENC_NA, &enum_val); |
3189 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(pinfo->pool, enum_val, &uds_services_ext, "Unknown (0x%02x)")); |
3190 | 0 | offset += 1; |
3191 | |
|
3192 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_err_code, tvb, offset, 1, ENC_NA, &enum_val); |
3193 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " (NRC: %s)", val_to_str_ext(pinfo->pool, enum_val, &uds_response_codes_ext, "Unknown (0x%02x)")); |
3194 | 0 | offset += 1; |
3195 | 0 | break; |
3196 | | |
3197 | 0 | case UDS_SERVICES_SDT: { |
3198 | 0 | static int * const admin_param_flags[] = { |
3199 | 0 | &hf_uds_sdt_administrative_param_resp_sign_req, |
3200 | 0 | &hf_uds_sdt_administrative_param_signed, |
3201 | 0 | &hf_uds_sdt_administrative_param_encrypted, |
3202 | 0 | &hf_uds_sdt_administrative_param_pre_estab_key, |
3203 | 0 | &hf_uds_sdt_administrative_param_req, |
3204 | 0 | NULL |
3205 | 0 | }; |
3206 | |
|
3207 | 0 | uint64_t addmin_param; |
3208 | 0 | proto_tree_add_bitmask_with_flags_ret_uint64(uds_tree, tvb, offset, hf_uds_sdt_administrative_param, ett_uds_sdt_admin_param, admin_param_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND, &addmin_param); |
3209 | 0 | offset += 2; |
3210 | |
|
3211 | 0 | proto_tree_add_item(uds_tree, hf_uds_sdt_signature_encryption_calculation, tvb, offset, 1, ENC_NA); |
3212 | 0 | offset += 1; |
3213 | |
|
3214 | 0 | uint32_t sig_length; |
3215 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_sdt_signature_length, tvb, offset, 2, ENC_BIG_ENDIAN, &sig_length); |
3216 | 0 | offset += 2; |
3217 | |
|
3218 | 0 | proto_tree_add_item(uds_tree, hf_uds_sdt_anti_replay_counter, tvb, offset, 2, ENC_BIG_ENDIAN); |
3219 | 0 | offset += 2; |
3220 | |
|
3221 | 0 | if (offset + sig_length < data_length) { |
3222 | 0 | uint32_t encap_length = data_length - offset - sig_length; |
3223 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_sdt_encapsulated_message, tvb, offset, encap_length, ENC_NA); |
3224 | |
|
3225 | 0 | if ((addmin_param & UDS_SDT_ADMIN_PARAM_ENCRYPTED) == 0) { |
3226 | 0 | proto_tree *encap_tree = proto_item_add_subtree(ti, ett_uds_sdt_encap_message); |
3227 | 0 | proto_tree_add_item(encap_tree, hf_uds_sdt_encapsulated_message_sid, tvb, offset, 1, ENC_NA); |
3228 | 0 | proto_tree_add_item(encap_tree, hf_uds_sdt_encapsulated_message_sid_reply, tvb, offset, 1, ENC_NA); |
3229 | 0 | } |
3230 | 0 | offset += encap_length; |
3231 | 0 | } |
3232 | |
|
3233 | 0 | proto_tree_add_item(uds_tree, hf_uds_sdt_signature_mac, tvb, offset, sig_length, ENC_NA); |
3234 | 0 | offset += sig_length; |
3235 | |
|
3236 | 0 | } |
3237 | 0 | break; |
3238 | | |
3239 | 0 | case UDS_SERVICES_CDTCS: |
3240 | 0 | if ((sid & UDS_REPLY_MASK)) { |
3241 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_cdtcs_type, tvb, offset, 1, ENC_NA, &enum_val); |
3242 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_cdtcs_types, "Unknown (0x%02x)")); |
3243 | 0 | offset += 1; |
3244 | 0 | } else { |
3245 | 0 | ti = proto_tree_add_item(uds_tree, hf_uds_cdtcs_subfunction, tvb, offset, 1, ENC_NA); |
3246 | 0 | subfunction_tree = proto_item_add_subtree(ti, ett_uds_subfunction); |
3247 | 0 | proto_tree_add_item_ret_uint(subfunction_tree, hf_uds_cdtcs_subfunction_no_suppress, tvb, offset, 1, ENC_NA, &enum_val); |
3248 | 0 | proto_tree_add_item(subfunction_tree, hf_uds_cdtcs_subfunction_pos_rsp_msg_ind, tvb, offset, 1, ENC_NA); |
3249 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_cdtcs_types, "Unknown (0x%02x)")); |
3250 | 0 | offset += 1; |
3251 | |
|
3252 | 0 | if (data_length - offset > 0) { |
3253 | 0 | proto_tree_add_item(uds_tree, hf_uds_cdtcs_option_record, tvb, offset, data_length - offset, ENC_NA); |
3254 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length - offset, ' ')); |
3255 | 0 | offset = data_length; |
3256 | 0 | } |
3257 | 0 | } |
3258 | 0 | break; |
3259 | | |
3260 | 2 | case UDS_SERVICES_ROE: |
3261 | 2 | { |
3262 | 2 | uint32_t eventTypeSubFunc; |
3263 | 2 | proto_tree_add_item_ret_uint( uds_tree, hf_uds_roe_subfunction, tvb, offset, 1, ENC_BIG_ENDIAN, &eventTypeSubFunc); |
3264 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_store_flag, tvb, offset, 1, ENC_BIG_ENDIAN); |
3265 | 2 | offset += 1; |
3266 | 2 | col_add_fstr( pinfo->cinfo, COL_INFO, "%s %s : %s" |
3267 | 2 | , sid & UDS_REPLY_MASK ? "Replay " : "Request" |
3268 | 2 | , val_to_str_const( UDS_SERVICES_ROE, _uds_services, "") |
3269 | 2 | , val_to_str_const( eventTypeSubFunc & UDS_ROE_SUBFUNC_MASK, uds_roe_types, "Unknown subfunction")); |
3270 | 2 | if( sid & UDS_REPLY_MASK) |
3271 | 0 | { |
3272 | 0 | uint32_t numOfEvents; |
3273 | 0 | proto_tree_add_item_ret_uint( uds_tree, hf_uds_roe_NOIE, tvb, offset, 1, ENC_NA, &numOfEvents); |
3274 | 0 | offset += 1; |
3275 | 0 | if( eventTypeSubFunc != UDS_ROE_SUBF_RAE) |
3276 | 0 | { |
3277 | 0 | proto_tree_add_item( uds_tree, hf_uds_roe_window_time, tvb, offset, 1, ENC_NA); |
3278 | 0 | offset += 1; |
3279 | 0 | } |
3280 | 0 | else |
3281 | 0 | { |
3282 | 0 | if( numOfEvents) |
3283 | 0 | { |
3284 | | /* here only the first head can be easy parsed, because information of the request is required */ |
3285 | 0 | proto_tree_add_item( uds_tree, hf_uds_roe_EVOAE, tvb, offset, 1, ENC_NA); |
3286 | 0 | offset += 1; |
3287 | 0 | proto_tree_add_item( uds_tree, hf_uds_roe_window_time, tvb, offset, 1, ENC_NA); |
3288 | 0 | offset += 1; |
3289 | 0 | } |
3290 | 0 | } |
3291 | 0 | } |
3292 | 2 | else /* request */ |
3293 | 2 | { |
3294 | 2 | static int * const uds_roe_tdc_status_mask_fields[] = { |
3295 | 2 | &hf_uds_roe_dtc_status_mask_TF , |
3296 | 2 | &hf_uds_roe_dtc_status_mask_TFTOC , |
3297 | 2 | &hf_uds_roe_dtc_status_mask_PDTC , |
3298 | 2 | &hf_uds_roe_dtc_status_mask_CDTC , |
3299 | 2 | &hf_uds_roe_dtc_status_mask_TNCSLC, |
3300 | 2 | &hf_uds_roe_dtc_status_mask_TFSLC , |
3301 | 2 | &hf_uds_roe_dtc_status_mask_TNCTOC, |
3302 | 2 | &hf_uds_roe_dtc_status_mask_WIR , |
3303 | 2 | NULL |
3304 | 2 | }; |
3305 | | |
3306 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_window_time, tvb, offset, 1, ENC_NA); |
3307 | 2 | offset += 1; |
3308 | 2 | switch( eventTypeSubFunc) |
3309 | 2 | { |
3310 | 0 | case UDS_ROE_SUBF_ONDTCS: |
3311 | 0 | { |
3312 | 0 | proto_tree_add_bitmask( uds_tree, tvb, offset, hf_uds_roe_dtc_status_mask, ett_uds_roe_dtc_status_mask, uds_roe_tdc_status_mask_fields, ENC_NA); |
3313 | 0 | offset += 1; |
3314 | 0 | break; |
3315 | 0 | } |
3316 | 0 | case UDS_ROE_SUBF_OCODID: |
3317 | 0 | { |
3318 | 0 | proto_tree_add_item( uds_tree, hf_uds_roe_identifier, tvb, offset, 2, ENC_BIG_ENDIAN); |
3319 | 0 | offset += 2; |
3320 | 0 | break; |
3321 | 0 | } |
3322 | 2 | case UDS_ROE_SUBF_OCOV: |
3323 | 2 | { |
3324 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_did, tvb, offset, 2, ENC_BIG_ENDIAN); |
3325 | 2 | offset += 2; |
3326 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_comparison, tvb, offset, 1, ENC_NA); |
3327 | 2 | offset += 1; |
3328 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_comparison_value, tvb, offset, 4, ENC_BIG_ENDIAN); |
3329 | 2 | offset += 4; |
3330 | 2 | proto_tree_add_item( uds_tree, hf_uds_roe_hysteresis_value, tvb, offset, 1, ENC_NA); |
3331 | 2 | offset += 1; |
3332 | 2 | static int * const uds_roe_localization_fields[] = { |
3333 | 2 | &hf_uds_roe_localization_sign, |
3334 | 2 | &hf_uds_roe_localization_length, |
3335 | 2 | &hf_uds_roe_localization_offset, |
3336 | 2 | NULL |
3337 | 2 | }; |
3338 | 2 | proto_tree_add_bitmask( uds_tree, tvb, offset, hf_uds_roe_localization, ett_uds_roe_localization, uds_roe_localization_fields, ENC_BIG_ENDIAN); |
3339 | 2 | offset += 2; |
3340 | 2 | break; |
3341 | 0 | } |
3342 | 0 | case UDS_ROE_SUBF_RMRDOSC: |
3343 | 0 | { |
3344 | 0 | proto_tree_add_item( uds_tree, hf_uds_rdtci_subfunction, tvb, offset, 1, ENC_NA); |
3345 | 0 | offset += 1; |
3346 | 0 | break; |
3347 | 0 | } |
3348 | 0 | case UDS_ROE_SUBF_RDRIODSC: |
3349 | 0 | { |
3350 | 0 | proto_tree_add_bitmask( uds_tree, tvb, offset, hf_uds_roe_dtc_status_mask, ett_uds_roe_dtc_status_mask, uds_roe_tdc_status_mask_fields, ENC_NA); |
3351 | 0 | offset += 1; |
3352 | 0 | uint32_t rdtci_subfunction; |
3353 | 0 | proto_tree_add_item_ret_uint( uds_tree, hf_uds_rdtci_subfunction, tvb, offset, 1, ENC_NA, &rdtci_subfunction); |
3354 | 0 | offset += 1; |
3355 | | /* here a more detailed dissector can be implemented which covers the ReadDTCinformation similar to Service above*/ |
3356 | 0 | break; |
3357 | 0 | } |
3358 | 2 | } |
3359 | 2 | } |
3360 | 2 | break; |
3361 | 2 | } |
3362 | 2 | case UDS_SERVICES_LC: |
3363 | 1 | ti = proto_tree_add_item(uds_tree, hf_uds_lc_subfunction, tvb, offset, 1, ENC_NA); |
3364 | | /* do not increase offset, since reply uses the same byte with different mask! */ |
3365 | | |
3366 | 1 | subfunction_tree = proto_item_add_subtree(ti, ett_uds_subfunction); |
3367 | 1 | proto_tree_add_item_ret_uint(subfunction_tree, hf_uds_lc_subfunction_no_suppress, tvb, offset, 1, ENC_NA, &enum_val); |
3368 | | |
3369 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(pinfo->pool, enum_val, uds_lc_types, "Unknown (0x%02x)")); |
3370 | | |
3371 | 1 | if (sid & UDS_REPLY_MASK) { |
3372 | 1 | offset += 1; |
3373 | 1 | } else { |
3374 | 0 | proto_tree_add_item(subfunction_tree, hf_uds_lc_subfunction_pos_rsp_msg_ind, tvb, offset, 1, ENC_NA); |
3375 | 0 | offset += 1; |
3376 | |
|
3377 | 0 | switch (enum_val) { |
3378 | 0 | case UDS_LC_TYPES_VMTWFP: { |
3379 | 0 | unsigned control_mode_id; |
3380 | 0 | proto_tree_add_item_ret_uint(uds_tree, hf_uds_lc_control_mode_id, tvb, offset, 1, ENC_NA, &control_mode_id); |
3381 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(pinfo->pool, control_mode_id, uds_lc_lcmi_types, "Unknown (0x%02x)")); |
3382 | 0 | offset += 1; |
3383 | 0 | } |
3384 | 0 | break; |
3385 | | |
3386 | 0 | case UDS_LC_TYPES_VMTWSP: |
3387 | 0 | proto_tree_add_item(uds_tree, hf_uds_lc_link_record, tvb, offset, 3, ENC_BIG_ENDIAN); |
3388 | 0 | offset += 3; |
3389 | 0 | break; |
3390 | | |
3391 | 0 | case UDS_LC_TYPES_TM: |
3392 | | /* do nothing */ |
3393 | 0 | break; |
3394 | 0 | } |
3395 | 0 | } |
3396 | 1 | break; |
3397 | 60 | } |
3398 | | |
3399 | 8 | if (data_length - offset > 0) { |
3400 | 8 | proto_tree_add_item(uds_tree, hf_uds_unparsed_bytes, tvb, offset, data_length - offset, ENC_NA); |
3401 | 8 | } |
3402 | | |
3403 | 8 | return data_length; |
3404 | 60 | } |
3405 | | |
3406 | | static int |
3407 | 0 | dissect_uds_no_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { |
3408 | 0 | return dissect_uds_internal(tvb, pinfo, tree, 0, 0, 0, 0); |
3409 | 0 | } |
3410 | | |
3411 | | static int |
3412 | 70 | dissect_uds_doip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
3413 | 70 | DISSECTOR_ASSERT(data); |
3414 | | |
3415 | 70 | doip_info_t *doip_info = (doip_info_t *)data; |
3416 | 70 | return dissect_uds_internal(tvb, pinfo, tree, doip_info->source_address, doip_info->target_address, 2, 2); |
3417 | 70 | } |
3418 | | |
3419 | | static int |
3420 | 0 | dissect_uds_hsfz(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
3421 | 0 | DISSECTOR_ASSERT(data); |
3422 | |
|
3423 | 0 | hsfz_info_t *hsfz_info = (hsfz_info_t *)data; |
3424 | 0 | return dissect_uds_internal(tvb, pinfo, tree, hsfz_info->source_address, hsfz_info->target_address, 2, 1); |
3425 | 0 | } |
3426 | | |
3427 | | static int |
3428 | 0 | dissect_uds_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
3429 | 0 | DISSECTOR_ASSERT(data); |
3430 | |
|
3431 | 0 | iso15765_info_t *info = (iso15765_info_t *)data; |
3432 | 0 | return dissect_uds_internal(tvb, pinfo, tree, info->source_address, info->target_address, info->number_of_addresses_valid, info->address_length); |
3433 | 0 | } |
3434 | | |
3435 | | static int |
3436 | 0 | dissect_uds_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
3437 | 0 | DISSECTOR_ASSERT(data); |
3438 | |
|
3439 | 0 | iso10681_info_t *info = (iso10681_info_t *)data; |
3440 | 0 | return dissect_uds_internal(tvb, pinfo, tree, info->source_address, info->target_address, 2, 2); |
3441 | 0 | } |
3442 | | |
3443 | | void |
3444 | 15 | proto_register_uds(void) { |
3445 | 15 | module_t *uds_module; |
3446 | 15 | expert_module_t *uds_expert_module; |
3447 | | |
3448 | 15 | static hf_register_info hf[] = { |
3449 | 15 | { &hf_uds_diag_addr, { |
3450 | 15 | "Diagnostic Address", "uds.diag_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3451 | 15 | { &hf_uds_diag_addr_name, { |
3452 | 15 | "Diagnostic Address Name", "uds.diag_addr_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3453 | 15 | { &hf_uds_diag_source_addr, { |
3454 | 15 | "Diagnostic Source Address", "uds.diag_addr_source", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3455 | 15 | { &hf_uds_diag_source_addr_name, { |
3456 | 15 | "Diagnostic Source Address Name", "uds.diag_addr_source_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3457 | 15 | { &hf_uds_diag_target_addr, { |
3458 | 15 | "Diagnostic Target Address", "uds.diag_addr_target", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3459 | 15 | { &hf_uds_diag_target_addr_name, { |
3460 | 15 | "Diagnostic Target Address Name", "uds.diag_addr_target_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3461 | 15 | { &hf_uds_service, { |
3462 | 15 | "Service Identifier", "uds.sid", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_services_ext, UDS_SID_MASK, NULL, HFILL } }, |
3463 | 15 | { &hf_uds_reply, { |
3464 | 15 | "Reply Flag", "uds.reply", FT_UINT8, BASE_HEX, NULL, UDS_REPLY_MASK, NULL, HFILL } }, |
3465 | | |
3466 | 15 | { &hf_uds_subfunction, { |
3467 | 15 | "SubFunction", "uds.subfunction", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3468 | 15 | { &hf_uds_suppress_pos_rsp_msg_ind, { |
3469 | 15 | "Suppress reply", "uds.suppress_reply.indication", FT_BOOLEAN, 8, NULL, UDS_SUPPRESS_POS_RSP_MSG_IND_MASK, NULL, HFILL } }, |
3470 | 15 | { &hf_uds_data_record, { |
3471 | 15 | "Data Record", "uds.data_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3472 | | |
3473 | 15 | { &hf_uds_compression_method, { |
3474 | 15 | "Compression Method", "uds.compression_method", FT_UINT8, BASE_HEX, NULL, UDS_RD_COMPRESSION_METHOD_MASK, NULL, HFILL } }, |
3475 | 15 | { &hf_uds_encrypting_method, { |
3476 | 15 | "Encrypting Method", "uds.encrypting_method", FT_UINT8, BASE_HEX, NULL, UDS_RD_ENCRYPTING_METHOD_MASK, NULL, HFILL } }, |
3477 | 15 | { &hf_uds_memory_size_length, { |
3478 | 15 | "Memory size length", "uds.memory_size_length", FT_UINT8, BASE_HEX, NULL, UDS_RD_MEMORY_SIZE_LENGTH_MASK, NULL, HFILL } }, |
3479 | 15 | { &hf_uds_memory_address_length, { |
3480 | 15 | "Memory address length", "uds.memory_address_length", FT_UINT8, BASE_HEX, NULL, UDS_RD_MEMORY_ADDRESS_LENGTH_MASK, NULL, HFILL } }, |
3481 | 15 | { &hf_uds_memory_address, { |
3482 | 15 | "Memory Address", "uds.memory_address", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3483 | 15 | { &hf_uds_memory_size, { |
3484 | 15 | "Memory Size", "uds.memory_size", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3485 | 15 | { &hf_uds_max_block_len_len, { |
3486 | 15 | "Length of Max Block Length", "uds.max_block_length_length", FT_UINT8, BASE_HEX, NULL, UDS_RD_MAX_BLOCK_LEN_LEN_MASK, NULL, HFILL } }, |
3487 | 15 | { &hf_uds_max_block_len, { |
3488 | 15 | "Max Block Length", "uds.max_block_length", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3489 | | |
3490 | 15 | { &hf_uds_dsc_subfunction, { |
3491 | 15 | "SubFunction", "uds.dsc.subfunction", FT_UINT8, BASE_HEX, VALS(uds_dsc_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3492 | 15 | { &hf_uds_dsc_suppress_pos_rsp_msg_ind, { |
3493 | 15 | "Suppress reply", "uds.dsc.suppress_reply.indication", FT_BOOLEAN, 8, NULL, UDS_SUPPRESS_POS_RSP_MSG_IND_MASK, NULL, HFILL } }, |
3494 | 15 | { &hf_uds_dsc_parameter_record, { |
3495 | 15 | "Parameter Record", "uds.dsc.parameter_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3496 | 15 | { &hf_uds_dsc_default_p2_server_timer, { |
3497 | 15 | "Default P2 Server Timer", "uds.dsc.p2_server_time_default", FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL } }, |
3498 | | /* Header field is actually only 16bit but has to be scaled up by 10x. */ |
3499 | 15 | { &hf_uds_dsc_enhanced_p2_server_timer, { |
3500 | 15 | "Enhanced P2 Server Timer", "uds.dsc.p2_server_time_enhanced", FT_UINT32, BASE_DEC | BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL } }, |
3501 | | |
3502 | 15 | { &hf_uds_er_subfunction, { |
3503 | 15 | "SubFunction", "uds.er.subfunction", FT_UINT8, BASE_HEX, VALS(uds_er_types), 0x0, NULL, HFILL } }, |
3504 | 15 | { &hf_uds_er_power_down_time, { |
3505 | 15 | "Power Down Time", "uds.er.power_down_time", FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_seconds), 0x0, NULL, HFILL } }, |
3506 | | |
3507 | 15 | { &hf_uds_cdtci_group_of_dtc, { |
3508 | 15 | "Group of DTC", "uds.cdtci.group_of_dtc", FT_UINT24, BASE_HEX, VALS(uds_cdtci_group_of_dtc), 0x0, NULL, HFILL } }, |
3509 | 15 | { &hf_uds_cdtci_memory_selection, { |
3510 | 15 | "Memory Selection", "uds.cdtci.memory_selection", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3511 | | |
3512 | 15 | { &hf_uds_rdtci_subfunction, { |
3513 | 15 | "SubFunction", "uds.rdtci.subfunction", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_rdtci_types_ext, 0x0, NULL, HFILL } }, |
3514 | 15 | { &hf_uds_rdtci_dtc_status_mask, { |
3515 | 15 | "DTC Status Mask", "uds.rdtci.dtc_status_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3516 | 15 | { &hf_uds_rdtci_dtc_status_mask_tf, { |
3517 | 15 | "(Last) Test Failed", "uds.rdtci.dtc_status_mask.tf", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED, NULL, HFILL } }, |
3518 | 15 | { &hf_uds_rdtci_dtc_status_mask_tftoc, { |
3519 | 15 | "Test Failed This Operation Cycle", "uds.rdtci.dtc_status_mask.tftoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_THIS_OPER_CYCLE, NULL, HFILL } }, |
3520 | 15 | { &hf_uds_rdtci_dtc_status_mask_pdtc, { |
3521 | 15 | "Pending DTC", "uds.rdtci.dtc_status_mask.pdtc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_PENDING_DTC, NULL, HFILL } }, |
3522 | 15 | { &hf_uds_rdtci_dtc_status_mask_cdtc, { |
3523 | 15 | "Confirmed DTC", "uds.rdtci.dtc_status_mask.ctdc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_CONFIRMED_DTC, NULL, HFILL } }, |
3524 | 15 | { &hf_uds_rdtci_dtc_status_mask_tncslc, { |
3525 | 15 | "Test Not Completed Since Last Clear", "uds.rdtci.dtc_status_mask.tncslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3526 | 15 | { &hf_uds_rdtci_dtc_status_mask_tfslc, { |
3527 | 15 | "Test Failed Since Last Clear", "uds.rdtci.dtc_status_mask.tfslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3528 | 15 | { &hf_uds_rdtci_dtc_status_mask_tnctoc, { |
3529 | 15 | "Test Not Completed This Operation Cycle", "uds.rdtci.dtc_status_mask.tnctoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_THIS_OPER_CYCLE, NULL, HFILL } }, |
3530 | 15 | { &hf_uds_rdtci_dtc_status_mask_wir, { |
3531 | 15 | "Warning Indicator Requested", "uds.rdtci.dtc_status_mask.wir", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_WARNING_INDICATOR_REQUESTED, NULL, HFILL } }, |
3532 | 15 | { &hf_uds_rdtci_dtc_mask_record, { |
3533 | 15 | "DTC Mask Record", "uds.rdtci.dtc_mask_record", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3534 | 15 | { &hf_uds_rdtci_dtc_snapshot_rec_no, { |
3535 | 15 | "DTC Snapshot Record Number", "uds.rdtci.dtc_snapshot_record_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3536 | 15 | { &hf_uds_rdtci_dtc_stored_data_rec_no, { |
3537 | 15 | "DTC Stored Data Record Number", "uds.rdtci.dtc_stored_data_record_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3538 | 15 | { &hf_uds_rdtci_dtc_ext_data_rec_no, { |
3539 | 15 | "DTC Extended Data Record Number", "uds.rdtci.dtc_extended_data_record_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3540 | 15 | { &hf_uds_rdtci_dtc_severity_mask, { |
3541 | 15 | "DTC Severity Mask", "uds.rdtci.dtc_severity_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3542 | 15 | { &hf_uds_rdtci_memory_selection, { |
3543 | 15 | "Memory Selection", "uds.rdtci.memory_selection", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3544 | 15 | { &hf_uds_rdtci_user_def_dtc_snapshot_rec_no, { |
3545 | 15 | "User Defined DTC Snapshot Record Number", "uds.rdtci.user_def_dtc_snapshot_record_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3546 | 15 | { &hf_uds_rdtci_functional_group_id, { |
3547 | 15 | "Functional Group Identifier", "uds.rdtci.functional_group_id", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3548 | 15 | { &hf_uds_rdtci_dtc_readiness_group_id, { |
3549 | 15 | "DTC Readiness Group Identifier", "uds.rdtci.dtc_readiness_group_id", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3550 | 15 | { &hf_uds_rdtci_dtc_status_avail, { |
3551 | 15 | "DTC Status Availability Mask", "uds.rdtci.dtc_status_availability_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3552 | 15 | { &hf_uds_rdtci_dtc_status_avail_tf, { |
3553 | 15 | "Test Failed", "uds.rdtci.dtc_status_avail_mask.tf", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED, NULL, HFILL } }, |
3554 | 15 | { &hf_uds_rdtci_dtc_status_avail_tftoc, { |
3555 | 15 | "Test Failed This Operation Cycle", "uds.rdtci.dtc_status_avail_mask.tftoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_THIS_OPER_CYCLE, NULL, HFILL } }, |
3556 | 15 | { &hf_uds_rdtci_dtc_status_avail_pdtc, { |
3557 | 15 | "Pending DTC", "uds.rdtci.dtc_status_avail_mask.pdtc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_PENDING_DTC, NULL, HFILL } }, |
3558 | 15 | { &hf_uds_rdtci_dtc_status_avail_cdtc, { |
3559 | 15 | "Confirmed DTC", "uds.rdtci.dtc_status_avail_mask.ctdc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_CONFIRMED_DTC, NULL, HFILL } }, |
3560 | 15 | { &hf_uds_rdtci_dtc_status_avail_tncslc,{ |
3561 | 15 | "Test Not Completed Since Last Clear", "uds.rdtci.dtc_status_avail_mask.tncslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3562 | 15 | { &hf_uds_rdtci_dtc_status_avail_tfslc, { |
3563 | 15 | "Test Failed Since Last Clear", "uds.rdtci.dtc_status_avail_mask.tfslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3564 | 15 | { &hf_uds_rdtci_dtc_status_avail_tnctoc, { |
3565 | 15 | "Test Not Completed This Operation Cycle", "uds.rdtci.dtc_status_avail_mask.tnctoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_THIS_OPER_CYCLE, NULL, HFILL } }, |
3566 | 15 | { &hf_uds_rdtci_dtc_status_avail_wir, { |
3567 | 15 | "Warning Indicator Requested", "uds.rdtci.dtc_status_avail_mask.wir", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_WARNING_INDICATOR_REQUESTED, NULL, HFILL } }, |
3568 | 15 | { &hf_uds_rdtci_dtc_id, { |
3569 | 15 | "DTC Identifier", "uds.rdtci.dtc_id", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3570 | 15 | { &hf_uds_rdtci_dtc_status, { |
3571 | 15 | "DTC Status", "uds.rdtci.dtc_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3572 | 15 | { &hf_uds_rdtci_dtc_status_tf, { |
3573 | 15 | "Test Failed", "uds.rdtci.dtc_status.tf", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED, NULL, HFILL } }, |
3574 | 15 | { &hf_uds_rdtci_dtc_status_tftoc, { |
3575 | 15 | "Test Failed This Operation Cycle", "uds.rdtci.dtc_status.tftoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_THIS_OPER_CYCLE, NULL, HFILL } }, |
3576 | 15 | { &hf_uds_rdtci_dtc_status_pdtc, { |
3577 | 15 | "Pending DTC", "uds.rdtci.dtc_status.pdtc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_PENDING_DTC, NULL, HFILL } }, |
3578 | 15 | { &hf_uds_rdtci_dtc_status_cdtc, { |
3579 | 15 | "Confirmed DTC", "uds.rdtci.dtc_status.ctdc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_CONFIRMED_DTC, NULL, HFILL } }, |
3580 | 15 | { &hf_uds_rdtci_dtc_status_tncslc, { |
3581 | 15 | "Test Not Completed Since Last Clear", "uds.rdtci.dtc_status.tncslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3582 | 15 | { &hf_uds_rdtci_dtc_status_tfslc, { |
3583 | 15 | "Test Failed Since Last Clear", "uds.rdtci.dtc_status.tfslc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR, NULL, HFILL } }, |
3584 | 15 | { &hf_uds_rdtci_dtc_status_tnctoc, { |
3585 | 15 | "Test Not Completed This Operation Cycle", "uds.rdtci.dtc_status.tnctoc", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_TEST_NOT_COMPL_THIS_OPER_CYCLE, NULL, HFILL } }, |
3586 | 15 | { &hf_uds_rdtci_dtc_status_wir, { |
3587 | 15 | "Warning Indicator Requested", "uds.rdtci.dtc_status.wir", FT_BOOLEAN, 8, NULL, UDS_RDTCI_DTC_STATUS_WARNING_INDICATOR_REQUESTED, NULL, HFILL } }, |
3588 | 15 | { &hf_uds_rdtci_dtc_format_id, { |
3589 | 15 | "DTC Format Identifier", "uds.rdtci.dtc_format_id", FT_UINT8, BASE_HEX_DEC, VALS(uds_rdtci_format_id_types), 0x0, NULL, HFILL } }, |
3590 | 15 | { &hf_uds_rdtci_dtc_count, { |
3591 | 15 | "DTC Count", "uds.rdtci.dtc_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3592 | 15 | { &hf_uds_rdtci_dtc_snapshot_record_number_of_ids, { |
3593 | 15 | "DTC Snapshot Record Number of IDs", "uds.rdtci.dtc_snapshot_record_number_of_ids", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3594 | 15 | { &hf_uds_rdtci_dtc_stored_data_record_number_of_ids, { |
3595 | 15 | "DTC Stored Data Record Number of IDs", "uds.rdtci.dtc_stored_data_record_number_of_ids", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3596 | 15 | { &hf_uds_rdtci_dtc_severity, { |
3597 | 15 | "DTC Severity", "uds.rdtci.dtc_severity", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3598 | 15 | { &hf_uds_rdtci_dtc_functional_unit, { |
3599 | 15 | "DTC Functional Unit", "uds.rdtci.dtc_functional_unit", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3600 | 15 | { &hf_uds_rdtci_dtc_fault_detect_counter, { |
3601 | 15 | "DTC Fault Detection Counter", "uds.rdtci.dtc_fault_detection_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3602 | 15 | { &hf_uds_rdtci_dtc_severity_avail, { |
3603 | 15 | "DTC Severity Availability Mask", "uds.rdtci.dtc_severity_availability_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3604 | 15 | { &hf_uds_rdtci_record, { |
3605 | 15 | "Record", "uds.rdtci.record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3606 | 15 | { &hf_uds_rdtci_record_unparsed, { |
3607 | 15 | "Unparsed Record", "uds.rdtci.record_unparsed", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3608 | | |
3609 | 15 | { &hf_uds_rdbi_data_identifier, { |
3610 | 15 | "Data Identifier", "uds.rdbi.data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3611 | | |
3612 | 15 | { &hf_uds_rsdbi_data_identifier, { |
3613 | 15 | "Data Identifier", "uds.rsdbi.data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3614 | 15 | { &hf_uds_rsdbi_scaling_byte, { |
3615 | 15 | "Scaling Byte", "uds.rsdbi.scaling_byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3616 | 15 | { &hf_uds_rsdbi_scaling_byte_data_type, { |
3617 | 15 | "Data Type", "uds.rsdbi.scaling_byte.data_type", FT_UINT8, BASE_HEX, VALS(uds_rsdbi_data_types), 0xF0, NULL, HFILL } }, |
3618 | 15 | { &hf_uds_rsdbi_scaling_byte_num_of_bytes, { |
3619 | 15 | "Number of Bytes", "uds.rsdbi.scaling_byte.number_of_Bytes", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, |
3620 | 15 | { &hf_uds_rsdbi_validity_mask, { |
3621 | 15 | "Validity Mask", "uds.rsdbi.scaling_byte_ext.validity_mask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3622 | 15 | { &hf_uds_rsdbi_formula_identifier, { |
3623 | 15 | "Formula Identifier", "uds.rsdbi.scaling_byte_ext.formula_identifier", FT_UINT8, BASE_HEX, VALS(uds_rsdbi_formulas), 0x0, NULL, HFILL } }, |
3624 | 15 | { &hf_uds_rsdbi_formula_constant, { |
3625 | 15 | "Constant", "uds.rsdbi.scaling_byte_ext.formula_constant", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3626 | 15 | { &hf_uds_rsdbi_formula_constant_exp, { |
3627 | 15 | "Exponent", "uds.rsdbi.scaling_byte_ext.formulat_constant_exp", FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL } }, |
3628 | 15 | { &hf_uds_rsdbi_formula_constant_mantissa, { |
3629 | 15 | "Constant", "uds.rsdbi.scaling_byte_ext.formulat_constant", FT_UINT16, BASE_HEX, NULL, 0x0FFF, NULL, HFILL } }, |
3630 | 15 | { &hf_uds_rsdbi_unit, { |
3631 | 15 | "Unit Identifier", "uds.rsdbi.scaling_byte_ext.unit", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_rsdbi_units_ext, 0x0, NULL, HFILL } }, |
3632 | | |
3633 | 15 | { &hf_uds_sa_subfunction, { |
3634 | 15 | "SubFunction", "uds.sa.subfunction", FT_UINT8, BASE_CUSTOM, CF_FUNC(uds_sa_subfunction_format), 0x0, NULL, HFILL } }, |
3635 | 15 | { &hf_uds_sa_key, { |
3636 | 15 | "Key", "uds.sa.key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3637 | 15 | { &hf_uds_sa_seed, { |
3638 | 15 | "Seed", "uds.sa.seed", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3639 | | |
3640 | 15 | { &hf_uds_cc_subfunction_no_suppress, { |
3641 | 15 | "SubFunction (without Suppress)", "uds.cc.subfunction_without_suppress", FT_UINT8, BASE_HEX, VALS(uds_cc_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3642 | 15 | { &hf_uds_cc_comm_type_and_subnet_number, { |
3643 | 15 | "Communication Type/Subnet Number", "uds.cc.comm_type_and_subnet_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3644 | 15 | { &hf_uds_cc_communication_type, { |
3645 | 15 | "Communication Type", "uds.cc.communication_type", FT_UINT8, BASE_HEX, VALS(uds_cc_comm_types), UDS_CC_COMM_TYPE_COMM_TYPE_MASK, NULL, HFILL } }, |
3646 | 15 | { &hf_uds_cc_subnet_number, { |
3647 | 15 | "Subnet Number", "uds.cc.subnet_number", FT_UINT8, BASE_HEX, VALS(uds_cc_subnet_number_types), UDS_CC_COMM_TYPE_SUBNET_NUMBER_MASK, NULL, HFILL } }, |
3648 | 15 | { &hf_uds_cc_node_identifier_number, { |
3649 | 15 | "Node Identifier Number", "uds.cc.node_identifier_number", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3650 | | |
3651 | 15 | { &hf_uds_ars_subfunction_no_suppress, { |
3652 | 15 | "SubFunction (without Suppress)", "uds.ars.subfunction_without_suppress", FT_UINT8, BASE_HEX, VALS(uds_ars_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3653 | 15 | { &hf_uds_ars_comm_config, { |
3654 | 15 | "Communication Configuration", "uds.ars.communication_configuration", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3655 | 15 | { &hf_uds_ars_length_of_cert_client, { |
3656 | 15 | "Length of Certificate Client", "uds.ars.length_of_certificate_client", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3657 | 15 | { &hf_uds_ars_cert_client, { |
3658 | 15 | "Certificate Client", "uds.ars.certificate_client", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3659 | 15 | { &hf_uds_ars_length_of_cert_server, { |
3660 | 15 | "Length of Certificate Server", "uds.ars.length_of_certificate_server", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3661 | 15 | { &hf_uds_ars_cert_server, { |
3662 | 15 | "Certificate Server", "uds.ars.certificate_server", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3663 | 15 | { &hf_uds_ars_length_of_challenge_client, { |
3664 | 15 | "Length of Challenge Client", "uds.ars.length_of_challenge_client", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3665 | 15 | { &hf_uds_ars_challenge_client, { |
3666 | 15 | "Challenge Client", "uds.ars.challenge_client", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3667 | 15 | { &hf_uds_ars_length_of_challenge_server, { |
3668 | 15 | "Length of Challenge Server", "uds.ars.length_of_challenge_server", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3669 | 15 | { &hf_uds_ars_challenge_server, { |
3670 | 15 | "Challenge Server", "uds.ars.challenge_server", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3671 | 15 | { &hf_uds_ars_length_of_proof_of_ownership_client, { |
3672 | 15 | "Length of Proof of Ownership Client", "uds.ars.length_of_proof_of_ownership_client", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3673 | 15 | { &hf_uds_ars_proof_of_ownership_client, { |
3674 | 15 | "Proof of Ownership Client", "uds.ars.proof_of_ownership_client", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3675 | 15 | { &hf_uds_ars_length_of_proof_of_ownership_server, { |
3676 | 15 | "Length of Proof of Ownership Server", "uds.ars.length_of_proof_of_ownership_server", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3677 | 15 | { &hf_uds_ars_proof_of_ownership_server, { |
3678 | 15 | "Proof of Ownership Server", "uds.ars.proof_of_ownership_server", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3679 | 15 | { &hf_uds_ars_length_of_ephemeral_public_key_client, { |
3680 | 15 | "Length of Ephemeral Public Key Client", "uds.ars.length_of_ephemeral_public_key_client", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3681 | 15 | { &hf_uds_ars_ephemeral_public_key_client, { |
3682 | 15 | "Ephemeral Public Key Client", "uds.ars.ephemeral_public_key_client", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3683 | 15 | { &hf_uds_ars_length_of_ephemeral_public_key_server, { |
3684 | 15 | "Length of Ephemeral Public Key Server", "uds.ars.length_of_ephemeral_public_key_server", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3685 | 15 | { &hf_uds_ars_ephemeral_public_key_server, { |
3686 | 15 | "Ephemeral Public Key Server", "uds.ars.ephemeral_public_key_server", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3687 | 15 | { &hf_uds_ars_cert_eval_id, { |
3688 | 15 | "Certificate Evaluation ID", "uds.ars.certificate_evaluation_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3689 | 15 | { &hf_uds_ars_length_of_cert_data, { |
3690 | 15 | "Length of Certificate Data", "uds.ars.length_of_certificate_data", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3691 | 15 | { &hf_uds_ars_cert_data, { |
3692 | 15 | "Certificate Data", "uds.ars.certificate_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3693 | 15 | { &hf_uds_ars_algo_indicator, { |
3694 | 15 | "Algorithm Indicator", "uds.ars.algorithm_indicator", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3695 | 15 | { &hf_uds_ars_length_of_additional_parameter, { |
3696 | 15 | "Length of Additional Parameter", "uds.ars.length_of_additional_parameter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3697 | 15 | { &hf_uds_ars_additional_parameter, { |
3698 | 15 | "Additional Parameter", "uds.ars.additional_parameter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3699 | 15 | { &hf_uds_ars_length_of_needed_additional_parameter, { |
3700 | 15 | "Length of Needed Additional Parameter", "uds.ars.length_of_needed_additional_parameter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3701 | 15 | { &hf_uds_ars_needed_additional_parameter, { |
3702 | 15 | "Needed Additional Parameter", "uds.ars.needed_additional_parameter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3703 | 15 | { &hf_uds_ars_auth_ret_param, { |
3704 | 15 | "Authentication Return Parameter", "uds.ars.authentication_return_parameter", FT_UINT8, BASE_HEX, VALS(uds_ars_auth_ret_types), 0x0, NULL, HFILL } }, |
3705 | 15 | { &hf_uds_ars_length_of_session_key_info, { |
3706 | 15 | "Length of Session Key Info", "uds.ars.length_of_session_key_info", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3707 | 15 | { &hf_uds_ars_session_key_info, { |
3708 | 15 | "Session Key Info", "uds.ars.session_key_info", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3709 | | |
3710 | 15 | { &hf_uds_signedCertificate, { |
3711 | 15 | "signedCertificate", "uds.signedCertificate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, |
3712 | | |
3713 | 15 | { &hf_uds_rdbpi_transmission_mode, { |
3714 | 15 | "Transmission Mode", "uds.rdbpi.transmission_mode", FT_UINT8, BASE_HEX, VALS(uds_rdbpi_transmission_mode), 0x0, NULL, HFILL } }, |
3715 | 15 | { &hf_uds_rdbpi_periodic_data_identifier, { |
3716 | 15 | "Periodic Data Identifier", "uds.rdbpi.periodic_data_identifier", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3717 | | |
3718 | 15 | { &hf_uds_dddi_subfunction_no_suppress, { |
3719 | 15 | "SubFunction (without Suppress)", "uds.dddi.subfunction_without_suppress", FT_UINT8, BASE_HEX, VALS(uds_dddi_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3720 | 15 | { &hf_uds_dddi_dyn_defined_data_identifier, { |
3721 | 15 | "Dynamically Defined Data Identifier", "uds.dddi.dynamically_defined_data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3722 | 15 | { &hf_uds_dddi_source_data_identifier, { |
3723 | 15 | "Source Data Identifier", "uds.dddi.source_data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3724 | 15 | { &hf_uds_dddi_position_in_source_data_record, { |
3725 | 15 | "Position in Source Data Record", "uds.dddi.position_in_source_data_record", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3726 | 15 | { &hf_uds_dddi_memory_size, { |
3727 | 15 | "Memory Size", "uds.dddi.memory_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3728 | | |
3729 | 15 | { &hf_uds_wdbi_data_identifier, { |
3730 | 15 | "Data Identifier", "uds.wdbi.data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3731 | | |
3732 | 15 | { &hf_uds_iocbi_data_identifier, { |
3733 | 15 | "Data Identifier", "uds.iocbi.data_identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3734 | 15 | { &hf_uds_iocbi_parameter, { |
3735 | 15 | "Parameter", "uds.iocbi.parameter", FT_UINT8, BASE_HEX, VALS(uds_iocbi_parameters), 0x0, NULL, HFILL } }, |
3736 | 15 | { &hf_uds_iocbi_state, { |
3737 | 15 | "State", "uds.iocbi.state", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3738 | | |
3739 | 15 | { &hf_uds_rc_subfunction, { |
3740 | 15 | "SubFunction", "uds.rc.subfunction", FT_UINT8, BASE_HEX, VALS(uds_rc_types), 0x0, NULL, HFILL } }, |
3741 | 15 | { &hf_uds_rc_identifier, { |
3742 | 15 | "Identifier", "uds.rc.identifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3743 | 15 | { &hf_uds_rc_option_record, { |
3744 | 15 | "Option record", "uds.rc.option_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3745 | 15 | { &hf_uds_rc_info, { |
3746 | 15 | "Info", "uds.rc.info", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3747 | 15 | { &hf_uds_rc_status_record, { |
3748 | 15 | "Status Record", "uds.rc.status_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3749 | | |
3750 | 15 | { &hf_uds_td_sequence_counter, { |
3751 | 15 | "Block Sequence Counter", "uds.td.block_sequence_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3752 | 15 | { &hf_uds_td_record_data, { |
3753 | 15 | "Parameter Record", "uds.td.parameter_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3754 | | |
3755 | 15 | { &hf_uds_rte_record_data, { |
3756 | 15 | "Parameter Record", "uds.rte.parameter_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3757 | | |
3758 | 15 | { &hf_uds_rft_mode_of_operation, { |
3759 | 15 | "Mode of Operation", "uds.rft.mode_of_operation", FT_UINT8, BASE_HEX, VALS(uds_rft_mode_types), 0x0, NULL, HFILL } }, |
3760 | 15 | { &hf_uds_rft_length_of_file_path_and_name, { |
3761 | 15 | "Length of File Path and Name", "uds.rft.length_of_file_path_and_name", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3762 | 15 | { &hf_uds_rft_file_path_and_name, { |
3763 | 15 | "File Path and Name", "uds.rft.file_path_and_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3764 | 15 | { &hf_uds_rft_file_size_param_length, { |
3765 | 15 | "File Size Parameter Length", "uds.rft.file_size_parameter_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3766 | 15 | { &hf_uds_rft_file_size_uncompressed, { |
3767 | 15 | "File Size Uncompressed", "uds.rft.file_size_uncompressed", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3768 | 15 | { &hf_uds_rft_file_size_compressed, { |
3769 | 15 | "File Size Compressed", "uds.rft.file_size_compressed", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3770 | 15 | { &hf_uds_rft_length_format_identifier, { |
3771 | 15 | "Length Format Identifier", "uds.rft.length_format_identifier", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3772 | 15 | { &hf_uds_rft_max_num_of_block_length, { |
3773 | 15 | "Max Number of Block Length", "uds.rft.max_number_of_block_length", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3774 | 15 | { &hf_uds_rft_file_size_or_dir_info_param_length, { |
3775 | 15 | "File Size or Dir Info Parameter Length", "uds.rft.file_size_or_dir_info_parameter_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3776 | 15 | { &hf_uds_rft_file_size_uncompressed_or_dir_info_length, { |
3777 | 15 | "File Size Uncompressed or Dir Info Length", "uds.rft.file_size_uncompressed_or_dir_info_length", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3778 | 15 | { &hf_uds_rft_file_position, { |
3779 | 15 | "File Position", "uds.rft.file_position", FT_UINT64, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, |
3780 | | |
3781 | 15 | { &hf_uds_tp_subfunction_no_suppress, { |
3782 | 15 | "SubFunction (without Suppress)", "uds.tp.subfunction_without_suppress", FT_UINT8, BASE_HEX, NULL, UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3783 | | |
3784 | 15 | { &hf_uds_err_sid, { |
3785 | 15 | "Service Identifier", "uds.err.sid", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_services_ext, 0x0, NULL, HFILL } }, |
3786 | 15 | { &hf_uds_err_code, { |
3787 | 15 | "Code", "uds.err.code", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_response_codes_ext, 0x0, NULL, HFILL } }, |
3788 | | |
3789 | 15 | { &hf_uds_sdt_administrative_param, { |
3790 | 15 | "Administrative Parameter", "uds.sdt.admin_param", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3791 | 15 | { &hf_uds_sdt_administrative_param_req, { |
3792 | 15 | "Request message", "uds.sdt.admin_param.request", FT_BOOLEAN, 16, NULL, UDS_SDT_ADMIN_PARAM_REQ, NULL, HFILL } }, |
3793 | 15 | { &hf_uds_sdt_administrative_param_pre_estab_key, { |
3794 | 15 | "Pre-established key is used", "uds.sdt.admin_param.pre_estab_key", FT_BOOLEAN, 16, NULL, UDS_SDT_ADMIN_PARAM_PRE_ESTABL_KEY, NULL, HFILL } }, |
3795 | 15 | { &hf_uds_sdt_administrative_param_encrypted, { |
3796 | 15 | "Message is encrypted", "uds.sdt.admin_param.encrypted", FT_BOOLEAN, 16, NULL, UDS_SDT_ADMIN_PARAM_ENCRYPTED, NULL, HFILL } }, |
3797 | 15 | { &hf_uds_sdt_administrative_param_signed, { |
3798 | 15 | "Message is signed", "uds.sdt.admin_param.signed", FT_BOOLEAN, 16, NULL, UDS_SDT_ADMIN_PARAM_SIGNED, NULL, HFILL } }, |
3799 | 15 | { &hf_uds_sdt_administrative_param_resp_sign_req, { |
3800 | 15 | "Signature on the response is requested", "uds.sdt.admin_param.resp_sign_req", FT_BOOLEAN, 16, NULL, UDS_SDT_ADMIN_PARAM_SIGN_ON_RESP_REQ, NULL, HFILL } }, |
3801 | 15 | { &hf_uds_sdt_signature_encryption_calculation, { |
3802 | 15 | "Signature/Encryption Calculation", "uds.sdt.signature_encryption_calculation", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3803 | 15 | { &hf_uds_sdt_signature_length, { |
3804 | 15 | "Signature/MAC Length", "uds.sdt.signature_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3805 | 15 | { &hf_uds_sdt_anti_replay_counter, { |
3806 | 15 | "Anti-replay Counter", "uds.sdt.anti_replay_counter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, |
3807 | 15 | { &hf_uds_sdt_encapsulated_message, { |
3808 | 15 | "Encapsulated Message", "uds.sdt.encapsulated_message", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3809 | 15 | { &hf_uds_sdt_encapsulated_message_sid, { |
3810 | 15 | "Service Identifier", "uds.sdt.encapsulated_message.sid", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &uds_services_ext, UDS_SID_MASK, NULL, HFILL } }, |
3811 | 15 | { &hf_uds_sdt_encapsulated_message_sid_reply, { |
3812 | 15 | "Reply Flag", "uds.sdt.encapsulated_message.reply", FT_UINT8, BASE_HEX, NULL, UDS_REPLY_MASK, NULL, HFILL } }, |
3813 | 15 | { &hf_uds_sdt_signature_mac, { |
3814 | 15 | "Signature/MAC", "uds.sdt.signature_mac", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3815 | | |
3816 | 15 | { &hf_uds_cdtcs_subfunction, { |
3817 | 15 | "SubFunction", "uds.cdtcs.subfunction", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3818 | 15 | { &hf_uds_cdtcs_subfunction_no_suppress, { |
3819 | 15 | "DTC Setting Type", "uds.cdtcs.subfunction_without_suppress", FT_UINT8, BASE_HEX, VALS(uds_cdtcs_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3820 | 15 | { &hf_uds_cdtcs_subfunction_pos_rsp_msg_ind, { |
3821 | 15 | "Suppress reply", "uds.cdtcs.suppress_reply", FT_BOOLEAN, 8, NULL, UDS_SUPPRESS_POS_RSP_MSG_IND_MASK, NULL, HFILL } }, |
3822 | 15 | { &hf_uds_cdtcs_option_record, { |
3823 | 15 | "Option Record", "uds.cdtcs.option_record", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3824 | 15 | { &hf_uds_cdtcs_type, { |
3825 | 15 | "DTC Setting Type", "uds.cdtcs.dtc_setting_type", FT_UINT8, BASE_HEX, VALS(uds_cdtcs_types), 0x0, NULL, HFILL } }, |
3826 | | |
3827 | 15 | { &hf_uds_lc_subfunction, { |
3828 | 15 | "SubFunction", "uds.lc.subfunction", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3829 | 15 | { &hf_uds_lc_subfunction_no_suppress, { |
3830 | 15 | "SubFunction (without Suppress)", "uds.lc.subfunction_without_suppress", FT_UINT8, BASE_HEX, VALS(uds_lc_types), UDS_SUBFUNCTION_MASK, NULL, HFILL } }, |
3831 | 15 | { &hf_uds_lc_subfunction_pos_rsp_msg_ind, { |
3832 | 15 | "Suppress reply", "uds.lc.suppress_reply", FT_BOOLEAN, 8, NULL, UDS_SUPPRESS_POS_RSP_MSG_IND_MASK, NULL, HFILL } }, |
3833 | 15 | { &hf_uds_lc_control_mode_id, { |
3834 | 15 | "Link Control Mode Identifier", "uds.lc.link_control_mode_identifier", FT_UINT8, BASE_HEX, VALS(uds_lc_lcmi_types), 0x0, NULL, HFILL } }, |
3835 | 15 | { &hf_uds_lc_link_record, { |
3836 | 15 | "Link Record", "uds.lc.link_record", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3837 | | |
3838 | 15 | { &hf_uds_did_reply_f186_diag_session, { |
3839 | 15 | "Diagnostic Session", "uds.did_f186.diagnostic_session", FT_UINT8, BASE_HEX, VALS(uds_dsc_types), 0x0, NULL, HFILL } }, |
3840 | 15 | { &hf_uds_did_reply_f190_vin, { |
3841 | 15 | "VIN", "uds.did_f190.vin", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3842 | 15 | { &hf_uds_did_reply_ff00_version, { |
3843 | 15 | "Version", "uds.did_ff00.version", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
3844 | 15 | { &hf_uds_did_reply_ff01_dlc_support, { |
3845 | 15 | "DLC Supports", "uds.did_ff01.dlc_supports", FT_UINT8, BASE_HEX, VALS(uds_did_resrvdcpadlc_types), 0x0, NULL, HFILL } }, |
3846 | | |
3847 | 15 | { &hf_uds_roe_subfunction, { |
3848 | 15 | "SubFunction", "uds.roe.subfunction", FT_UINT8, BASE_HEX, VALS( uds_roe_types), UDS_ROE_SUBFUNC_MASK, NULL, HFILL }}, |
3849 | 15 | { &hf_uds_roe_store_flag, { |
3850 | 15 | "Store Flag", "uds.roe.storeflag", FT_UINT8, BASE_HEX, 0, UDS_ROE_STORE_MASK, NULL, HFILL }}, |
3851 | 15 | { &hf_uds_roe_window_time, { |
3852 | 15 | "EventWindowsTime", "uds.roe.window_time", FT_UINT8, BASE_HEX, VALS( uds_roe_windowtime_types), 0x0, NULL, HFILL}}, |
3853 | 15 | { &hf_uds_roe_NOIE, { |
3854 | 15 | "Number of identified Events", "uds.roe.noie", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL}}, |
3855 | 15 | { &hf_uds_roe_EVOAE, { |
3856 | 15 | "Event Type of active Event", "uds.roe.evoae", FT_UINT8, BASE_DEC, VALS( uds_roe_types), 0, NULL, HFILL}}, |
3857 | 15 | { &hf_uds_roe_identifier, { |
3858 | 15 | "Identifier", "uds.roe.identifier", FT_UINT16, BASE_HEX, 0, 0, NULL, HFILL}}, |
3859 | 15 | { &hf_uds_roe_did, { |
3860 | 15 | "DID", "uds.roe.did", FT_UINT16, BASE_HEX, 0, 0, NULL, HFILL}}, |
3861 | 15 | { &hf_uds_roe_comparison, { |
3862 | 15 | "Comparison logic", "uds.roe.ocov.logic", FT_UINT8, BASE_DEC, VALS( uds_roe_ocov_logic_types), 0, NULL, HFILL }}, |
3863 | 15 | { &hf_uds_roe_comparison_value, { |
3864 | 15 | "Comparison Value", "uds.roe.ocov.value", FT_UINT32, BASE_DEC_HEX, 0, 0, NULL, HFILL }}, |
3865 | 15 | { &hf_uds_roe_hysteresis_value, { |
3866 | 15 | "hysteresis value[%]", "uds.roe.ocov.hysteresis", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL}}, |
3867 | 15 | { &hf_uds_roe_localization, { |
3868 | 15 | "Localization", "uds.roe.ocov.localisation", FT_UINT16, BASE_HEX, 0, 0, NULL, HFILL}}, |
3869 | 15 | { &hf_uds_roe_localization_sign, { |
3870 | 15 | "Localization sign", "uds.roe.ocov.localisation_sign", FT_UINT16, BASE_HEX, VALS( uds_roe_localisation_sign_types), UDS_ROE_OCOV_LOCAL_SIGN_MASK, NULL, HFILL}}, |
3871 | 15 | { &hf_uds_roe_localization_length, { |
3872 | 15 | "Localization length", "uds.roe.ocov.localisation_len", FT_UINT16, BASE_HEX, 0, UDS_ROE_OCOV_LOCAL_LEN_MASK, NULL, HFILL}}, |
3873 | 15 | { &hf_uds_roe_localization_offset, { |
3874 | 15 | "Localization offset", "uds.roe.ocov.localisation_offset", FT_UINT16, BASE_HEX, 0, UDS_ROE_OCOV_LOCAL_OFFSET_MASK, NULL, HFILL}}, |
3875 | 15 | { &hf_uds_roe_dtc_status_mask, { |
3876 | 15 | "DTCStatusMask", "uds.roe.dtcstatusmask", FT_UINT8, BASE_HEX, 0, 0, NULL, HFILL}}, |
3877 | 15 | { &hf_uds_roe_dtc_status_mask_TF, { |
3878 | 15 | "testFailed", "uds.roe.dtcstatusmask.tf", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_TF, NULL, HFILL }}, |
3879 | 15 | { &hf_uds_roe_dtc_status_mask_TFTOC, { |
3880 | 15 | "testFailedThisOperationCycle", "uds.roe.dtcstatusmask.fttoc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_TFTOC, NULL, HFILL }}, |
3881 | 15 | { &hf_uds_roe_dtc_status_mask_PDTC, { |
3882 | 15 | "pendingDTC", "uds.roe.dtcstatusmask.dptc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_PDTC, NULL, HFILL }}, |
3883 | 15 | { &hf_uds_roe_dtc_status_mask_CDTC, { |
3884 | 15 | "confirmedDTC", "uds.roe.dtcstatusmask.cdtc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_CDTC, NULL, HFILL }}, |
3885 | 15 | { &hf_uds_roe_dtc_status_mask_TNCSLC, { |
3886 | 15 | "testNotCompletedSinceLastClear", "uds.roe.dtcstatusmask.tncslc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_TNCSLC, NULL, HFILL }}, |
3887 | 15 | { &hf_uds_roe_dtc_status_mask_TFSLC, { |
3888 | 15 | "testFailedSinceLastClear", "uds.roe.dtcstatusmask.tfslc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_TFSLC, NULL, HFILL }}, |
3889 | 15 | { &hf_uds_roe_dtc_status_mask_TNCTOC, { |
3890 | 15 | "testNotCompletedThisOperationCycle", "uds.roe.dtcstatusmask.tnctoc", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_TNCTOC, NULL, HFILL }}, |
3891 | 15 | { &hf_uds_roe_dtc_status_mask_WIR, { |
3892 | 15 | "warningIndicatorRequested", "uds.roe.dtcstatusmask.wir", FT_UINT8, BASE_HEX, NULL, UDS_ROE_DTC_STATUS_MASK_WIR, NULL, HFILL }}, |
3893 | 15 | { &hf_uds_unparsed_bytes, { |
3894 | 15 | "Unparsed Bytes", "uds.unparsed_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, |
3895 | 15 | }; |
3896 | | |
3897 | 15 | uat_t *uds_routine_ids_uat; |
3898 | 15 | uat_t *uds_data_ids_uat; |
3899 | 15 | uat_t *uds_dtc_ids_uat; |
3900 | 15 | uat_t *uds_address_uat; |
3901 | | |
3902 | 15 | static ei_register_info ei[] = { |
3903 | 15 | { &ei_uds_length_invalid, |
3904 | 15 | { "uds.length.invalid", PI_MALFORMED, PI_ERROR, |
3905 | 15 | "Invalid addressAndLengthFormatIdentifier", EXPFILL }} |
3906 | 15 | }; |
3907 | | |
3908 | | /* Setup protocol subtree array */ |
3909 | 15 | static int *ett[] = { |
3910 | 15 | &ett_uds, |
3911 | 15 | &ett_uds_subfunction, |
3912 | 15 | &ett_uds_dtc_status_entry, |
3913 | 15 | &ett_uds_dtc_status_bits, |
3914 | 15 | &ett_uds_dtc_snapshot_entry, |
3915 | 15 | &ett_uds_dtc_counter_entry, |
3916 | 15 | &ett_uds_dsc_parameter_record, |
3917 | 15 | &ett_uds_rsdbi_scaling_byte, |
3918 | 15 | &ett_uds_rsdbi_formula_constant, |
3919 | 15 | &ett_uds_cc_communication_type, |
3920 | 15 | &ett_uds_ars_certificate, |
3921 | 15 | &ett_uds_ars_algo_indicator, |
3922 | 15 | &ett_uds_dddi_entry, |
3923 | 15 | &ett_uds_sdt_admin_param, |
3924 | 15 | &ett_uds_sdt_encap_message, |
3925 | 15 | &ett_uds_roe_dtc_status_mask, |
3926 | 15 | &ett_uds_roe_localization, |
3927 | 15 | }; |
3928 | | |
3929 | 15 | proto_uds = proto_register_protocol ("Unified Diagnostic Services", "UDS", "uds"); |
3930 | | |
3931 | 15 | proto_register_field_array(proto_uds, hf, array_length(hf)); |
3932 | 15 | proto_register_subtree_array(ett, array_length(ett)); |
3933 | | |
3934 | 15 | uds_expert_module = expert_register_protocol(proto_uds); |
3935 | 15 | expert_register_field_array(uds_expert_module, ei, array_length(ei)); |
3936 | | |
3937 | 15 | uds_handle = register_dissector("uds", dissect_uds_no_data, proto_uds); |
3938 | 15 | uds_handle_doip = register_dissector("uds_over_doip", dissect_uds_doip, proto_uds); |
3939 | 15 | uds_handle_hsfz = register_dissector("uds_over_hsfz", dissect_uds_hsfz, proto_uds); |
3940 | 15 | uds_handle_iso10681 = register_dissector("uds_over_iso10681", dissect_uds_iso10681, proto_uds); |
3941 | 15 | uds_handle_iso15765 = register_dissector("uds_over_iso15765", dissect_uds_iso15765, proto_uds); |
3942 | | |
3943 | | /* Register preferences */ |
3944 | 15 | uds_module = prefs_register_protocol(proto_uds, NULL); |
3945 | | |
3946 | | /* UATs for user_data fields */ |
3947 | 15 | static uat_field_t uds_routine_id_uat_fields[] = { |
3948 | 15 | UAT_FLD_HEX(uds_uat_routine_ids, address, "Address", "Address (16bit hex without leading 0x, 0xffffffff for 'any')"), |
3949 | 15 | UAT_FLD_HEX(uds_uat_routine_ids, id, "Routine ID", "Routine Identifier (16bit hex without leading 0x)"), |
3950 | 15 | UAT_FLD_CSTRING(uds_uat_routine_ids, name, "Routine Name", "Name of the Routine ID (string)"), |
3951 | 15 | UAT_END_FIELDS |
3952 | 15 | }; |
3953 | | |
3954 | 15 | uds_routine_ids_uat = uat_new("UDS Routine Identifier List", |
3955 | 15 | sizeof(generic_addr_id_string_t), /* record size */ |
3956 | 15 | DATAFILE_UDS_ROUTINE_IDS, /* filename */ |
3957 | 15 | true, /* from profile */ |
3958 | 15 | (void**)&uds_uat_routine_ids, /* data_ptr */ |
3959 | 15 | &uds_uat_routine_id_num, /* numitems_ptr */ |
3960 | 15 | UAT_AFFECTS_DISSECTION, /* but not fields */ |
3961 | 15 | NULL, /* help */ |
3962 | 15 | copy_generic_one_id_string_cb, /* copy callback */ |
3963 | 15 | update_generic_addr_16bit_id_16bit, /* update callback */ |
3964 | 15 | free_generic_one_id_string_cb, /* free callback */ |
3965 | 15 | post_update_uds_routine_cb, /* post update callback */ |
3966 | 15 | reset_update_uds_routine_cb, /* reset callback */ |
3967 | 15 | uds_routine_id_uat_fields /* UAT field definitions */ |
3968 | 15 | ); |
3969 | | |
3970 | 15 | prefs_register_uat_preference(uds_module, "_uds_routine_id_list", "UDS Routine Identifier List", |
3971 | 15 | "A table to define names of UDS Routines", uds_routine_ids_uat); |
3972 | | |
3973 | | |
3974 | 15 | static uat_field_t uds_data_id_uat_fields[] = { |
3975 | 15 | UAT_FLD_HEX(uds_uat_data_ids, address, "Address", "Address (16bit hex without leading 0x, 0xffffffff for 'any')"), |
3976 | 15 | UAT_FLD_HEX(uds_uat_data_ids, id, "Data ID", "Data Identifier (16bit hex without leading 0x)"), |
3977 | 15 | UAT_FLD_CSTRING(uds_uat_data_ids, name, "Data Name", "Name of the Data ID (string)"), |
3978 | 15 | UAT_END_FIELDS |
3979 | 15 | }; |
3980 | | |
3981 | 15 | uds_data_ids_uat = uat_new("UDS Data Identifier List", |
3982 | 15 | sizeof(generic_addr_id_string_t), /* record size */ |
3983 | 15 | DATAFILE_UDS_DATA_IDS, /* filename */ |
3984 | 15 | true, /* from profile */ |
3985 | 15 | (void**)&uds_uat_data_ids, /* data_ptr */ |
3986 | 15 | &uds_uat_data_id_num, /* numitems_ptr */ |
3987 | 15 | UAT_AFFECTS_DISSECTION, /* but not fields */ |
3988 | 15 | NULL, /* help */ |
3989 | 15 | copy_generic_one_id_string_cb, /* copy callback */ |
3990 | 15 | update_generic_addr_16bit_id_16bit, /* update callback */ |
3991 | 15 | free_generic_one_id_string_cb, /* free callback */ |
3992 | 15 | post_update_uds_data_cb, /* post update callback */ |
3993 | 15 | reset_update_uds_data_cb, /* reset callback */ |
3994 | 15 | uds_data_id_uat_fields /* UAT field definitions */ |
3995 | 15 | ); |
3996 | | |
3997 | 15 | prefs_register_uat_preference(uds_module, "_uds_data_id_list", "UDS Data Identifier List", |
3998 | 15 | "A table to define names of UDS Data Identifier", uds_data_ids_uat); |
3999 | | |
4000 | | |
4001 | 15 | static uat_field_t uds_dtc_id_uat_fields[] = { |
4002 | 15 | UAT_FLD_HEX(uds_uat_dtc_ids, address, "Address", "Address (16bit hex without leading 0x, 0xffffffff for 'any')"), |
4003 | 15 | UAT_FLD_HEX(uds_uat_dtc_ids, id, "DTC ID", "Data Identifier (24bit hex without leading 0x)"), |
4004 | 15 | UAT_FLD_CSTRING(uds_uat_dtc_ids, name, "DTC Name", "Name of the Data ID (string)"), |
4005 | 15 | UAT_END_FIELDS |
4006 | 15 | }; |
4007 | | |
4008 | 15 | uds_dtc_ids_uat = uat_new("UDS DTC Identifier List", |
4009 | 15 | sizeof(generic_addr_id_string_t), /* record size */ |
4010 | 15 | DATAFILE_UDS_DTC_IDS, /* filename */ |
4011 | 15 | true, /* from profile */ |
4012 | 15 | (void**)&uds_uat_dtc_ids, /* data_ptr */ |
4013 | 15 | &uds_uat_dtc_id_num, /* numitems_ptr */ |
4014 | 15 | UAT_AFFECTS_DISSECTION, /* but not fields */ |
4015 | 15 | NULL, /* help */ |
4016 | 15 | copy_generic_one_id_string_cb, /* copy callback */ |
4017 | 15 | update_generic_addr_16bit_id_24bit, /* update callback */ |
4018 | 15 | free_generic_one_id_string_cb, /* free callback */ |
4019 | 15 | post_update_uds_dtc_cb, /* post update callback */ |
4020 | 15 | reset_update_uds_dtc_cb, /* reset callback */ |
4021 | 15 | uds_dtc_id_uat_fields /* UAT field definitions */ |
4022 | 15 | ); |
4023 | | |
4024 | 15 | prefs_register_uat_preference(uds_module, "_uds_dtc_id_list", "UDS DTC Identifier List", |
4025 | 15 | "A table to define names of UDS DTC Identifier", uds_dtc_ids_uat); |
4026 | | |
4027 | | |
4028 | 15 | static uat_field_t uds_address_name_uat_fields[] = { |
4029 | 15 | UAT_FLD_HEX(uds_uat_addresses, address, "Address", "Address (32bit hex without leading 0x)"), |
4030 | 15 | UAT_FLD_CSTRING(uds_uat_addresses, name, "Name", "Name of the Address (string)"), |
4031 | 15 | UAT_END_FIELDS |
4032 | 15 | }; |
4033 | | |
4034 | 15 | uds_address_uat = uat_new("UDS Addresses", |
4035 | 15 | sizeof(address_string_t), /* record size */ |
4036 | 15 | DATAFILE_UDS_ADDRESSES, /* filename */ |
4037 | 15 | true, /* from profile */ |
4038 | 15 | (void**)&uds_uat_addresses, /* data_ptr */ |
4039 | 15 | &uds_uat_addresses_num, /* numitems_ptr */ |
4040 | 15 | UAT_AFFECTS_DISSECTION, /* but not fields */ |
4041 | 15 | NULL, /* help */ |
4042 | 15 | copy_address_string_cb, /* copy callback */ |
4043 | 15 | update_address_string_cb, /* update callback */ |
4044 | 15 | free_address_string_cb, /* free callback */ |
4045 | 15 | post_update_uds_address_cb, /* post update callback */ |
4046 | 15 | reset_uds_address_cb, /* reset callback */ |
4047 | 15 | uds_address_name_uat_fields /* UAT field definitions */ |
4048 | 15 | ); |
4049 | | |
4050 | 15 | prefs_register_uat_preference(uds_module, "_uds_address_list", "UDS Address List", |
4051 | 15 | "A table to define names of UDS Addresses", uds_address_uat); |
4052 | | |
4053 | 15 | prefs_register_bool_preference(uds_module, "dissect_small_sids_with_obd_ii", |
4054 | 15 | "Dissect Service Identifiers smaller 0x10 with OBD II Dissector?", |
4055 | 15 | "Dissect Service Identifiers smaller 0x10 with OBD II Dissector?", |
4056 | 15 | &uds_dissect_small_sids_with_obd_ii); |
4057 | | |
4058 | 15 | prefs_register_enum_preference(uds_module, "cert_decode_strategy", |
4059 | 15 | "Certificate Decoding Strategy", |
4060 | 15 | "Decide how the certificate bytes are decoded", |
4061 | 15 | &uds_certificate_decoding_config, certificate_decoding_vals, false); |
4062 | | |
4063 | 15 | prefs_register_bool_preference(uds_module, "do_clear_info_col", |
4064 | 15 | "Show only UDS in the Info Column", |
4065 | 15 | "Show only UDS in the Info Column?", |
4066 | 15 | &uds_clear_info_col); |
4067 | | |
4068 | 15 | heur_subdissector_list = register_heur_dissector_list_with_description("uds", "UDS RDBI data", proto_uds); |
4069 | 15 | } |
4070 | | |
4071 | | void |
4072 | | proto_reg_handoff_uds(void) |
4073 | 15 | { |
4074 | 15 | dissector_add_for_decode_as("iso10681.subdissector", uds_handle_iso10681); |
4075 | 15 | dissector_add_for_decode_as("iso15765.subdissector", uds_handle_iso15765); |
4076 | 15 | obd_ii_handle = find_dissector("obd-ii-uds"); |
4077 | 15 | } |
4078 | | |
4079 | | /* |
4080 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
4081 | | * |
4082 | | * Local variables: |
4083 | | * c-basic-offset: 4 |
4084 | | * tab-width: 8 |
4085 | | * indent-tabs-mode: nil |
4086 | | * End: |
4087 | | * |
4088 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
4089 | | * :indentSize=4:tabSize=8:noTabs=true: |
4090 | | */ |