| File: | builds/wireshark/wireshark/epan/dissectors/packet-saprfc.c |
| Warning: | line 806, column 3 Value stored to 'item_value_length' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* packet-saprfc.c |
| 2 | * Routines for SAP RFC (SAP Remote Function Call Protocol) dissection |
| 3 | * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com> |
| 4 | * Code contributed by SecureAuth Corp. |
| 5 | * |
| 6 | * Wireshark - Network traffic analyzer |
| 7 | * By Gerald Combs <[email protected]> |
| 8 | * Copyright 1998 Gerald Combs |
| 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 11 | */ |
| 12 | |
| 13 | #include <epan/packet.h> |
| 14 | #include <epan/prefs.h> |
| 15 | #include <epan/expert.h> |
| 16 | #include <wsutil/wmem/wmem.h> |
| 17 | #include <wsutil/saplzclzh.h> |
| 18 | |
| 19 | /* |
| 20 | * Define default ports. The right range should be 33NN, but as port numbers are proprietary and not |
| 21 | * IANA assigned, we leave only the one corresponding to the instance 00. |
| 22 | */ |
| 23 | #define SAPRFC_PORT_RANGE"3300" "3300" |
| 24 | |
| 25 | #define SAPRFC_DEFAULT_MAX_UNCOMPRESSED_SIZE(16U * 1024U * 1024U) (16U * 1024U * 1024U) |
| 26 | #define SAPRFC_DEFAULT_MAX_REASSEMBLED_SIZE(16U * 1024U * 1024U) (16U * 1024U * 1024U) |
| 27 | #define SAPRFC_TABLE_PREFIX_LENGTH8U 8U |
| 28 | |
| 29 | |
| 30 | /* SAP RFC Request Types field values */ |
| 31 | static const value_string saprfc_reqtype_values[] = { |
| 32 | { 0x00, "GW_UNDEF_TYPE" }, |
| 33 | { 0x01, "GW_CHECK_GATEWAY" }, |
| 34 | { 0x02, "GW_CONNECT_GWWP" }, |
| 35 | { 0x03, "GW_NORMAL_CLIENT" }, |
| 36 | { 0x04, "GW_REMOTE_GATEWAY" }, |
| 37 | { 0x05, "STOP_GATEWAY" }, |
| 38 | { 0x06, "GW_LOCAL_R3" }, |
| 39 | { 0x07, "GW_SEND_INTERNAL_ERROR" }, |
| 40 | { 0x08, "GW_SEND_INFO" }, |
| 41 | { 0x09, "GW_SEND_CMD" }, |
| 42 | { 0x0a, "GW_WORKPROCESS_DIED" }, |
| 43 | { 0x0b, "GW_REGISTER_TP" }, |
| 44 | { 0x0c, "GW_UNREGISTER_TP" }, |
| 45 | { 0x0d, "GW_CONNECT_DISP" }, |
| 46 | { 0x0e, "GW_GET_NO_REGISTER_TP" }, |
| 47 | { 0x0f, "GW_SAP_WP_CLIENT" }, |
| 48 | { 0x10, "GW_CANCEL_REGISTER_TP" }, |
| 49 | { 0x11, "REMOTE_GATEWAY" }, |
| 50 | { 0x12, "GW_CONTAINER_RECEIVED" }, |
| 51 | /* NULL */ |
| 52 | { 0x00, NULL((void*)0) } |
| 53 | }; |
| 54 | |
| 55 | /* SAP RFC Monitor Command field values */ |
| 56 | static const value_string saprfc_monitor_cmd_values[] = { |
| 57 | { 0x01, "NOOP" }, |
| 58 | { 0x02, "DELETE_CONN" }, |
| 59 | { 0x03, "CANCEL_CONN" }, |
| 60 | { 0x04, "RST_SINGLE_ERR_CNT" }, |
| 61 | { 0x05, "RST_ALL_ERR_CNT" }, |
| 62 | { 0x06, "INCREASE_TRACE" }, |
| 63 | { 0x07, "DECREASE_TRACE" }, |
| 64 | { 0x08, "READ_SEC_INFO" }, |
| 65 | { 0x09, "REFRESH_SEC_INFO" }, |
| 66 | { 0x0a, "READ_GWSYS_TBL" }, |
| 67 | { 0x0b, "READ_CONN_TBL" }, |
| 68 | { 0x0c, "READ_PROC_TBL" }, |
| 69 | { 0x0d, "READ_CONN_ATTR" }, |
| 70 | { 0x0e, "READ_MEMORY" }, |
| 71 | { 0x0f, "READ_REQ_BLK" }, |
| 72 | { 0x10, "ACT_STATISTIC" }, |
| 73 | { 0x11, "DEACT_STATISTIC" }, |
| 74 | { 0x12, "READ_STATISTIC" }, |
| 75 | { 0x13, "RESET_STATISTIC" }, |
| 76 | { 0x14, "READ_PARAMETER" }, |
| 77 | { 0x19, "DUMP_NIBUFFER" }, |
| 78 | { 0x20, "RESET_NIBUFFER" }, |
| 79 | { 0x21, "ACT_EXTPGM_TRACE" }, |
| 80 | { 0x22, "DEACT_EXTPGM_TRACE" }, |
| 81 | { 0x23, "ACT_CONN_TRACE" }, |
| 82 | { 0x24, "DEACT_CONN_TRACE" }, |
| 83 | { 0x25, "RESET_TRACE" }, |
| 84 | { 0x26, "SUICIDE" }, |
| 85 | { 0x27, "READ_SEC_INFO2" }, |
| 86 | { 0x28, "CANCEL_REG_TP" }, |
| 87 | { 0x29, "DUMP" }, |
| 88 | { 0x2a, "READ_GWSYS_TBL2" }, |
| 89 | { 0x2b, "CHANGE_PARAMETER" }, |
| 90 | { 0x2c, "GET_CONN_PARTNER" }, |
| 91 | { 0x2d, "DELETE_CLIENT" }, |
| 92 | { 0x2e, "DELETE_REMGW" }, |
| 93 | { 0x2f, "DISCONNECT" }, |
| 94 | { 0x30, "ENABLE_RESTART" }, |
| 95 | { 0x31, "DISABLE_RESTART" }, |
| 96 | { 0x32, "NI_TRACE" }, |
| 97 | { 0x33, "CLI_INFO" }, |
| 98 | { 0x34, "GW_INFO" }, |
| 99 | { 0x35, "CONVID_INFO" }, |
| 100 | { 0x36, "GET_NO_REG_TP" }, |
| 101 | { 0x37, "CV_INFO" }, |
| 102 | { 0x38, "SO_KEEPALIVE" }, |
| 103 | { 0x39, "READ_CONN_TBL2" }, |
| 104 | { 0x40, "READ_GWSYS_TBL3" }, |
| 105 | { 0x41, "RELOAD_ACL" }, |
| 106 | /* NULL */ |
| 107 | { 0x00, NULL((void*)0) } |
| 108 | }; |
| 109 | |
| 110 | /* SAP RFC APPC Header Request Type field values */ |
| 111 | static const value_string saprfc_header_reqtype_values[] = { |
| 112 | { 0x00, "F_NO_REQUEST" }, |
| 113 | { 0x01, "F_INITIALIZE_CONVERSATION" }, |
| 114 | { 0x03, "F_ACCEPT_CONVERSATION" }, |
| 115 | { 0x05, "F_ALLOCATE" }, |
| 116 | { 0x07, "F_SEND_DATA" }, |
| 117 | { 0x08, "F_ASEND_DATA" }, |
| 118 | { 0x09, "F_RECEIVE" }, |
| 119 | { 0x0a, "F_ARECEIVE" }, |
| 120 | { 0x0b, "F_DEALLOCATE" }, |
| 121 | { 0x0d, "F_SET_TP_NAME" }, |
| 122 | { 0x0f, "F_SET_PARTNER_LU_NAME" }, |
| 123 | { 0x11, "F_SET_SECURITY_PASSWORD" }, |
| 124 | { 0x13, "F_SET_SECURITY_USER_ID" }, |
| 125 | { 0x15, "F_SET_SECURITY_TYPE" }, |
| 126 | { 0x17, "F_SET_CONVERSATION_TYPE" }, |
| 127 | { 0x19, "F_EXTRACT_TP_NAME" }, |
| 128 | { 0x1b, "F_FLUSH" }, |
| 129 | { 0xc9, "F_SAP_ALLOCATE" }, |
| 130 | { 0xca, "F_SAP_INIT" }, |
| 131 | { 0xcb, "F_SAP_SEND" }, |
| 132 | { 0xcc, "F_ASAP_SEND" }, |
| 133 | { 0xcd, "F_SAP_SYNC" }, |
| 134 | { 0xce, "F_SAP_PING" }, |
| 135 | { 0xcf, "F_SAP_REGTP" }, |
| 136 | { 0xd0, "F_SAP_UNREGTP" }, |
| 137 | { 0xd1, "F_SAP_ACCPTP" }, |
| 138 | { 0xd2, "F_SAP_UNACCPTP" }, |
| 139 | { 0xd3, "F_SAP_CANCTP" }, |
| 140 | { 0xd4, "F_SAP_SET_UID" }, |
| 141 | { 0xd5, "F_SAP_CANCEL" }, |
| 142 | { 0xd6, "F_SAP_CANCELED" }, |
| 143 | /* NULL */ |
| 144 | { 0x00, NULL((void*)0) } |
| 145 | }; |
| 146 | |
| 147 | |
| 148 | /* SAP RFC APPC Header Protocol field values */ |
| 149 | static const value_string saprfc_header_protocol_values[] = { |
| 150 | { 0x00, "R2PR" }, |
| 151 | { 0x01, "INT" }, |
| 152 | { 0x02, "EXT" }, |
| 153 | { 0x03, "CPIC" }, |
| 154 | { 0x05, "NE" }, |
| 155 | { 0x06, "REG" }, |
| 156 | { 0x42, "CPIC" }, |
| 157 | { 0x44, "EXT" }, |
| 158 | { 0x45, "NE" }, |
| 159 | { 0x48, "INT" }, |
| 160 | { 0x61, "REG" }, |
| 161 | /* NULL */ |
| 162 | { 0x00, NULL((void*)0) } |
| 163 | }; |
| 164 | |
| 165 | /* SAP RFC APPC Header APPC Return Code field values */ |
| 166 | static const value_string saprfc_header_appc_rc_values[] = { |
| 167 | { 0x00, "CM_OK" }, |
| 168 | { 0x01, "CM_ALLOCATE_FAILURE_NO_RETRY" }, |
| 169 | { 0x02, "CM_ALLOCATE_FAILURE_RETRY" }, |
| 170 | { 0x03, "CM_CONVERSATION_TYPE_MISMATCH" }, |
| 171 | { 0x06, "CM_SECURITY_NOT_VALID" }, |
| 172 | { 0x08, "CM_SYNC_LVL_NOT_SUPPORTED_PGM" }, |
| 173 | { 0x09, "CM_TPN_NOT_RECOGNIZED" }, |
| 174 | { 0x0a, "CM_TP_NOT_AVAILABLE_NO_RETRY" }, |
| 175 | { 0x0b, "CM_TP_NOT_AVAILABLE_RETRY" }, |
| 176 | { 0x11, "CM_DEALLOCATED_ABEND" }, |
| 177 | { 0x12, "CM_DEALLOCATED_NORMAL" }, |
| 178 | { 0x13, "CM_PARAMETER_ERROR" }, |
| 179 | { 0x14, "CM_PRODUCT_SPECIFIC_ERROR" }, |
| 180 | { 0x15, "CM_PROGRAM_ERROR_NO_TRUNC" }, |
| 181 | { 0x16, "CM_PROGRAM_ERROR_PURGING" }, |
| 182 | { 0x17, "CM_PROGRAM_ERROR_TRUNC" }, |
| 183 | { 0x18, "CM_PROGRAM_PARAMETER_CHECK" }, |
| 184 | { 0x19, "CM_PROGRAM_STATE_CHECK" }, |
| 185 | { 0x1a, "CM_RESOURCE_FAILURE_NO_RETRY" }, |
| 186 | { 0x1b, "CM_RESOURCE_FAILURE_RETRY" }, |
| 187 | { 0x1c, "CM_UNSUCCESSFUL" }, |
| 188 | { 0x23, "CM_OPERATION_INCOMPLETE" }, |
| 189 | { 0x24, "CM_SYSTEM_EVENT" }, |
| 190 | { 0x2711, "CM_SAP_TIMEOUT_RETRY" }, |
| 191 | { 0x2712, "CM_CANCEL_REQUEST" }, |
| 192 | /* NULL */ |
| 193 | { 0x00, NULL((void*)0) } |
| 194 | }; |
| 195 | |
| 196 | /* SAP RFC APPC Header MCPIC Parameters Client Info values */ |
| 197 | static const value_string saprfc_header_ncpic_parameters_client_info_values[] = { |
| 198 | { 0x00, "GW_NO_CLIENT_INFO" }, |
| 199 | { 0x01, "GW_EXTERNAL_CLIENT" }, |
| 200 | { 0x02, "GW_R3_CLIENT" }, |
| 201 | /* NULL */ |
| 202 | { 0x00, NULL((void*)0) } |
| 203 | }; |
| 204 | |
| 205 | /* ABAP/4 data types, taken from RFC SDK's saprfc.h */ |
| 206 | #define TYPC0 0 |
| 207 | #define TYPDATE1 1 |
| 208 | #define TYPP2 2 |
| 209 | #define TYPTIME3 3 |
| 210 | #define TYPX4 4 |
| 211 | #define TYPTABH5 5 |
| 212 | #define TYPNUM6 6 |
| 213 | #define TYPFLOAT7 7 |
| 214 | #define TYPINT8 8 |
| 215 | #define TYPINT29 9 |
| 216 | #define TYPINT110 10 |
| 217 | /* TYPW = 11 */ |
| 218 | #define TYP112 12 |
| 219 | #define TYP213 13 |
| 220 | #define TYPDECF1623 23 /* IEEE 754r decimal floating point 8 bytes */ |
| 221 | #define TYPDECF3424 24 /* IEEE 754r decimal floating point 16 bytes */ |
| 222 | |
| 223 | static const value_string abap_types_typename_values[] = { |
| 224 | { TYPC0, "CHAR" }, |
| 225 | { TYPDATE1, "DATS" }, |
| 226 | { TYPP2, "BCD" }, |
| 227 | { TYPTIME3, "TIMS" }, |
| 228 | { TYPX4, "RAW" }, |
| 229 | { TYPTABH5, "ITAB" }, |
| 230 | { TYPNUM6, "NUMC" }, |
| 231 | { TYPFLOAT7, "FLTP" }, |
| 232 | { TYPINT8, "INT" }, |
| 233 | { TYPINT29, "INT2" }, |
| 234 | { TYPINT110, "INT1" }, |
| 235 | { TYP112, "DATE_1" }, |
| 236 | { TYP213, "DATE_2" }, |
| 237 | { TYPDECF1623, "DECF16" }, |
| 238 | { TYPDECF3424, "DECF34" }, |
| 239 | /* NULL */ |
| 240 | { 0x00, NULL((void*)0) } |
| 241 | }; |
| 242 | |
| 243 | /* SAP RFC Accept Info Flag values */ |
| 244 | #define SAPRFC_ACCEPT_INFO_EINFO0x01 0x01 |
| 245 | #define SAPRFC_ACCEPT_INFO_PING0x02 0x02 |
| 246 | #define SAPRFC_ACCEPT_INFO_SNC0x04 0x04 |
| 247 | #define SAPRFC_ACCEPT_INFO_CONN_EINFO0x08 0x08 |
| 248 | #define SAPRFC_ACCEPT_INFO_CODE_PAGE0x10 0x10 |
| 249 | #define SAPRFC_ACCEPT_INFO_NIPING0x20 0x20 |
| 250 | #define SAPRFC_ACCEPT_INFO_EXTINITOPT0x40 0x40 |
| 251 | #define SAPRFC_ACCEPT_INFO_GW_ACCEPT_DIST_TRACE0x80 0x80 |
| 252 | |
| 253 | /* SAP RFC APPC Header Info Flags values */ |
| 254 | #define SAPRFC_APPCHDR_INFO1_SYNC_CPIC_FUNCTION0x01 0x01 |
| 255 | #define SAPRFC_APPCHDR_INFO1_WITH_HOSTADDR0x02 0x02 |
| 256 | #define SAPRFC_APPCHDR_INFO1_WITH_GW_SAP_PARAMS_HDR0x04 0x04 |
| 257 | #define SAPRFC_APPCHDR_INFO1_CPIC_SYNC_REQ0x08 0x08 |
| 258 | #define SAPRFC_APPCHDR_INFO1_WITH_ERR_INFO0x10 0x10 |
| 259 | #define SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_OUTPUT0x20 0x20 |
| 260 | #define SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_INPUT0x40 0x40 |
| 261 | #define SAPRFC_APPCHDR_INFO1_R3_CPIC_LOGIN_WITH_TERM0x80 0x80 |
| 262 | |
| 263 | #define SAPRFC_APPCHDR_INFO2_WITH_LONG_LU_NAME0x01 0x01 |
| 264 | #define SAPRFC_APPCHDR_INFO2_WITH_LONG_HOSTADDR0x02 0x02 |
| 265 | #define SAPRFC_APPCHDR_INFO2_GW_IMMEDIATE0x04 0x04 |
| 266 | #define SAPRFC_APPCHDR_INFO2_GW_SNC_ACTIVE0x08 0x08 |
| 267 | #define SAPRFC_APPCHDR_INFO2_GW_WAIT_LOOK_UP0x10 0x10 |
| 268 | #define SAPRFC_APPCHDR_INFO2_SNC_INIT_PHASE0x20 0x20 |
| 269 | #define SAPRFC_APPCHDR_INFO2_GW_STATELESS0x40 0x40 |
| 270 | #define SAPRFC_APPCHDR_INFO2_GW_NO_STATE_CHECK0x80 0x80 |
| 271 | |
| 272 | #define SAPRFC_APPCHDR_INFO3_GW_WITH_CODE_PAGE0x01 0x01 |
| 273 | #define SAPRFC_APPCHDR_INFO3_GW_ASYNC_RFC0x02 0x02 |
| 274 | #define SAPRFC_APPCHDR_INFO3_GW_CANCEL_HARD0x04 0x04 |
| 275 | #define SAPRFC_APPCHDR_INFO3_GW_CANCEL_SOFT0x08 0x08 |
| 276 | #define SAPRFC_APPCHDR_INFO3_GW_WITH_GUI_TIMEOUT0x10 0x10 |
| 277 | #define SAPRFC_APPCHDR_INFO3_GW_TERMIO_ERROR0x20 0x20 |
| 278 | #define SAPRFC_APPCHDR_INFO3_GW_EXTENDED_INIT_OPTIONS0x40 0x40 |
| 279 | #define SAPRFC_APPCHDR_INFO3_GW_DIST_TRACE0x80 0x80 |
| 280 | |
| 281 | #define SAPRFC_APPCHDR_INFO4_GW_WITH_DBG_CTL0x01 0x01 |
| 282 | |
| 283 | /* SAP RFC APPC Header Request Type 2 Flags values */ |
| 284 | #define SAPRFC_APPCHDR_REQTYPE2_F_V_INITIALIZE_CONVERSATION0x01 0x01 |
| 285 | #define SAPRFC_APPCHDR_REQTYPE2_F_V_ALLOCATE0x02 0x02 |
| 286 | #define SAPRFC_APPCHDR_REQTYPE2_F_V_SEND_DATA0x04 0x04 |
| 287 | #define SAPRFC_APPCHDR_REQTYPE2_F_V_RECEIVE0x08 0x08 |
| 288 | #define SAPRFC_APPCHDR_REQTYPE2_F_V_FLUSH0x10 0x10 |
| 289 | |
| 290 | |
| 291 | static int proto_saprfc; |
| 292 | |
| 293 | static int hf_saprfc_version; |
| 294 | static int hf_saprfc_reqtype; |
| 295 | static int hf_saprfc_address; |
| 296 | static int hf_saprfc_service; |
| 297 | static int hf_saprfc_codepage; |
| 298 | static int hf_saprfc_lu; |
| 299 | static int hf_saprfc_tp; |
| 300 | static int hf_saprfc_conversation_id; |
| 301 | static int hf_saprfc_appc_header_version; |
| 302 | static int hf_saprfc_accept_info; /* (EINFO PING CONN_EINFO EXTINITOPT GW_ACCEPT_DIST_TRACE (0xCB)) */ |
| 303 | static int hf_saprfc_accept_info_EINFO; |
| 304 | static int hf_saprfc_accept_info_PING; |
| 305 | static int hf_saprfc_accept_info_SNC; |
| 306 | static int hf_saprfc_accept_info_CONN_EINFO; |
| 307 | static int hf_saprfc_accept_info_CODE_PAGE; |
| 308 | static int hf_saprfc_accept_info_NIPING; |
| 309 | static int hf_saprfc_accept_info_EXTINITOPT; |
| 310 | static int hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE; |
| 311 | static int hf_saprfc_idx; |
| 312 | static int hf_saprfc_address6; |
| 313 | static int hf_saprfc_rc; |
| 314 | static int hf_saprfc_echo_data; |
| 315 | static int hf_saprfc_filler; |
| 316 | |
| 317 | static int hf_saprfc_monitor_cmd; |
| 318 | |
| 319 | static int hf_saprfc_header; |
| 320 | static int hf_saprfc_header_version; |
| 321 | static int hf_saprfc_header_reqtype; |
| 322 | static int hf_saprfc_header_protocol; |
| 323 | static int hf_saprfc_header_mode; |
| 324 | static int hf_saprfc_header_uid; |
| 325 | static int hf_saprfc_header_gw_id; |
| 326 | static int hf_saprfc_header_err_len; |
| 327 | static int hf_saprfc_header_info2; |
| 328 | static int hf_saprfc_header_info2_WITH_LONG_LU_NAME; |
| 329 | static int hf_saprfc_header_info2_WITH_LONG_HOSTADDR; |
| 330 | static int hf_saprfc_header_info2_GW_IMMEDIATE; |
| 331 | static int hf_saprfc_header_info2_GW_SNC_ACTIVE; |
| 332 | static int hf_saprfc_header_info2_GW_WAIT_LOOK_UP; |
| 333 | static int hf_saprfc_header_info2_SNC_INIT_PHASE; |
| 334 | static int hf_saprfc_header_info2_GW_STATELESS; |
| 335 | static int hf_saprfc_header_info2_GW_NO_STATE_CHECK; |
| 336 | static int hf_saprfc_header_trace_level; |
| 337 | static int hf_saprfc_header_time; |
| 338 | static int hf_saprfc_header_info3; |
| 339 | static int hf_saprfc_header_info3_GW_WITH_CODE_PAGE; |
| 340 | static int hf_saprfc_header_info3_GW_ASYNC_RFC; |
| 341 | static int hf_saprfc_header_info3_GW_CANCEL_HARD; |
| 342 | static int hf_saprfc_header_info3_GW_CANCEL_SOFT; |
| 343 | static int hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT; |
| 344 | static int hf_saprfc_header_info3_GW_TERMIO_ERROR; |
| 345 | static int hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS; |
| 346 | static int hf_saprfc_header_info3_GW_DIST_TRACE; |
| 347 | static int hf_saprfc_header_timeout; |
| 348 | static int hf_saprfc_header_info4; |
| 349 | static int hf_saprfc_header_info4_GW_WITH_DBG_CTL; |
| 350 | static int hf_saprfc_header_sequence_no; |
| 351 | static int hf_saprfc_header_sap_params_len; |
| 352 | static int hf_saprfc_header_info; |
| 353 | static int hf_saprfc_header_info_SYNC_CPIC_FUNCTION; |
| 354 | static int hf_saprfc_header_info_WITH_HOSTADDR; |
| 355 | static int hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR; |
| 356 | static int hf_saprfc_header_info_CPIC_SYNC_REQ; |
| 357 | static int hf_saprfc_header_info_WITH_ERR_INFO; |
| 358 | static int hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT; |
| 359 | static int hf_saprfc_header_info_DATA_WITH_TERM_INPUT; |
| 360 | static int hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM; |
| 361 | static int hf_saprfc_header_reqtype2; |
| 362 | static int hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION; |
| 363 | static int hf_saprfc_header_reqtype2_F_V_ALLOCATE; |
| 364 | static int hf_saprfc_header_reqtype2_F_V_SEND_DATA; |
| 365 | static int hf_saprfc_header_reqtype2_F_V_RECEIVE; |
| 366 | static int hf_saprfc_header_reqtype2_F_V_FLUSH; |
| 367 | static int hf_saprfc_header_appc_rc; |
| 368 | static int hf_saprfc_header_sap_rc; /* TODO: Add SAP Return values */ |
| 369 | static int hf_saprfc_header_conversation_id; |
| 370 | static int hf_saprfc_header_ncpic_parameters; |
| 371 | static int hf_saprfc_header_ncpic_parameters_sdest; |
| 372 | static int hf_saprfc_header_ncpic_parameters_lu; |
| 373 | static int hf_saprfc_header_ncpic_parameters_tp; |
| 374 | static int hf_saprfc_header_ncpic_parameters_ctype; |
| 375 | static int hf_saprfc_header_ncpic_parameters_client_info; |
| 376 | static int hf_saprfc_header_ncpic_parameters_lu_name; |
| 377 | static int hf_saprfc_header_ncpic_parameters_lu_name_length; |
| 378 | static int hf_saprfc_header_ncpic_parameters_host_address; |
| 379 | static int hf_saprfc_header_ncpic_parameters_security_password; |
| 380 | static int hf_saprfc_header_ncpic_parameters_security_password_length; |
| 381 | |
| 382 | static int hf_saprfc_header_comm_idx; |
| 383 | static int hf_saprfc_header_conn_idx; |
| 384 | |
| 385 | static int hf_saprfc_item; |
| 386 | static int hf_saprfc_item_id1; |
| 387 | static int hf_saprfc_item_id2; |
| 388 | static int hf_saprfc_item_length; |
| 389 | static int hf_saprfc_item_value; |
| 390 | |
| 391 | static int hf_saprfc_table; |
| 392 | static int hf_saprfc_table_structure; |
| 393 | static int hf_saprfc_table_structure_field; |
| 394 | static int hf_saprfc_table_structure_field_type; |
| 395 | static int hf_saprfc_table_structure_field_length; |
| 396 | static int hf_saprfc_table_row; |
| 397 | static int hf_saprfc_table_row_field; |
| 398 | static int hf_saprfc_table_length; |
| 399 | static int hf_saprfc_table_compress_header; |
| 400 | static int hf_saprfc_table_uncomplength; |
| 401 | static int hf_saprfc_table_algorithm; |
| 402 | static int hf_saprfc_table_magic; |
| 403 | static int hf_saprfc_table_special; |
| 404 | static int hf_saprfc_table_return_code; |
| 405 | static int hf_saprfc_table_content; |
| 406 | |
| 407 | static int hf_saprfc_payload; |
| 408 | |
| 409 | |
| 410 | /* TODO: Add CPIC error codes (https://launchpad.support.sap.com/#/notes/63347) */ |
| 411 | /* TODO: Add RFC logon error codes (https://launchpad.support.sap.com/#/notes/320991) */ |
| 412 | |
| 413 | static int ett_saprfc; |
| 414 | |
| 415 | /* Expert info */ |
| 416 | static expert_field ei_saprfc_invalid_decompression; |
| 417 | static expert_field ei_saprfc_invalid_decompress_length; |
| 418 | static expert_field ei_saprfc_invalid_table_length; |
| 419 | static expert_field ei_saprfc_item_length_invalid; |
| 420 | static expert_field ei_saprfc_unknown_item; |
| 421 | |
| 422 | |
| 423 | /* Global decompress preference */ |
| 424 | static bool_Bool global_saprfc_decompress = true1; |
| 425 | static unsigned global_saprfc_max_uncompressed_size = SAPRFC_DEFAULT_MAX_UNCOMPRESSED_SIZE(16U * 1024U * 1024U); |
| 426 | |
| 427 | /* Global table reassembling preference */ |
| 428 | static bool_Bool global_saprfc_table_reassembly = true1; |
| 429 | static unsigned global_saprfc_max_reassembled_size = SAPRFC_DEFAULT_MAX_REASSEMBLED_SIZE(16U * 1024U * 1024U); |
| 430 | |
| 431 | /* Global highlight preference */ |
| 432 | static bool_Bool global_saprfc_highlight_items = true1; |
| 433 | |
| 434 | /* Protocol handles for both external and internal dissectors */ |
| 435 | static dissector_handle_t saprfc_handle; |
| 436 | static dissector_handle_t saprfcinternal_handle; |
| 437 | |
| 438 | /* Keeps track of table content items */ |
| 439 | static uint32_t global_saprfc_table_content_counter = 0; |
| 440 | |
| 441 | |
| 442 | void proto_register_saprfc(void); |
| 443 | void proto_reg_handoff_saprfc(void); |
| 444 | |
| 445 | |
| 446 | static bool_Bool |
| 447 | check_saprfc_compression(tvbuff_t *tvb, uint32_t offset) |
| 448 | { |
| 449 | /* We check for the length, the algorithm value and the presence of magic bytes */ |
| 450 | if ((tvb_captured_length_remaining(tvb, offset) >= 8) && |
| 451 | ((tvb_get_uint8(tvb, offset+4) == 0x11) || (tvb_get_uint8(tvb, offset+4) == 0x12)) && |
| 452 | (tvb_get_uint16(tvb, offset+5, ENC_LITTLE_ENDIAN0x80000000) == 0x9d1f)){ |
| 453 | return true1; |
| 454 | } |
| 455 | return false0; |
| 456 | } |
| 457 | |
| 458 | |
| 459 | static void |
| 460 | dissect_saprfc_tables_compressed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ |
| 461 | |
| 462 | int rt = 0; |
| 463 | int compressed_length; |
| 464 | uint32_t offset = 0; |
| 465 | uint32_t reported_length = 0; |
| 466 | uint32_t uncompress_length = 0; |
| 467 | uint32_t table_offset = 0; |
| 468 | tvbuff_t *decompressed_tvb = NULL((void*)0); |
| 469 | const uint8_t *compressed_buffer = NULL((void*)0); |
| 470 | uint8_t *decompressed_buffer = NULL((void*)0); |
| 471 | |
| 472 | proto_item *compression_header = NULL((void*)0); |
| 473 | proto_tree *compression_header_tree = NULL((void*)0); |
| 474 | proto_item *decompress_return_code = NULL((void*)0); |
| 475 | proto_item *rl = NULL((void*)0); |
| 476 | |
| 477 | /* Skip the table prefix preceding the compression header. */ |
| 478 | offset = SAPRFC_TABLE_PREFIX_LENGTH8U; |
| 479 | |
| 480 | /* Add the compression header subtree */ |
| 481 | compression_header = proto_tree_add_item(tree, hf_saprfc_table_compress_header, tvb, offset, 8, ENC_NA0x00000000); |
| 482 | compression_header_tree = proto_item_add_subtree(compression_header, ett_saprfc); |
| 483 | |
| 484 | table_offset = offset; |
| 485 | |
| 486 | /* Add the uncompressed length */ |
| 487 | reported_length = tvb_get_letohl(tvb, offset); |
| 488 | rl = proto_tree_add_uint(compression_header_tree, hf_saprfc_table_uncomplength, tvb, offset, 4, reported_length); |
| 489 | offset += 4; |
| 490 | proto_item_append_text(compression_header, ", Uncompressed Len: %u", reported_length); |
| 491 | col_append_fstr(pinfo->cinfo, COL_INFO, " Uncompressed Length=%u ", reported_length); |
| 492 | |
| 493 | /* Add the algorithm */ |
| 494 | proto_tree_add_item(compression_header_tree, hf_saprfc_table_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 495 | offset++; |
| 496 | /* Add the magic bytes */ |
| 497 | proto_tree_add_item(compression_header_tree, hf_saprfc_table_magic, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 498 | offset += 2; |
| 499 | /* Add the max bits */ |
| 500 | proto_tree_add_item(compression_header_tree, hf_saprfc_table_special, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 501 | offset++; |
| 502 | |
| 503 | if (global_saprfc_decompress){ |
| 504 | if (reported_length == 0 || reported_length > global_saprfc_max_uncompressed_size) { |
| 505 | expert_add_info_format(pinfo, rl, &ei_saprfc_invalid_decompress_length, |
| 506 | "Reported uncompressed payload length %u is invalid or exceeds the configured maximum of %u bytes", |
| 507 | reported_length, global_saprfc_max_uncompressed_size); |
| 508 | } else { |
| 509 | compressed_length = tvb_captured_length_remaining(tvb, table_offset); |
| 510 | compressed_buffer = tvb_get_ptr(tvb, table_offset, compressed_length); |
| 511 | decompressed_buffer = (uint8_t *)wmem_alloc0(pinfo->pool, reported_length); |
| 512 | uncompress_length = reported_length; |
| 513 | |
| 514 | rt = sap_lzclzh_decompress(pinfo->pool, compressed_buffer, |
| 515 | compressed_length, decompressed_buffer, &uncompress_length); |
| 516 | |
| 517 | decompress_return_code = proto_tree_add_int_format_value(compression_header_tree, |
| 518 | hf_saprfc_table_return_code, tvb, table_offset, 0, rt, |
| 519 | "%d (%s)", rt, sap_lzclzh_decompress_error_string(rt)); |
| 520 | proto_item_set_generated(decompress_return_code); |
| 521 | |
| 522 | if (rt != CS_END_OF_STREAM1) { |
| 523 | expert_add_info_format(pinfo, compression_header, &ei_saprfc_invalid_decompression, |
| 524 | "Decompression of table failed with return code %d (%s)", |
| 525 | rt, sap_lzclzh_decompress_error_string(rt)); |
| 526 | } else { |
| 527 | if (uncompress_length != reported_length) { |
| 528 | expert_add_info_format(pinfo, rl, &ei_saprfc_invalid_decompress_length, |
| 529 | "The uncompressed table length (%u) differs from the reported length (%u)", |
| 530 | uncompress_length, reported_length); |
| 531 | } |
| 532 | |
| 533 | decompressed_tvb = tvb_new_child_real_data(tvb, decompressed_buffer, |
| 534 | uncompress_length, uncompress_length); |
| 535 | add_new_data_source(pinfo, decompressed_tvb, "Uncompressed Table Data"); |
| 536 | |
| 537 | /* Add the table subtree using the new tvb. */ |
| 538 | proto_tree_add_item(tree, hf_saprfc_table_content, decompressed_tvb, 0, -1, ENC_NA0x00000000); |
| 539 | |
| 540 | /* TODO: Dissect SAP RFC Table content */ |
| 541 | return; |
| 542 | } |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | /* Add the payload subtree */ |
| 547 | proto_tree_add_item(tree, hf_saprfc_table_content, tvb, offset, -1, ENC_NA0x00000000); |
| 548 | } |
| 549 | |
| 550 | static void |
| 551 | dissect_saprfc_tables(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, uint16_t item_length){ |
| 552 | |
| 553 | uint8_t *reassemble_buffer = NULL((void*)0), *table_name = NULL((void*)0); |
| 554 | uint16_t next_item = 0; |
| 555 | uint32_t reassemble_length = 0, reassemble_offset = 0, initial_offset = 0; |
| 556 | |
| 557 | proto_item *table = NULL((void*)0); |
| 558 | proto_tree *table_tree = NULL((void*)0); |
| 559 | tvbuff_t *compressed_tvb = NULL((void*)0); |
| 560 | |
| 561 | /* Skip table line structure */ |
| 562 | if (tvb_captured_length_remaining(tvb, offset) < item_length + 6U){ |
| 563 | expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length); |
| 564 | return; |
| 565 | } |
| 566 | offset += item_length + 2; |
| 567 | |
| 568 | next_item = tvb_get_ntohs(tvb, offset); |
| 569 | offset+=2; |
| 570 | if (next_item != 0x0301){ |
| 571 | return; |
| 572 | } |
| 573 | |
| 574 | item_length = tvb_get_ntohs(tvb, offset); |
| 575 | offset += 2; |
| 576 | if (tvb_captured_length_remaining(tvb, offset) < item_length + 6U){ |
| 577 | expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length); |
| 578 | return; |
| 579 | } |
| 580 | table_name = tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000); |
| 581 | offset += item_length; |
| 582 | offset += 2; |
| 583 | |
| 584 | next_item = tvb_get_ntohs(tvb, offset); |
| 585 | offset += 2; |
| 586 | if (next_item != 0x0302){ |
| 587 | return; |
| 588 | } |
| 589 | |
| 590 | item_length = tvb_get_ntohs(tvb, offset); |
| 591 | offset += 2; |
| 592 | if (item_length < 8 || tvb_captured_length_remaining(tvb, offset) < item_length + 6U){ |
| 593 | expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length); |
| 594 | return; |
| 595 | } |
| 596 | /* Row width and count are currently not dissected, but are part of the fixed header. */ |
| 597 | tvb_get_ntohl(tvb, offset); |
| 598 | offset += 4; |
| 599 | tvb_get_ntohl(tvb, offset); |
| 600 | offset += 4; |
| 601 | offset += (item_length - 8) + 2; |
| 602 | |
| 603 | next_item = tvb_get_ntohs(tvb, offset); |
| 604 | offset += 2; |
| 605 | if (next_item != 0x0305){ |
| 606 | return; |
| 607 | } |
| 608 | |
| 609 | item_length = tvb_get_ntohs(tvb, offset); |
| 610 | offset += 2; |
| 611 | if (item_length < SAPRFC_TABLE_PREFIX_LENGTH8U || |
| 612 | tvb_captured_length_remaining(tvb, offset) < SAPRFC_TABLE_PREFIX_LENGTH8U){ |
| 613 | expert_add_info(pinfo, tree, &ei_saprfc_invalid_table_length); |
| 614 | return; |
| 615 | } |
| 616 | |
| 617 | /* Get the reassemble length */ |
| 618 | initial_offset = offset; |
| 619 | reassemble_length = tvb_get_ntohl(tvb, offset + 4); |
| 620 | if (reassemble_length < SAPRFC_TABLE_PREFIX_LENGTH8U || |
| 621 | reassemble_length > global_saprfc_max_reassembled_size){ |
| 622 | expert_add_info_format(pinfo, tree, &ei_saprfc_invalid_table_length, |
| 623 | "Reported reassembled table length %u is invalid or exceeds the configured maximum of %u bytes", |
| 624 | reassemble_length, global_saprfc_max_reassembled_size); |
| 625 | return; |
| 626 | } |
| 627 | if (item_length > (reassemble_length - reassemble_offset)){ |
| 628 | item_length = reassemble_length - reassemble_offset; |
| 629 | } |
| 630 | |
| 631 | /* Allocate the buffer only in the scope of current packet */ |
| 632 | reassemble_buffer = (uint8_t *)wmem_alloc(pinfo->pool, reassemble_length); |
| 633 | if (!reassemble_buffer){ |
| 634 | return; |
| 635 | } |
| 636 | |
| 637 | /* Reassemble the table content, retaining the actual captured length. */ |
| 638 | while (reassemble_offset < reassemble_length){ |
| 639 | if (tvb_captured_length_remaining(tvb, offset) < item_length){ |
| 640 | break; |
| 641 | } |
| 642 | tvb_memcpy(tvb, reassemble_buffer + reassemble_offset, offset, item_length); |
| 643 | offset += item_length; |
| 644 | reassemble_offset += item_length; |
| 645 | if (reassemble_offset == reassemble_length){ |
| 646 | break; |
| 647 | } |
| 648 | |
| 649 | /* Skip the closing marker and read the next item identifier. */ |
| 650 | if (tvb_captured_length_remaining(tvb, offset) < 4){ |
| 651 | break; |
| 652 | } |
| 653 | offset += 2; |
| 654 | next_item = tvb_get_ntohs(tvb, offset); |
| 655 | offset+=2; |
| 656 | if (next_item == 0x0305){ |
| 657 | if (tvb_captured_length_remaining(tvb, offset) < 2){ |
| 658 | break; |
| 659 | } |
| 660 | item_length = tvb_get_ntohs(tvb, offset); |
| 661 | offset+=2; |
| 662 | |
| 663 | if (item_length > (reassemble_length - reassemble_offset)){ |
| 664 | item_length = reassemble_length - reassemble_offset; |
| 665 | } |
| 666 | |
| 667 | /* If the table content doesn't continue, we've completed */ |
| 668 | } else { |
| 669 | break; |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | /* Expose only bytes actually copied; retain the declared length as reported length. */ |
| 674 | compressed_tvb = tvb_new_child_real_data(tvb, reassemble_buffer, reassemble_offset, reassemble_length); |
| 675 | |
| 676 | /* Add the Table subtree */ |
| 677 | table = proto_tree_add_item(tree, hf_saprfc_table, tvb, initial_offset, offset - initial_offset, ENC_NA0x00000000); |
| 678 | table_tree = proto_item_add_subtree(table, ett_saprfc); |
| 679 | |
| 680 | proto_item_append_text(table, ", Name=%s", table_name); |
| 681 | |
| 682 | /* Only complete tables can safely be passed to the decompressor. */ |
| 683 | if (reassemble_offset == reassemble_length && |
| 684 | check_saprfc_compression(compressed_tvb, SAPRFC_TABLE_PREFIX_LENGTH8U)) { |
| 685 | dissect_saprfc_tables_compressed(compressed_tvb, pinfo, table_tree); |
| 686 | } else { |
| 687 | proto_tree_add_item(table_tree, hf_saprfc_table_content, compressed_tvb, |
| 688 | SAPRFC_TABLE_PREFIX_LENGTH8U, -1, ENC_NA0x00000000); |
| 689 | if (reassemble_offset != reassemble_length){ |
| 690 | expert_add_info_format(pinfo, table, &ei_saprfc_invalid_table_length, |
| 691 | "Reassembled table contains %u of %u reported bytes", |
| 692 | reassemble_offset, reassemble_length); |
| 693 | } |
| 694 | } |
| 695 | |
| 696 | } |
| 697 | |
| 698 | static void |
| 699 | dissect_saprfc_item(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *item_value_tree, uint32_t offset, uint8_t item_id1, uint8_t item_id2, uint16_t item_length){ |
| 700 | |
| 701 | if (item_id1==0x01 && item_id2==0x02){ |
| 702 | const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000); |
| 703 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Function Name: %s", value_str); |
| 704 | proto_item_append_text(item, ", Function Name=%s", value_str); |
| 705 | |
| 706 | } else if (item_id1==0x02 && item_id2==0x01){ |
| 707 | const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000); |
| 708 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Import Parameter Name: %s", value_str); |
| 709 | proto_item_append_text(item, ", Import Parameter Name=%s", value_str); |
| 710 | |
| 711 | } else if (item_id1==0x02 && item_id2==0x05){ |
| 712 | const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000); |
| 713 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Export Parameter Name: %s", value_str); |
| 714 | proto_item_append_text(item, ", Export Parameter Name=%s", value_str); |
| 715 | |
| 716 | } else if (item_id1==0x02 && item_id2==0x13){ |
| 717 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Type Structure A"); |
| 718 | |
| 719 | } else if (item_id1==0x03 && item_id2==0x01){ |
| 720 | const char *value_str = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, item_length, ENC_ASCII0x00000000); |
| 721 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Name: %s", value_str); |
| 722 | proto_item_append_text(item, ", Table Name=%s", value_str); |
| 723 | |
| 724 | } else if (item_id1==0x03 && item_id2==0x02){ |
| 725 | uint32_t value_uint32; |
| 726 | |
| 727 | if (item_length != 8) { |
| 728 | expert_add_info_format(pinfo, item_value_tree, &ei_saprfc_item_length_invalid, "Table Info length is invalid"); |
| 729 | } |
| 730 | value_uint32 = tvb_get_ntohl(tvb, offset); |
| 731 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "Row Width: %d", value_uint32); |
| 732 | proto_item_append_text(item, ", Row Width=%d", value_uint32); |
| 733 | offset+=4; |
| 734 | value_uint32 = tvb_get_ntohl(tvb, offset); |
| 735 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "Total Row Count: %d", value_uint32); |
| 736 | proto_item_append_text(item, ", Total Row Count=%d", value_uint32); |
| 737 | |
| 738 | } else if (item_id1==0x03 && item_id2==0x05){ |
| 739 | global_saprfc_table_content_counter+= 1; |
| 740 | if (global_saprfc_table_content_counter==1){ |
| 741 | offset += 4; /* Skip the first 4 bytes */ |
| 742 | proto_tree_add_item(item_value_tree, hf_saprfc_table_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 743 | offset += 4; |
| 744 | } |
| 745 | |
| 746 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Content LZ"); |
| 747 | |
| 748 | if (global_saprfc_table_content_counter==1){ |
| 749 | proto_item_append_text(item, ", Table Content LZ (first)"); |
| 750 | } else { |
| 751 | proto_item_append_text(item, ", Table Content LZ"); |
| 752 | } |
| 753 | |
| 754 | } else if (item_id1==0x03 && item_id2==0x06){ |
| 755 | global_saprfc_table_content_counter = 0; |
| 756 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, item_length, "Table Content End"); |
| 757 | proto_item_append_text(item, ", Table Content End"); |
| 758 | |
| 759 | } else if (item_id1==0x01 && item_id2==0x36){ |
| 760 | const char *value_str; |
| 761 | uint8_t value_uint8; |
| 762 | uint32_t value_uint32; |
| 763 | |
| 764 | value_uint8 = tvb_get_uint8(tvb, offset); |
| 765 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 1, "#: %u", value_uint8); |
| 766 | proto_item_append_text(item, ", #=%u", value_uint8); |
| 767 | offset+=1; |
| 768 | value_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, 16); |
| 769 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 16, "Root-id: %s", value_str); |
| 770 | proto_item_append_text(item, ", Root-id=%s", value_str); |
| 771 | offset+=16; |
| 772 | value_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, 16); |
| 773 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 16, "Coon-id: %s", value_str); |
| 774 | proto_item_append_text(item, ", Coon-id=%s", value_str); |
| 775 | offset+=16; |
| 776 | value_uint32 = tvb_get_ntohl(tvb, offset); |
| 777 | proto_tree_add_none_format(item_value_tree, hf_saprfc_item_value, tvb, offset, 4, "#: %d", value_uint32); |
| 778 | proto_item_append_text(item, ", #=%u", value_uint32); |
| 779 | |
| 780 | } else if (item_id1==0xFF && item_id2==0xFF){ |
| 781 | proto_item_append_text(item, ", End of RFC message"); |
| 782 | |
| 783 | } else { |
| 784 | /* If the preference is set, report the item as unknown in the expert info */ |
| 785 | if (global_saprfc_highlight_items){ |
| 786 | expert_add_info_format(pinfo, item, &ei_saprfc_unknown_item, "The RFC item has a unknown type that is not dissected (%u %u)", item_id1, item_id2); |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | static void |
| 792 | dissect_saprfc_payload(tvbuff_t *tvb, packet_info *info, proto_tree *tree, proto_tree *parent_tree, uint32_t offset){ |
| 793 | |
| 794 | uint8_t item_id1, item_id2; |
| 795 | uint16_t item_value_length; |
| 796 | uint32_t item_length; |
| 797 | int remaining_length; |
| 798 | unsigned reported_remaining_length; |
| 799 | tvbuff_t *item_value_tvb = NULL((void*)0); |
| 800 | |
| 801 | proto_item *item = NULL((void*)0), *item_value = NULL((void*)0); |
| 802 | proto_tree *item_tree = NULL((void*)0), *item_value_tree = NULL((void*)0); |
| 803 | |
| 804 | while (tvb_reported_length_remaining(tvb, offset) > 0){ |
| 805 | item_length = 0; |
| 806 | item_value_length = 0; |
Value stored to 'item_value_length' is never read | |
| 807 | item_id2 = 0; |
| 808 | |
| 809 | /* Add the item subtree. We start with a item's length of 1, as we don't have yet the real size of the item */ |
| 810 | item = proto_tree_add_item(tree, hf_saprfc_item, tvb, offset, 1, ENC_NA0x00000000); |
| 811 | item_tree = proto_item_add_subtree(item, ett_saprfc); |
| 812 | |
| 813 | /* Get the first identifier */ |
| 814 | proto_tree_add_item_ret_uint8(item_tree, hf_saprfc_item_id1, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &item_id1); |
| 815 | offset += 1; |
| 816 | item_length += 1; |
| 817 | proto_item_append_text(item, ": (0x%.2x)", item_id1); |
| 818 | |
| 819 | /* Check if it's an End of message */ |
| 820 | if (item_id1==0x0c){ |
| 821 | break; /* ? */ |
| 822 | |
| 823 | /* Otherwise follow dissection */ |
| 824 | } else { |
| 825 | /* ID2 and the two-byte value length must be present. */ |
| 826 | if (tvb_reported_length_remaining(tvb, offset) < 3 || |
| 827 | tvb_captured_length_remaining(tvb, offset) < 3){ |
| 828 | expert_add_info(info, item, &ei_saprfc_item_length_invalid); |
| 829 | return; |
| 830 | } |
| 831 | |
| 832 | proto_tree_add_item_ret_uint8(item_tree, hf_saprfc_item_id2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &item_id2); |
| 833 | offset += 1; |
| 834 | item_length += 1; |
| 835 | proto_item_append_text(item, ", (0x%.2x)", item_id2); |
| 836 | |
| 837 | item_value_length = tvb_get_ntohs(tvb, offset); |
| 838 | proto_tree_add_item(item_tree, hf_saprfc_item_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 839 | offset += 2; |
| 840 | item_length += 2; |
| 841 | proto_item_append_text(item, ", Length=%d", item_value_length); |
| 842 | } |
| 843 | |
| 844 | /* Every regular item includes its value followed by repeated ID markers. */ |
| 845 | remaining_length = tvb_captured_length_remaining(tvb, offset); |
| 846 | reported_remaining_length = tvb_reported_length_remaining(tvb, offset); |
| 847 | if (remaining_length < 0 || (uint32_t)remaining_length < (uint32_t)item_value_length + 2U || |
| 848 | reported_remaining_length < (uint32_t)item_value_length + 2U){ |
| 849 | expert_add_info(info, item, &ei_saprfc_item_length_invalid); |
| 850 | if (remaining_length > 0){ |
| 851 | proto_tree_add_item(item_tree, hf_saprfc_item_value, tvb, offset, remaining_length, ENC_NA0x00000000); |
| 852 | } |
| 853 | return; |
| 854 | } |
| 855 | |
| 856 | /* Now we have the real length of the item, set the proper size */ |
| 857 | item_length += item_value_length; |
| 858 | proto_item_set_len(item, item_length); |
| 859 | |
| 860 | item_value = proto_tree_add_item(item_tree, hf_saprfc_item_value, tvb, offset, item_value_length, ENC_NA0x00000000); |
| 861 | item_value_tree = proto_item_add_subtree(item_value, ett_saprfc); |
| 862 | item_value_tvb = tvb_new_subset_length(tvb, offset, item_value_length); |
| 863 | dissect_saprfc_item(item_value_tvb, info, item, item_value_tree, 0, item_id1, item_id2, item_value_length); |
| 864 | |
| 865 | /* Also send the tables items for reassembling */ |
| 866 | if (global_saprfc_table_reassembly && item_id1==0x02 && item_id2==0x13){ |
| 867 | dissect_saprfc_tables(item_value_tvb, info, parent_tree, 0, item_value_length); |
| 868 | } |
| 869 | |
| 870 | offset+= item_value_length; |
| 871 | |
| 872 | /* ID1 and ID2 are repeated as closing markers */ |
| 873 | offset+= 2; |
| 874 | |
| 875 | /* 0xFF 0xFF marks end of RFC message */ |
| 876 | if (item_id1==0xFF && item_id2==0xFF){ |
| 877 | break; |
| 878 | } |
| 879 | } |
| 880 | |
| 881 | } |
| 882 | |
| 883 | |
| 884 | static void |
| 885 | dissect_saprfc_monitor_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint8_t version _U___attribute__((unused)), uint32_t offset){ |
| 886 | uint8_t opcode; |
| 887 | |
| 888 | opcode = tvb_get_uint8(tvb, offset); |
| 889 | col_append_fstr(pinfo->cinfo, COL_INFO, ", Command=%s", val_to_str_const(opcode, saprfc_monitor_cmd_values, "Unknown")); |
| 890 | |
| 891 | proto_tree_add_item(tree, hf_saprfc_monitor_cmd, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 892 | //offset+=1; |
| 893 | proto_item_append_text(tree, ", Command=%s", val_to_str_const(opcode, saprfc_monitor_cmd_values, "Unknown")); |
| 894 | |
| 895 | // TODO: Dissect RFC monitor command opcodes |
| 896 | } |
| 897 | |
| 898 | |
| 899 | static void |
| 900 | dissect_saprfc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset){ |
| 901 | uint8_t version = 0, reqtype = 0; |
| 902 | proto_item *header = NULL((void*)0), *info = NULL((void*)0), *info2 = NULL((void*)0), *info3 = NULL((void*)0), *info4 = NULL((void*)0), *reqtype2 = NULL((void*)0), *params = NULL((void*)0); |
| 903 | proto_tree *header_tree = NULL((void*)0), *info_tree = NULL((void*)0), *info2_tree = NULL((void*)0), *info3_tree = NULL((void*)0), *info4_tree = NULL((void*)0), *reqtype2_tree = NULL((void*)0), *params_tree; |
| 904 | |
| 905 | version = tvb_get_uint8(tvb, offset); |
| 906 | reqtype = tvb_get_uint8(tvb, offset + 1); |
| 907 | |
| 908 | col_append_fstr(pinfo->cinfo, COL_INFO, "APPC Version=%u, Request Type=%s", version, val_to_str_const(reqtype, saprfc_header_reqtype_values, "Unknown")); |
| 909 | |
| 910 | /* Add the APPC header subtree */ |
| 911 | header = proto_tree_add_item(tree, hf_saprfc_header, tvb, offset, 28, ENC_NA0x00000000); |
| 912 | header_tree = proto_item_add_subtree(header, ett_saprfc); |
| 913 | |
| 914 | proto_item_append_text(header, ", Version=%u, Request Type=%s", version, val_to_str_const(reqtype, saprfc_header_reqtype_values, "Unknown")); |
| 915 | |
| 916 | proto_tree_add_item(header_tree, hf_saprfc_header_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 917 | offset += 1; |
| 918 | proto_tree_add_item(header_tree, hf_saprfc_header_reqtype, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 919 | offset += 1; |
| 920 | proto_tree_add_item(header_tree, hf_saprfc_header_protocol, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 921 | offset += 1; |
| 922 | proto_tree_add_item(header_tree, hf_saprfc_header_mode, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 923 | offset += 1; |
| 924 | proto_tree_add_item(header_tree, hf_saprfc_header_uid, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 925 | offset += 2; |
| 926 | proto_tree_add_item(header_tree, hf_saprfc_header_gw_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 927 | offset += 2; |
| 928 | proto_tree_add_item(header_tree, hf_saprfc_header_err_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 929 | offset += 2; |
| 930 | |
| 931 | info2 = proto_tree_add_item(header_tree, hf_saprfc_header_info2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 932 | info2_tree = proto_item_add_subtree(info2, ett_saprfc); |
| 933 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_WITH_LONG_LU_NAME, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 934 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_WITH_LONG_HOSTADDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 935 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_IMMEDIATE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 936 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_SNC_ACTIVE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 937 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_WAIT_LOOK_UP, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 938 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_SNC_INIT_PHASE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 939 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_STATELESS, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 940 | proto_tree_add_item(info2_tree, hf_saprfc_header_info2_GW_NO_STATE_CHECK, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 941 | offset += 1; |
| 942 | |
| 943 | proto_tree_add_item(header_tree, hf_saprfc_header_trace_level, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 944 | offset += 1; |
| 945 | proto_tree_add_item(header_tree, hf_saprfc_header_time, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 946 | offset += 4; |
| 947 | |
| 948 | info3 = proto_tree_add_item(header_tree, hf_saprfc_header_info3, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 949 | info3_tree = proto_item_add_subtree(info3, ett_saprfc); |
| 950 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_WITH_CODE_PAGE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 951 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_ASYNC_RFC, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 952 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_CANCEL_HARD, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 953 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_CANCEL_SOFT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 954 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 955 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_TERMIO_ERROR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 956 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 957 | proto_tree_add_item(info3_tree, hf_saprfc_header_info3_GW_DIST_TRACE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 958 | offset += 1; |
| 959 | |
| 960 | proto_tree_add_item(header_tree, hf_saprfc_header_timeout, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 961 | offset += 4; |
| 962 | |
| 963 | info4 = proto_tree_add_item(header_tree, hf_saprfc_header_info4, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 964 | info4_tree = proto_item_add_subtree(info4, ett_saprfc); |
| 965 | proto_tree_add_item(info4_tree, hf_saprfc_header_info4_GW_WITH_DBG_CTL, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 966 | offset += 1; |
| 967 | |
| 968 | proto_tree_add_item(header_tree, hf_saprfc_header_sequence_no, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 969 | offset += 4; |
| 970 | proto_tree_add_item(header_tree, hf_saprfc_header_sap_params_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 971 | offset += 2; |
| 972 | offset += 2; /* Skip 2 bytes here */ |
| 973 | |
| 974 | info = proto_tree_add_item(header_tree, hf_saprfc_header_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 975 | info_tree = proto_item_add_subtree(info, ett_saprfc); |
| 976 | proto_tree_add_item(info_tree, hf_saprfc_header_info_SYNC_CPIC_FUNCTION, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 977 | proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_HOSTADDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 978 | proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 979 | proto_tree_add_item(info_tree, hf_saprfc_header_info_CPIC_SYNC_REQ, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 980 | proto_tree_add_item(info_tree, hf_saprfc_header_info_WITH_ERR_INFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 981 | proto_tree_add_item(info_tree, hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 982 | proto_tree_add_item(info_tree, hf_saprfc_header_info_DATA_WITH_TERM_INPUT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 983 | proto_tree_add_item(info_tree, hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 984 | offset += 1; |
| 985 | |
| 986 | reqtype2 = proto_tree_add_item(header_tree, hf_saprfc_header_reqtype2, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 987 | reqtype2_tree = proto_item_add_subtree(reqtype2, ett_saprfc); |
| 988 | proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 989 | proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_ALLOCATE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 990 | proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_SEND_DATA, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 991 | proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_RECEIVE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 992 | proto_tree_add_item(reqtype2_tree, hf_saprfc_header_reqtype2_F_V_FLUSH, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 993 | offset += 1; |
| 994 | |
| 995 | proto_tree_add_item(header_tree, hf_saprfc_header_appc_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 996 | offset += 4; |
| 997 | proto_tree_add_item(header_tree, hf_saprfc_header_sap_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 998 | offset += 4; |
| 999 | proto_tree_add_item(header_tree, hf_saprfc_header_conversation_id, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1000 | offset += 8; |
| 1001 | |
| 1002 | /* Dissect the NCPIC Parameters according to the request type */ |
| 1003 | params = proto_tree_add_item(header_tree, hf_saprfc_header_ncpic_parameters, tvb, offset, 28, ENC_NA0x00000000); |
| 1004 | params_tree = proto_item_add_subtree(params, ett_saprfc); |
| 1005 | switch (reqtype){ |
| 1006 | case 0x01:{ /* F_INITIALIZE_CONVERSATION */ |
| 1007 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_sdest, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1008 | offset += 8; |
| 1009 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1010 | offset += 8; |
| 1011 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_tp, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1012 | offset += 8; |
| 1013 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_ctype, tvb, offset, 1, ENC_ASCII0x00000000); |
| 1014 | offset += 1; |
| 1015 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_client_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1016 | offset += 1; |
| 1017 | offset += 2; /* Sum remaining bytes */ |
| 1018 | break; |
| 1019 | } |
| 1020 | case 0x0f:{ /* F_SET_PARTNER_LU_NAME */ |
| 1021 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu_name, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1022 | offset += 8; |
| 1023 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_lu_name_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 1024 | offset += 4; |
| 1025 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_host_address, tvb, offset, 16, ENC_NA0x00000000); |
| 1026 | offset += 16; |
| 1027 | break; |
| 1028 | } |
| 1029 | case 0x17:{ /* F_SET_SECURITY_TYPE */ |
| 1030 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_security_password, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1031 | offset += 8; |
| 1032 | proto_tree_add_item(params_tree, hf_saprfc_header_ncpic_parameters_security_password_length, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 1033 | offset += 4; |
| 1034 | offset += 16; /* Sum remaining bytes */ |
| 1035 | break; |
| 1036 | } |
| 1037 | default:{ |
| 1038 | offset += 28; |
| 1039 | } |
| 1040 | }; |
| 1041 | |
| 1042 | proto_tree_add_item(header_tree, hf_saprfc_header_comm_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 1043 | offset += 2; |
| 1044 | proto_tree_add_item(header_tree, hf_saprfc_header_conn_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 1045 | } |
| 1046 | |
| 1047 | static int |
| 1048 | dissect_saprfc_internal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused))) |
| 1049 | { |
| 1050 | uint32_t offset = 0; |
| 1051 | proto_item *saprfc, *payload = NULL((void*)0); |
| 1052 | proto_tree *saprfc_tree, *payload_tree = NULL((void*)0); |
| 1053 | |
| 1054 | /* Add the main saprfc subtree */ |
| 1055 | saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000); |
| 1056 | saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc); |
| 1057 | |
| 1058 | /* Check the payload length */ |
| 1059 | if (tvb_reported_length_remaining(tvb, offset) > 0) { |
| 1060 | /* Add the payload subtree */ |
| 1061 | payload = proto_tree_add_item(saprfc_tree, hf_saprfc_payload, tvb, offset, -1, ENC_NA0x00000000); |
| 1062 | payload_tree = proto_item_add_subtree(payload, ett_saprfc); |
| 1063 | |
| 1064 | /* Dissect the payload */ |
| 1065 | dissect_saprfc_payload(tvb, pinfo, payload_tree, saprfc_tree, offset); |
| 1066 | } |
| 1067 | |
| 1068 | return tvb_reported_length(tvb); |
| 1069 | } |
| 1070 | |
| 1071 | static int |
| 1072 | dissect_saprfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused))) |
| 1073 | { |
| 1074 | uint32_t offset = 0; |
| 1075 | uint8_t version = 0, req_type = 0; |
| 1076 | proto_item *saprfc = NULL((void*)0), *accept_info = NULL((void*)0); |
| 1077 | proto_tree *saprfc_tree = NULL((void*)0), *accept_info_tree = NULL((void*)0); |
| 1078 | |
| 1079 | /* Add the protocol to the column */ |
| 1080 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "SAPRFC"); |
| 1081 | /* Clear out stuff in the info column */ |
| 1082 | col_clear(pinfo->cinfo, COL_INFO); |
| 1083 | |
| 1084 | /* Get version and request type values */ |
| 1085 | version = tvb_get_uint8(tvb, offset); |
| 1086 | req_type = tvb_get_uint8(tvb, offset + 1); |
| 1087 | |
| 1088 | /* Check if the message is valid or it is an APPC header */ |
| 1089 | /* TODO: We need to find a way of performing this check, as Wireshark is |
| 1090 | * state-less seems to be difficult to keep track of the requests/responses. |
| 1091 | */ |
| 1092 | if (version > 0x03){ |
| 1093 | /* Add the main saprfc subtree */ |
| 1094 | saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000); |
| 1095 | saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc); |
| 1096 | dissect_saprfc_header(tvb, pinfo, saprfc_tree, offset); |
| 1097 | return tvb_reported_length(tvb); |
| 1098 | } |
| 1099 | |
| 1100 | col_append_fstr(pinfo->cinfo, COL_INFO, "Version=%u, Request Type=%s", version, val_to_str_const(req_type, saprfc_reqtype_values, "Unknown")); |
| 1101 | |
| 1102 | /* Add the main saprfc subtree */ |
| 1103 | saprfc = proto_tree_add_item(tree, proto_saprfc, tvb, 0, -1, ENC_NA0x00000000); |
| 1104 | saprfc_tree = proto_item_add_subtree(saprfc, ett_saprfc); |
| 1105 | |
| 1106 | /* Dissect common fields */ |
| 1107 | proto_tree_add_item(saprfc_tree, hf_saprfc_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); offset+=1; |
| 1108 | proto_tree_add_item(saprfc_tree, hf_saprfc_reqtype, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); offset+=1; |
| 1109 | proto_item_append_text(saprfc_tree, ", Version=%u, Request Type=%s", version, val_to_str_const(req_type, saprfc_reqtype_values, "Unknown")); |
| 1110 | |
| 1111 | /* Dissect the remaining based on the version and request type */ |
| 1112 | switch (req_type){ |
| 1113 | |
| 1114 | case 0x03: /* GW_NORMAL_CLIENT */ |
| 1115 | case 0x0b:{ /* GW_REGISTER_TP */ |
| 1116 | proto_tree_add_item(saprfc_tree, hf_saprfc_address, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 1117 | offset += 4; |
| 1118 | offset += 4; /* Skip 4 bytes here */ |
| 1119 | proto_tree_add_item(saprfc_tree, hf_saprfc_service, tvb, offset, 10, ENC_ASCII0x00000000); |
| 1120 | offset += 10; |
| 1121 | proto_tree_add_item(saprfc_tree, hf_saprfc_codepage, tvb, offset, 4, ENC_ASCII0x00000000); |
| 1122 | offset += 4; |
| 1123 | offset += 6; /* Skip 6 bytes here */ |
| 1124 | proto_tree_add_item(saprfc_tree, hf_saprfc_lu, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1125 | offset += 8; |
| 1126 | proto_tree_add_item(saprfc_tree, hf_saprfc_tp, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1127 | offset += 8; |
| 1128 | proto_tree_add_item(saprfc_tree, hf_saprfc_conversation_id, tvb, offset, 8, ENC_ASCII0x00000000); |
| 1129 | offset += 8; |
| 1130 | proto_tree_add_item(saprfc_tree, hf_saprfc_appc_header_version, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1131 | offset += 1; |
| 1132 | |
| 1133 | accept_info = proto_tree_add_item(saprfc_tree, hf_saprfc_accept_info, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1134 | accept_info_tree = proto_item_add_subtree(accept_info, ett_saprfc); |
| 1135 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_EINFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1136 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_PING, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1137 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_SNC, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1138 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_CONN_EINFO, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1139 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_CODE_PAGE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1140 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_NIPING, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1141 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_EXTINITOPT, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1142 | proto_tree_add_item(accept_info_tree, hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1143 | offset += 1; |
| 1144 | |
| 1145 | proto_tree_add_item(saprfc_tree, hf_saprfc_idx, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000); |
| 1146 | offset += 2; |
| 1147 | |
| 1148 | if (version == 0x03){ |
| 1149 | proto_tree_add_item(saprfc_tree, hf_saprfc_address6, tvb, offset, 16, ENC_NA0x00000000); |
| 1150 | offset += 16; |
| 1151 | } |
| 1152 | |
| 1153 | proto_tree_add_item(saprfc_tree, hf_saprfc_rc, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000); |
| 1154 | offset += 4; |
| 1155 | proto_tree_add_item(saprfc_tree, hf_saprfc_echo_data, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1156 | offset += 1; |
| 1157 | proto_tree_add_item(saprfc_tree, hf_saprfc_filler, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); |
| 1158 | break; |
| 1159 | } |
| 1160 | case 0x09:{ /* GW_SEND_CMD */ |
| 1161 | dissect_saprfc_monitor_cmd(tvb, pinfo, saprfc_tree, version, 2); |
| 1162 | break; |
| 1163 | } |
| 1164 | }; |
| 1165 | |
| 1166 | return tvb_reported_length(tvb); |
| 1167 | } |
| 1168 | |
| 1169 | void |
| 1170 | proto_register_saprfc(void) |
| 1171 | { |
| 1172 | static hf_register_info hf[] = { |
| 1173 | { &hf_saprfc_version, |
| 1174 | { "Version", "saprfc.version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1175 | { &hf_saprfc_reqtype, |
| 1176 | { "Request Type", "saprfc.reqtype", FT_UINT8, BASE_HEX, VALS(saprfc_reqtype_values)((0 ? (const struct _value_string*)0 : ((saprfc_reqtype_values )))), 0x0, "SAP RFC Request Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1177 | { &hf_saprfc_address, |
| 1178 | { "IPv4 Address", "saprfc.address", FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC IPv4 Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1179 | { &hf_saprfc_service, |
| 1180 | { "Service", "saprfc.service", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Service", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1181 | { &hf_saprfc_codepage, |
| 1182 | { "Codepage", "saprfc.codepage", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Codepage", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1183 | { &hf_saprfc_lu, |
| 1184 | { "LU", "saprfc.lu", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC LU", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1185 | { &hf_saprfc_tp, |
| 1186 | { "TP", "saprfc.tp", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC TP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1187 | { &hf_saprfc_conversation_id, |
| 1188 | { "Conversation ID", "saprfc.conversation_id", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Conversation ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1189 | { &hf_saprfc_appc_header_version, |
| 1190 | { "APPC Header Version", "saprfc.appc_hd_version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1191 | { &hf_saprfc_accept_info, |
| 1192 | { "Accept Info Flags", "saprfc.accept_info", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Accept Info Flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1193 | { &hf_saprfc_accept_info_EINFO, |
| 1194 | { "Accept Info Flag EINFO", "saprfc.accept_info.EINFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_EINFO0x01, "SAP RFC Accept Info Flag EINFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1195 | { &hf_saprfc_accept_info_PING, |
| 1196 | { "Accept Info Flag PING", "saprfc.accept_info.PING", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_PING0x02, "SAP RFC Accept Info Flag PING", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1197 | { &hf_saprfc_accept_info_SNC, |
| 1198 | { "Accept Info Flag SNC", "saprfc.accept_info.SNC", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_SNC0x04, "SAP RFC Accept Info Flag SNC", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1199 | { &hf_saprfc_accept_info_CONN_EINFO, |
| 1200 | { "Accept Info Flag CONN_EINFO", "saprfc.accept_info.CONN_EINFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_CONN_EINFO0x08, "SAP RFC Accept Info Flag CONN_EINFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1201 | { &hf_saprfc_accept_info_CODE_PAGE, |
| 1202 | { "Accept Info Flag CODE_PAGE", "saprfc.accept_info.CODE_PAGE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_CODE_PAGE0x10, "SAP RFC Accept Info Flag CODE_PAGE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1203 | { &hf_saprfc_accept_info_NIPING, |
| 1204 | { "Accept Info Flag NIPING", "saprfc.accept_info.NIPING", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_NIPING0x20, "SAP RFC Accept Info Flag NIPING", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1205 | { &hf_saprfc_accept_info_EXTINITOPT, |
| 1206 | { "Accept Info Flag EXTINITOPT", "saprfc.accept_info.EXTINITOPT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_EXTINITOPT0x40, "SAP RFC Accept Info Flag EXTINITOPT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1207 | { &hf_saprfc_accept_info_GW_ACCEPT_DIST_TRACE, |
| 1208 | { "Accept Info Flag GW_ACCEPT_DIST_TRACE", "saprfc.accept_info.GW_ACCEPT_DIST_TRACE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_ACCEPT_INFO_GW_ACCEPT_DIST_TRACE0x80, "SAP RFC Accept Info Flag GW_ACCEPT_DIST_TRACE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1209 | { &hf_saprfc_idx, |
| 1210 | { "Index", "saprfc.index", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1211 | { &hf_saprfc_address6, |
| 1212 | { "IPv6 Address", "saprfc.address6", FT_IPv6, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC IPv6 Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1213 | { &hf_saprfc_rc, |
| 1214 | { "Return Code", "saprfc.rc", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1215 | { &hf_saprfc_echo_data, |
| 1216 | { "Echo Data", "saprfc.echo_data", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Echo Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1217 | { &hf_saprfc_filler, |
| 1218 | { "Filler", "saprfc.filler", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Echo Data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1219 | |
| 1220 | /* Monitor Commands*/ |
| 1221 | { &hf_saprfc_monitor_cmd, |
| 1222 | { "Command", "saprfc.monitor_cmd", FT_UINT8, BASE_DEC, VALS(saprfc_monitor_cmd_values)((0 ? (const struct _value_string*)0 : ((saprfc_monitor_cmd_values )))), 0x0, "SAP RFC Monitor Command", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1223 | |
| 1224 | /* APPC Header */ |
| 1225 | { &hf_saprfc_header, |
| 1226 | { "APPC Header", "saprfc.appcheader", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1227 | { &hf_saprfc_header_version, |
| 1228 | { "Version", "saprfc.appcheader.version", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1229 | { &hf_saprfc_header_reqtype, |
| 1230 | { "Request Type", "saprfc.appcheader.reqtype", FT_UINT8, BASE_HEX, VALS(saprfc_header_reqtype_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_reqtype_values )))), 0x0, "SAP RFC APPC Header Request Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1231 | { &hf_saprfc_header_protocol, |
| 1232 | { "Protocol", "saprfc.appcheader.protocol", FT_UINT8, BASE_HEX, VALS(saprfc_header_protocol_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_protocol_values )))), 0x0, "SAP RFC APPC Header Protocol", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1233 | { &hf_saprfc_header_mode, |
| 1234 | { "Mode", "saprfc.appcheader.mode", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Mode", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1235 | { &hf_saprfc_header_uid, |
| 1236 | { "UID", "saprfc.appcheader.uid", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header UID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1237 | { &hf_saprfc_header_gw_id, |
| 1238 | { "Gateway ID", "saprfc.appcheader.gw_id", FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Gateway ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1239 | { &hf_saprfc_header_err_len, |
| 1240 | { "Error Length", "saprfc.appcheader.err_len", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Error Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1241 | { &hf_saprfc_header_info2, |
| 1242 | { "Info 2", "saprfc.appcheader.info2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1243 | { &hf_saprfc_header_info2_WITH_LONG_LU_NAME, |
| 1244 | { "Info 2 Flag WITH_LONG_LU_NAME", "saprfc.info2.WITH_LONG_LU_NAME", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_WITH_LONG_LU_NAME0x01, "SAP RFC Info 2 Flag WITH_LONG_LU_NAME", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1245 | { &hf_saprfc_header_info2_WITH_LONG_HOSTADDR, |
| 1246 | { "Info 2 Flag WITH_LONG_HOSTADDR", "saprfc.info2.WITH_LONG_HOSTADDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_WITH_LONG_HOSTADDR0x02, "SAP RFC Info 2 Flag WITH_LONG_HOSTADDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1247 | { &hf_saprfc_header_info2_GW_IMMEDIATE, |
| 1248 | { "Info 2 Flag GW_IMMEDIATE", "saprfc.info2.GW_IMMEDIATE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_IMMEDIATE0x04, "SAP RFC Info 2 Flag GW_IMMEDIATE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1249 | { &hf_saprfc_header_info2_GW_SNC_ACTIVE, |
| 1250 | { "Info 2 Flag GW_SNC_ACTIVE", "saprfc.info2.GW_SNC_ACTIVE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_SNC_ACTIVE0x08, "SAP RFC Info 2 Flag GW_SNC_ACTIVE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1251 | { &hf_saprfc_header_info2_GW_WAIT_LOOK_UP, |
| 1252 | { "Info 2 Flag GW_WAIT_LOOK_UP", "saprfc.info2.GW_WAIT_LOOK_UP", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_WAIT_LOOK_UP0x10, "SAP RFC Info 2 Flag GW_WAIT_LOOK_UP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1253 | { &hf_saprfc_header_info2_SNC_INIT_PHASE, |
| 1254 | { "Info 2 Flag SNC_INIT_PHASE", "saprfc.info2.SNC_INIT_PHASE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_SNC_INIT_PHASE0x20, "SAP RFC Info 2 Flag SNC_INIT_PHASE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1255 | { &hf_saprfc_header_info2_GW_STATELESS, |
| 1256 | { "Info 2 Flag GW_STATELESS", "saprfc.info2.GW_STATELESS", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_STATELESS0x40, "SAP RFC Info 2 Flag GW_STATELESS", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1257 | { &hf_saprfc_header_info2_GW_NO_STATE_CHECK, |
| 1258 | { "Info 2 Flag GW_NO_STATE_CHECK", "saprfc.info2.GW_NO_STATE_CHECK", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO2_GW_NO_STATE_CHECK0x80, "SAP RFC Info 2 Flag GW_NO_STATE_CHECK", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1259 | { &hf_saprfc_header_trace_level, |
| 1260 | { "Trace Level", "saprfc.appcheader.trace_level", FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Trace Level", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1261 | { &hf_saprfc_header_time, |
| 1262 | { "Time", "saprfc.appcheader.time", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Time", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1263 | { &hf_saprfc_header_info3, |
| 1264 | { "Info 3", "saprfc.appcheader.info3", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 3", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1265 | { &hf_saprfc_header_info3_GW_WITH_CODE_PAGE, |
| 1266 | { "Info 3 Flag GW_WITH_CODE_PAGE", "saprfc.appcheader.info3.GW_WITH_CODE_PAGE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_WITH_CODE_PAGE0x01, "SAP RFC APPC Header Info 3 Flag GW_WITH_CODE_PAGE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1267 | { &hf_saprfc_header_info3_GW_ASYNC_RFC, |
| 1268 | { "Info 3 Flag GW_ASYNC_RFC", "saprfc.appcheader.info3.GW_ASYNC_RFC", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_ASYNC_RFC0x02, "SAP RFC APPC Header Info 3 Flag GW_ASYNC_RFC", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1269 | { &hf_saprfc_header_info3_GW_CANCEL_HARD, |
| 1270 | { "Info 3 Flag GW_CANCEL_HARD", "saprfc.appcheader.info3.GW_CANCEL_HARD", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_CANCEL_HARD0x04, "SAP RFC APPC Header Info 3 Flag GW_CANCEL_HARD", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1271 | { &hf_saprfc_header_info3_GW_CANCEL_SOFT, |
| 1272 | { "Info 3 Flag GW_CANCEL_SOFT", "saprfc.appcheader.info3.GW_CANCEL_SOFT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_CANCEL_SOFT0x08, "SAP RFC APPC Header Info 3 Flag GW_CANCEL_SOFT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1273 | { &hf_saprfc_header_info3_GW_WITH_GUI_TIMEOUT, |
| 1274 | { "Info 3 Flag GW_WITH_GUI_TIMEOUT", "saprfc.appcheader.info3.GW_WITH_GUI_TIMEOUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_WITH_GUI_TIMEOUT0x10, "SAP RFC APPC Header Info 3 Flag GW_WITH_GUI_TIMEOUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1275 | { &hf_saprfc_header_info3_GW_TERMIO_ERROR, |
| 1276 | { "Info 3 Flag GW_TERMIO_ERROR", "saprfc.appcheader.info3.GW_TERMIO_ERROR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_TERMIO_ERROR0x20, "SAP RFC APPC Header Info 3 Flag GW_TERMIO_ERROR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1277 | { &hf_saprfc_header_info3_GW_EXTENDED_INIT_OPTIONS, |
| 1278 | { "Info 3 Flag GW_EXTENDED_INIT_OPTIONS", "saprfc.appcheader.info3.GW_EXTENDED_INIT_OPTIONS", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_EXTENDED_INIT_OPTIONS0x40, "SAP RFC APPC Header Info 3 Flag GW_EXTENDED_INIT_OPTIONS", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1279 | { &hf_saprfc_header_info3_GW_DIST_TRACE, |
| 1280 | { "Info 3 Flag GW_DIST_TRACE", "saprfc.appcheader.info3.GW_DIST_TRACE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO3_GW_DIST_TRACE0x80, "SAP RFC APPC Header Info 3 Flag GW_DIST_TRACE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1281 | { &hf_saprfc_header_timeout, |
| 1282 | { "Timeout", "saprfc.appcheader.timeout", FT_INT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Timeout", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1283 | { &hf_saprfc_header_info4, |
| 1284 | { "Info 4", "saprfc.appcheader.info4", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info 4", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1285 | { &hf_saprfc_header_info4_GW_WITH_DBG_CTL, |
| 1286 | { "Info 4 Flag GW_WITH_DBG_CTL", "saprfc.appcheader.info4.GW_WITH_DBG_CTL", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO4_GW_WITH_DBG_CTL0x01, "SAP RFC APPC Header Info 4 Flag GW_WITH_DBG_CTL", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1287 | { &hf_saprfc_header_sequence_no, |
| 1288 | { "Sequence No", "saprfc.appcheader.sequence_no", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Sequence No", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1289 | { &hf_saprfc_header_sap_params_len, |
| 1290 | { "SAP Parameters Length", "saprfc.appcheader.sap_params_len", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header SAP Parameters Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1291 | { &hf_saprfc_header_info, |
| 1292 | { "Info Flags", "saprfc.appcheader.info", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Info Flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1293 | { &hf_saprfc_header_info_SYNC_CPIC_FUNCTION, |
| 1294 | { "Info Flag SYNC_CPIC_FUNCTION", "saprfc.appcheader.info.SYNC_CPIC_FUNCTION", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_SYNC_CPIC_FUNCTION0x01, "SAP RFC APPC Header Info Flag SYNC_CPIC_FUNCTION", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1295 | { &hf_saprfc_header_info_WITH_HOSTADDR, |
| 1296 | { "Info Flag WITH_HOSTADDR", "saprfc.appcheader.info.WITH_HOSTADDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_HOSTADDR0x02, "SAP RFC APPC Header Info Flag WITH_HOSTADDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1297 | { &hf_saprfc_header_info_WITH_GW_SAP_PARAMS_HDR, |
| 1298 | { "Info Flag WITH_GW_SAP_PARAMS_HDR", "saprfc.appcheader.info.WITH_GW_SAP_PARAMS_HDR", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_GW_SAP_PARAMS_HDR0x04, "SAP RFC APPC Header Info Flag WITH_GW_SAP_PARAMS_HDR", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1299 | { &hf_saprfc_header_info_CPIC_SYNC_REQ, |
| 1300 | { "Info Flag CPIC_SYNC_REQ", "saprfc.appcheader.info.CPIC_SYNC_REQ", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_CPIC_SYNC_REQ0x08, "SAP RFC APPC Header Info Flag CPIC_SYNC_REQ", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1301 | { &hf_saprfc_header_info_WITH_ERR_INFO, |
| 1302 | { "Info Flag WITH_ERR_INFO", "saprfc.appcheader.info.WITH_ERR_INFO", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_WITH_ERR_INFO0x10, "SAP RFC APPC Header Info Flag WITH_ERR_INFO", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1303 | { &hf_saprfc_header_info_DATA_WITH_TERM_OUTPUT, |
| 1304 | { "Info Flag DATA_WITH_TERM_OUTPUT", "saprfc.appcheader.info.DATA_WITH_TERM_OUTPUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_OUTPUT0x20, "SAP RFC APPC Header Info Flag DATA_WITH_TERM_OUTPUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1305 | { &hf_saprfc_header_info_DATA_WITH_TERM_INPUT, |
| 1306 | { "Info Flag DATA_WITH_TERM_INPUT", "saprfc.appcheader.info.DATA_WITH_TERM_INPUT", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_DATA_WITH_TERM_INPUT0x40, "SAP RFC APPC Header Info Flag DATA_WITH_TERM_INPUT", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1307 | { &hf_saprfc_header_info_R3_CPIC_LOGIN_WITH_TERM, |
| 1308 | { "Info Flag R3_CPIC_LOGIN_WITH_TERM", "saprfc.appcheader.info.R3_CPIC_LOGIN_WITH_TERM", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_INFO1_R3_CPIC_LOGIN_WITH_TERM0x80, "SAP RFC APPC Header Info Flag R3_CPIC_LOGIN_WITH_TERM", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1309 | { &hf_saprfc_header_reqtype2, |
| 1310 | { "Request Type 2 Flags", "saprfc.appcheader.reqtype2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC APPC Header Request Type 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1311 | { &hf_saprfc_header_reqtype2_F_V_INITIALIZE_CONVERSATION, |
| 1312 | { "Request Type 2 Flag F_V_INITIALIZE_CONVERSATION", "saprfc.appcheader.reqtype2.F_V_INITIALIZE_CONVERSATION", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_INITIALIZE_CONVERSATION0x01, "SAP RFC Request Type 2 Flag F_V_INITIALIZE_CONVERSATION", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1313 | { &hf_saprfc_header_reqtype2_F_V_ALLOCATE, |
| 1314 | { "Request Type 2 Flag F_V_ALLOCATE", "saprfc.appcheader.reqtype2.F_V_ALLOCATE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_ALLOCATE0x02, "SAP RFC Request Type 2 Flag F_V_ALLOCATE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1315 | { &hf_saprfc_header_reqtype2_F_V_SEND_DATA, |
| 1316 | { "Request Type 2 Flag F_V_SEND_DATA", "saprfc.appcheader.reqtype2.F_V_SEND_DATA", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_SEND_DATA0x04, "SAP RFC Request Type 2 Flag F_V_SEND_DATA", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1317 | { &hf_saprfc_header_reqtype2_F_V_RECEIVE, |
| 1318 | { "Request Type 2 Flag F_V_RECEIVE", "saprfc.appcheader.reqtype2.F_V_RECEIVE", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_RECEIVE0x08, "SAP RFC Request Type 2 Flag F_V_RECEIVE", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1319 | { &hf_saprfc_header_reqtype2_F_V_FLUSH, |
| 1320 | { "Request Type 2 Flag F_V_FLUSH", "saprfc.appcheader.reqtype2.F_V_FLUSH", FT_BOOLEAN, 8, NULL((void*)0), SAPRFC_APPCHDR_REQTYPE2_F_V_FLUSH0x10, "SAP RFC Request Type 2 Flag F_V_FLUSH", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1321 | { &hf_saprfc_header_appc_rc, |
| 1322 | { "APPC Return Code", "saprfc.appcheader.appc_rc", FT_INT32, BASE_DEC, VALS(saprfc_header_appc_rc_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_appc_rc_values )))), 0x0, "SAP RFC APPC Header APPC Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1323 | { &hf_saprfc_header_sap_rc, |
| 1324 | { "SAP Return Code", "saprfc.appcheader.sap_rc", FT_INT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header SAP Return Code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1325 | { &hf_saprfc_header_conversation_id, |
| 1326 | { "Conversation ID", "saprfc.appcheader.conversation_id", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header Conversation ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1327 | { &hf_saprfc_header_ncpic_parameters, |
| 1328 | { "NCPIC Parameters", "saprfc.appcheader.ncpic_parameters", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1329 | { &hf_saprfc_header_ncpic_parameters_sdest, |
| 1330 | { "SDest", "saprfc.appcheader.ncpic_parameters.sdest", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters SDest", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1331 | { &hf_saprfc_header_ncpic_parameters_lu, |
| 1332 | { "LU", "saprfc.appcheader.ncpic_parameters.lu", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1333 | { &hf_saprfc_header_ncpic_parameters_tp, |
| 1334 | { "TP", "saprfc.appcheader.ncpic_parameters.tp", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters TP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1335 | { &hf_saprfc_header_ncpic_parameters_ctype, |
| 1336 | { "CType", "saprfc.appcheader.ncpic_parameters.ctype", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters CType", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1337 | { &hf_saprfc_header_ncpic_parameters_client_info, |
| 1338 | { "Client Info", "saprfc.appcheader.ncpic_parameters.client_info", FT_UINT8, BASE_HEX, VALS(saprfc_header_ncpic_parameters_client_info_values)((0 ? (const struct _value_string*)0 : ((saprfc_header_ncpic_parameters_client_info_values )))), 0x0, "SAP RFC APPC Header NCPIC Parameters Client Info", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1339 | { &hf_saprfc_header_ncpic_parameters_lu_name, |
| 1340 | { "LU Name", "saprfc.appcheader.ncpic_parameters.lu_name", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU Name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1341 | { &hf_saprfc_header_ncpic_parameters_lu_name_length, |
| 1342 | { "LU Name Length", "saprfc.appcheader.ncpic_parameters.lu_name_length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters LU Name Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1343 | { &hf_saprfc_header_ncpic_parameters_host_address, |
| 1344 | { "Host Address", "saprfc.appcheader.ncpic_parameters.host_address", FT_IPv6, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Host Address", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1345 | { &hf_saprfc_header_ncpic_parameters_security_password, |
| 1346 | { "Security Password", "saprfc.appcheader.ncpic_parameters.security_password", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Security Password", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1347 | { &hf_saprfc_header_ncpic_parameters_security_password_length, |
| 1348 | { "Security Password Length", "saprfc.appcheader.ncpic_parameters.security_password_length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header NCPIC Parameters Security Password Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1349 | |
| 1350 | { &hf_saprfc_header_comm_idx, |
| 1351 | { "Comm Index", "saprfc.appcheader.comm_idx", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Comm Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1352 | { &hf_saprfc_header_conn_idx, |
| 1353 | { "Conn Index", "saprfc.appcheader.conn_idx", FT_INT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC APPC Header Conn Index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1354 | |
| 1355 | /* Payload */ |
| 1356 | { &hf_saprfc_payload, |
| 1357 | { "Message", "saprfc.message", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1358 | |
| 1359 | /* Item fields */ |
| 1360 | { &hf_saprfc_item, |
| 1361 | { "Item", "saprfc.item", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Item", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1362 | { &hf_saprfc_item_id1, |
| 1363 | { "ID1", "saprfc.item.id1", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Item ID 1", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1364 | { &hf_saprfc_item_id2, |
| 1365 | { "ID2", "saprfc.item.id2", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Item ID 2", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1366 | { &hf_saprfc_item_length, |
| 1367 | { "Length", "saprfc.item.length", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Item Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1368 | { &hf_saprfc_item_value, |
| 1369 | { "Value", "saprfc.item.value", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Item Value", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1370 | |
| 1371 | /* Table content */ |
| 1372 | { &hf_saprfc_table, |
| 1373 | { "Table", "saprfc.table", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1374 | { &hf_saprfc_table_structure, |
| 1375 | { "Table Structure", "saprfc.table.structure", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1376 | { &hf_saprfc_table_structure_field, |
| 1377 | { "Table Structure Field", "saprfc.table.structure.field", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1378 | { &hf_saprfc_table_structure_field_type, |
| 1379 | { "Table Structure Field Type", "saprfc.table.structure.field.type", FT_UINT8, BASE_DEC, VALS(abap_types_typename_values)((0 ? (const struct _value_string*)0 : ((abap_types_typename_values )))), 0x0, "SAP RFC Table Structure Field Type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1380 | { &hf_saprfc_table_structure_field_length, |
| 1381 | { "Table Structure Field Length", "saprfc.table.structure.field.length", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Structure Field Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1382 | { &hf_saprfc_table_row, |
| 1383 | { "Table Row", "saprfc.table.row", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Row", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1384 | { &hf_saprfc_table_row_field, |
| 1385 | { "Table Row Field", "saprfc.table.row.field", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Row Field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1386 | { &hf_saprfc_table_length, |
| 1387 | { "Table Content Length", "saprfc.table.length", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Table Content Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1388 | { &hf_saprfc_table_compress_header, |
| 1389 | { "Compression Header", "saprfc.table.compression", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Compression Header", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1390 | { &hf_saprfc_table_uncomplength, |
| 1391 | { "Uncompressed Length", "saprfc.table.compression.uncomplength", FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Table Uncompressed Length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1392 | { &hf_saprfc_table_algorithm, |
| 1393 | { "Compression Algorithm", "saprfc.table.compression.algorithm", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Compression Algorithm", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1394 | { &hf_saprfc_table_magic, |
| 1395 | { "Magic Bytes", "saprfc.table.compression.magic", FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Compression Magic Bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1396 | { &hf_saprfc_table_special, |
| 1397 | { "Special", "saprfc.table.compression.special", FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, "SAP RFC Table Special", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1398 | { &hf_saprfc_table_return_code, |
| 1399 | { "Decompress Return Code", "saprfc.table.compression.returncode", FT_INT8, BASE_DEC, NULL((void*)0), 0x0, "SAP RFC Decompression routine return code", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1400 | { &hf_saprfc_table_content, |
| 1401 | { "Content", "saprfc.table.content", FT_NONE, BASE_NONE, NULL((void*)0), 0x0, "SAP RFC Table Content", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }}, |
| 1402 | |
| 1403 | }; |
| 1404 | |
| 1405 | /* Setup protocol subtree array */ |
| 1406 | static int *ett[] = { |
| 1407 | &ett_saprfc |
| 1408 | }; |
| 1409 | |
| 1410 | /* Register the expert info */ |
| 1411 | static ei_register_info ei[] = { |
| 1412 | { &ei_saprfc_invalid_decompression, { "saprfc.table.compression.failed", PI_MALFORMED0x07000000, PI_WARN0x00600000, "Decompression of table failed", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, |
| 1413 | { &ei_saprfc_invalid_decompress_length, { "saprfc.table.compression.uncomplength.invalid", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The uncompressed table length differs from the reported length", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, |
| 1414 | { &ei_saprfc_invalid_table_length, { "saprfc.table.length.invalid", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The table length is invalid", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, |
| 1415 | { &ei_saprfc_item_length_invalid, { "saprfc.item.value.invalid_length", PI_MALFORMED0x07000000, PI_WARN0x00600000, "The item length is invalid", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, |
| 1416 | { &ei_saprfc_unknown_item, { "saprfc.item.unknown", PI_UNDECODED0x05000000, PI_WARN0x00600000, "The RFC item has a unknown type that is not dissected", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, |
| 1417 | }; |
| 1418 | |
| 1419 | module_t *saprfc_module; |
| 1420 | expert_module_t* saprfc_expert; |
| 1421 | |
| 1422 | /* Register the protocol */ |
| 1423 | proto_saprfc = proto_register_protocol("SAP RFC Protocol", "SAPRFC", "saprfc"); |
| 1424 | |
| 1425 | proto_register_field_array(proto_saprfc, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0])); |
| 1426 | proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0])); |
| 1427 | |
| 1428 | saprfc_expert = expert_register_protocol(proto_saprfc); |
| 1429 | expert_register_field_array(saprfc_expert, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0])); |
| 1430 | |
| 1431 | register_dissector("saprfc", dissect_saprfc, proto_saprfc); |
| 1432 | register_dissector("saprfcinternal", dissect_saprfc_internal, proto_saprfc); |
| 1433 | |
| 1434 | /* Register the preferences */ |
| 1435 | saprfc_module = prefs_register_protocol(proto_saprfc, proto_reg_handoff_saprfc); |
| 1436 | prefs_register_bool_preference(saprfc_module, "decompress", "Decompress SAP RFC Protocol tables", |
| 1437 | "Whether the SAP RFC Protocol dissector should decompress table content.", |
| 1438 | &global_saprfc_decompress); |
| 1439 | prefs_register_uint_preference(saprfc_module, "max_uncompressed_size", "Maximum uncompressed table size", |
| 1440 | "Maximum number of bytes to allocate for an uncompressed SAP RFC table.", |
| 1441 | 10, &global_saprfc_max_uncompressed_size); |
| 1442 | prefs_register_uint_preference(saprfc_module, "max_reassembled_size", "Maximum reassembled table size", |
| 1443 | "Maximum number of bytes to allocate while reassembling an SAP RFC table.", |
| 1444 | 10, &global_saprfc_max_reassembled_size); |
| 1445 | |
| 1446 | prefs_register_bool_preference(saprfc_module, "table_reassembly", "Reassemble SAP RFC table content", |
| 1447 | "Whether the SAP RFC Protocol dissector should reassemble table content included in payloads.", |
| 1448 | &global_saprfc_table_reassembly); |
| 1449 | |
| 1450 | prefs_register_bool_preference(saprfc_module, "highlight_unknown_items", "Highlight unknown SAP RFC Items", |
| 1451 | "Whether the SAP RFC Protocol dissector should highlight unknown RFC items (might be noise and generate a lot of expert warnings)", |
| 1452 | &global_saprfc_highlight_items); |
| 1453 | } |
| 1454 | |
| 1455 | |
| 1456 | /** |
| 1457 | * Register Hand off for the SAP RFC Protocol |
| 1458 | */ |
| 1459 | void |
| 1460 | proto_reg_handoff_saprfc(void) |
| 1461 | { |
| 1462 | static bool_Bool initialized = false0; |
| 1463 | |
| 1464 | if (!initialized) { |
| 1465 | saprfc_handle = create_dissector_handle(dissect_saprfc, proto_saprfc); |
| 1466 | saprfcinternal_handle = create_dissector_handle(dissect_saprfc_internal, proto_saprfc); |
| 1467 | initialized = true1; |
| 1468 | } |
| 1469 | |
| 1470 | dissector_add_uint_range_with_preference("tcp.port", SAPRFC_PORT_RANGE"3300", saprfc_handle); |
| 1471 | } |
| 1472 | |
| 1473 | /* |
| 1474 | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
| 1475 | * |
| 1476 | * Local variables: |
| 1477 | * c-basic-offset: 8 |
| 1478 | * tab-width: 8 |
| 1479 | * indent-tabs-mode: t |
| 1480 | * End: |
| 1481 | * |
| 1482 | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
| 1483 | * :indentSize=8:tabSize=8:noTabs=false: |
| 1484 | */ |