The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Redistribution and use in source and binary forms, with or without |
| 3 | * modification, are permitted provided that: (1) source code |
| 4 | * distributions retain the above copyright notice and this paragraph |
| 5 | * in its entirety, and (2) distributions including binary code include |
| 6 | * the above copyright notice and this paragraph in its entirety in |
| 7 | * the documentation or other materials provided with the distribution. |
| 8 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND |
| 9 | * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT |
| 10 | * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 11 | * FOR A PARTICULAR PURPOSE. |
| 12 | * |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 13 | * Original code by Hannes Gredler (hannes@gredler.at) |
| 14 | * Support for LMP service discovery extensions (defined by OIF UNI 1.0) |
| 15 | * added by Manu Pathak (mapathak@cisco.com), May 2005 |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 16 | */ |
| 17 | |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 18 | /* \summary: Link Management Protocol (LMP) printer */ |
| 19 | |
| 20 | /* specification: RFC 4204 */ |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 21 | /* OIF UNI 1.0: https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */ |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 22 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 23 | #ifdef HAVE_CONFIG_H |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 24 | #include <config.h> |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 25 | #endif |
| 26 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 27 | #include "netdissect-stdinc.h" |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 28 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 29 | #define ND_LONGJMP_FROM_TCHECK |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 30 | #include "netdissect.h" |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 31 | #include "extract.h" |
| 32 | #include "addrtoname.h" |
| 33 | #include "gmpls.h" |
| 34 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 35 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 36 | /* |
| 37 | * LMP common header |
| 38 | * |
| 39 | * 0 1 2 3 |
| 40 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 41 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 42 | * | Vers | (Reserved) | Flags | Msg Type | |
| 43 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 44 | * | LMP Length | (Reserved) | |
| 45 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 46 | */ |
| 47 | |
| 48 | struct lmp_common_header { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 49 | nd_uint16_t version_res; |
| 50 | nd_uint8_t flags; |
| 51 | nd_uint8_t msg_type; |
| 52 | nd_uint16_t length; |
| 53 | nd_byte reserved[2]; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | #define LMP_VERSION 1 |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 57 | #define LMP_EXTRACT_VERSION(x) (((x)&0xf000)>>12) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 58 | |
| 59 | static const struct tok lmp_header_flag_values[] = { |
| 60 | { 0x01, "Control Channel Down"}, |
| 61 | { 0x02, "LMP restart"}, |
| 62 | { 0, NULL} |
| 63 | }; |
| 64 | |
| 65 | static const struct tok lmp_obj_te_link_flag_values[] = { |
| 66 | { 0x01, "Fault Management Supported"}, |
| 67 | { 0x02, "Link Verification Supported"}, |
| 68 | { 0, NULL} |
| 69 | }; |
| 70 | |
| 71 | static const struct tok lmp_obj_data_link_flag_values[] = { |
| 72 | { 0x01, "Data Link Port"}, |
| 73 | { 0x02, "Allocated for user traffic"}, |
| 74 | { 0x04, "Failed link"}, |
| 75 | { 0, NULL} |
| 76 | }; |
| 77 | |
| 78 | static const struct tok lmp_obj_channel_status_values[] = { |
| 79 | { 1, "Signal Okay"}, |
| 80 | { 2, "Signal Degraded"}, |
| 81 | { 3, "Signal Fail"}, |
| 82 | { 0, NULL} |
| 83 | }; |
| 84 | |
| 85 | static const struct tok lmp_obj_begin_verify_flag_values[] = { |
| 86 | { 0x0001, "Verify all links"}, |
| 87 | { 0x0002, "Data link type"}, |
| 88 | { 0, NULL} |
| 89 | }; |
| 90 | |
| 91 | static const struct tok lmp_obj_begin_verify_error_values[] = { |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 92 | { 0x01, "Link Verification Procedure Not supported"}, |
| 93 | { 0x02, "Unwilling to verify"}, |
| 94 | { 0x04, "Unsupported verification transport mechanism"}, |
| 95 | { 0x08, "Link-Id configuration error"}, |
| 96 | { 0x10, "Unknown object c-type"}, |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 97 | { 0, NULL} |
| 98 | }; |
| 99 | |
| 100 | static const struct tok lmp_obj_link_summary_error_values[] = { |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 101 | { 0x01, "Unacceptable non-negotiable LINK-SUMMARY parameters"}, |
| 102 | { 0x02, "Renegotiate LINK-SUMMARY parameters"}, |
| 103 | { 0x04, "Invalid TE-LINK Object"}, |
| 104 | { 0x08, "Invalid DATA-LINK Object"}, |
| 105 | { 0x10, "Unknown TE-LINK Object c-type"}, |
| 106 | { 0x20, "Unknown DATA-LINK Object c-type"}, |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 107 | { 0, NULL} |
| 108 | }; |
| 109 | |
| 110 | /* Service Config Supported Protocols Flags */ |
| 111 | static const struct tok lmp_obj_service_config_sp_flag_values[] = { |
| 112 | { 0x01, "RSVP Supported"}, |
| 113 | { 0x02, "LDP Supported"}, |
| 114 | { 0, NULL} |
| 115 | }; |
| 116 | |
| 117 | /* Service Config Client Port Service Attribute Transparency Flags */ |
| 118 | static const struct tok lmp_obj_service_config_cpsa_tp_flag_values[] = { |
| 119 | { 0x01, "Path/VC Overhead Transparency Supported"}, |
| 120 | { 0x02, "Line/MS Overhead Transparency Supported"}, |
| 121 | { 0x04, "Section/RS Overhead Transparency Supported"}, |
| 122 | { 0, NULL} |
| 123 | }; |
| 124 | |
| 125 | /* Service Config Client Port Service Attribute Contiguous Concatenation Types Flags */ |
| 126 | static const struct tok lmp_obj_service_config_cpsa_cct_flag_values[] = { |
| 127 | { 0x01, "Contiguous Concatenation Types Supported"}, |
| 128 | { 0, NULL} |
| 129 | }; |
| 130 | |
| 131 | /* Service Config Network Service Attributes Transparency Flags */ |
| 132 | static const struct tok lmp_obj_service_config_nsa_transparency_flag_values[] = { |
| 133 | { 0x01, "Standard SOH/RSOH Transparency Supported"}, |
| 134 | { 0x02, "Standard LOH/MSOH Transparency Supported"}, |
| 135 | { 0, NULL} |
| 136 | }; |
| 137 | |
| 138 | /* Service Config Network Service Attributes TCM Monitoring Flags */ |
| 139 | static const struct tok lmp_obj_service_config_nsa_tcm_flag_values[] = { |
| 140 | { 0x01, "Transparent Tandem Connection Monitoring Supported"}, |
| 141 | { 0, NULL} |
| 142 | }; |
| 143 | |
| 144 | /* Network Service Attributes Network Diversity Flags */ |
| 145 | static const struct tok lmp_obj_service_config_nsa_network_diversity_flag_values[] = { |
| 146 | { 0x01, "Node Diversity Supported"}, |
| 147 | { 0x02, "Link Diversity Supported"}, |
| 148 | { 0x04, "SRLG Diversity Supported"}, |
| 149 | { 0, NULL} |
| 150 | }; |
| 151 | |
| 152 | #define LMP_MSGTYPE_CONFIG 1 |
| 153 | #define LMP_MSGTYPE_CONFIG_ACK 2 |
| 154 | #define LMP_MSGTYPE_CONFIG_NACK 3 |
| 155 | #define LMP_MSGTYPE_HELLO 4 |
| 156 | #define LMP_MSGTYPE_VERIFY_BEGIN 5 |
| 157 | #define LMP_MSGTYPE_VERIFY_BEGIN_ACK 6 |
| 158 | #define LMP_MSGTYPE_VERIFY_BEGIN_NACK 7 |
| 159 | #define LMP_MSGTYPE_VERIFY_END 8 |
| 160 | #define LMP_MSGTYPE_VERIFY_END_ACK 9 |
| 161 | #define LMP_MSGTYPE_TEST 10 |
| 162 | #define LMP_MSGTYPE_TEST_STATUS_SUCCESS 11 |
| 163 | #define LMP_MSGTYPE_TEST_STATUS_FAILURE 12 |
| 164 | #define LMP_MSGTYPE_TEST_STATUS_ACK 13 |
| 165 | #define LMP_MSGTYPE_LINK_SUMMARY 14 |
| 166 | #define LMP_MSGTYPE_LINK_SUMMARY_ACK 15 |
| 167 | #define LMP_MSGTYPE_LINK_SUMMARY_NACK 16 |
| 168 | #define LMP_MSGTYPE_CHANNEL_STATUS 17 |
| 169 | #define LMP_MSGTYPE_CHANNEL_STATUS_ACK 18 |
| 170 | #define LMP_MSGTYPE_CHANNEL_STATUS_REQ 19 |
| 171 | #define LMP_MSGTYPE_CHANNEL_STATUS_RESP 20 |
| 172 | /* LMP Service Discovery message types defined by UNI 1.0 */ |
| 173 | #define LMP_MSGTYPE_SERVICE_CONFIG 50 |
| 174 | #define LMP_MSGTYPE_SERVICE_CONFIG_ACK 51 |
| 175 | #define LMP_MSGTYPE_SERVICE_CONFIG_NACK 52 |
| 176 | |
| 177 | static const struct tok lmp_msg_type_values[] = { |
| 178 | { LMP_MSGTYPE_CONFIG, "Config"}, |
| 179 | { LMP_MSGTYPE_CONFIG_ACK, "Config ACK"}, |
| 180 | { LMP_MSGTYPE_CONFIG_NACK, "Config NACK"}, |
| 181 | { LMP_MSGTYPE_HELLO, "Hello"}, |
| 182 | { LMP_MSGTYPE_VERIFY_BEGIN, "Begin Verify"}, |
| 183 | { LMP_MSGTYPE_VERIFY_BEGIN_ACK, "Begin Verify ACK"}, |
| 184 | { LMP_MSGTYPE_VERIFY_BEGIN_NACK, "Begin Verify NACK"}, |
| 185 | { LMP_MSGTYPE_VERIFY_END, "End Verify"}, |
| 186 | { LMP_MSGTYPE_VERIFY_END_ACK, "End Verify ACK"}, |
| 187 | { LMP_MSGTYPE_TEST, "Test"}, |
| 188 | { LMP_MSGTYPE_TEST_STATUS_SUCCESS, "Test Status Success"}, |
| 189 | { LMP_MSGTYPE_TEST_STATUS_FAILURE, "Test Status Failure"}, |
| 190 | { LMP_MSGTYPE_TEST_STATUS_ACK, "Test Status ACK"}, |
| 191 | { LMP_MSGTYPE_LINK_SUMMARY, "Link Summary"}, |
| 192 | { LMP_MSGTYPE_LINK_SUMMARY_ACK, "Link Summary ACK"}, |
| 193 | { LMP_MSGTYPE_LINK_SUMMARY_NACK, "Link Summary NACK"}, |
| 194 | { LMP_MSGTYPE_CHANNEL_STATUS, "Channel Status"}, |
| 195 | { LMP_MSGTYPE_CHANNEL_STATUS_ACK, "Channel Status ACK"}, |
| 196 | { LMP_MSGTYPE_CHANNEL_STATUS_REQ, "Channel Status Request"}, |
| 197 | { LMP_MSGTYPE_CHANNEL_STATUS_RESP, "Channel Status Response"}, |
| 198 | { LMP_MSGTYPE_SERVICE_CONFIG, "Service Config"}, |
| 199 | { LMP_MSGTYPE_SERVICE_CONFIG_ACK, "Service Config ACK"}, |
| 200 | { LMP_MSGTYPE_SERVICE_CONFIG_NACK, "Service Config NACK"}, |
| 201 | { 0, NULL} |
| 202 | }; |
| 203 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 204 | /* |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 205 | * LMP object header |
| 206 | * |
| 207 | * 0 1 2 3 |
| 208 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 209 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 210 | * |N| C-Type | Class | Length | |
| 211 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 212 | * | | |
| 213 | * // (object contents) // |
| 214 | * | | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 215 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 216 | */ |
| 217 | |
| 218 | struct lmp_object_header { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 219 | nd_uint8_t ctype; |
| 220 | nd_uint8_t class_num; |
| 221 | nd_uint16_t length; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 222 | }; |
| 223 | |
| 224 | #define LMP_OBJ_CC_ID 1 |
| 225 | #define LMP_OBJ_NODE_ID 2 |
| 226 | #define LMP_OBJ_LINK_ID 3 |
| 227 | #define LMP_OBJ_INTERFACE_ID 4 |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 228 | #define LMP_OBJ_MESSAGE_ID 5 |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 229 | #define LMP_OBJ_CONFIG 6 |
| 230 | #define LMP_OBJ_HELLO 7 |
| 231 | #define LMP_OBJ_VERIFY_BEGIN 8 |
| 232 | #define LMP_OBJ_VERIFY_BEGIN_ACK 9 |
| 233 | #define LMP_OBJ_VERIFY_ID 10 |
| 234 | #define LMP_OBJ_TE_LINK 11 |
| 235 | #define LMP_OBJ_DATA_LINK 12 |
| 236 | #define LMP_OBJ_CHANNEL_STATUS 13 |
| 237 | #define LMP_OBJ_CHANNEL_STATUS_REQ 14 |
| 238 | #define LMP_OBJ_ERROR_CODE 20 |
| 239 | |
| 240 | #define LMP_OBJ_SERVICE_CONFIG 51 /* defined in UNI 1.0 */ |
| 241 | |
| 242 | static const struct tok lmp_obj_values[] = { |
| 243 | { LMP_OBJ_CC_ID, "Control Channel ID" }, |
| 244 | { LMP_OBJ_NODE_ID, "Node ID" }, |
| 245 | { LMP_OBJ_LINK_ID, "Link ID" }, |
| 246 | { LMP_OBJ_INTERFACE_ID, "Interface ID" }, |
| 247 | { LMP_OBJ_MESSAGE_ID, "Message ID" }, |
| 248 | { LMP_OBJ_CONFIG, "Configuration" }, |
| 249 | { LMP_OBJ_HELLO, "Hello" }, |
| 250 | { LMP_OBJ_VERIFY_BEGIN, "Verify Begin" }, |
| 251 | { LMP_OBJ_VERIFY_BEGIN_ACK, "Verify Begin ACK" }, |
| 252 | { LMP_OBJ_VERIFY_ID, "Verify ID" }, |
| 253 | { LMP_OBJ_TE_LINK, "TE Link" }, |
| 254 | { LMP_OBJ_DATA_LINK, "Data Link" }, |
| 255 | { LMP_OBJ_CHANNEL_STATUS, "Channel Status" }, |
| 256 | { LMP_OBJ_CHANNEL_STATUS_REQ, "Channel Status Request" }, |
| 257 | { LMP_OBJ_ERROR_CODE, "Error Code" }, |
| 258 | { LMP_OBJ_SERVICE_CONFIG, "Service Config" }, |
| 259 | |
| 260 | { 0, NULL} |
| 261 | }; |
| 262 | |
| 263 | #define INT_SWITCHING_TYPE_SUBOBJ 1 |
| 264 | #define WAVELENGTH_SUBOBJ 2 |
| 265 | |
| 266 | static const struct tok lmp_data_link_subobj[] = { |
| 267 | { INT_SWITCHING_TYPE_SUBOBJ, "Interface Switching Type" }, |
| 268 | { WAVELENGTH_SUBOBJ , "Wavelength" }, |
| 269 | { 0, NULL} |
| 270 | }; |
| 271 | |
| 272 | #define LMP_CTYPE_IPV4 1 |
| 273 | #define LMP_CTYPE_IPV6 2 |
| 274 | |
| 275 | #define LMP_CTYPE_LOC 1 |
| 276 | #define LMP_CTYPE_RMT 2 |
| 277 | #define LMP_CTYPE_UNMD 3 |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 278 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 279 | #define LMP_CTYPE_IPV4_LOC 1 |
| 280 | #define LMP_CTYPE_IPV4_RMT 2 |
| 281 | #define LMP_CTYPE_IPV6_LOC 3 |
| 282 | #define LMP_CTYPE_IPV6_RMT 4 |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 283 | #define LMP_CTYPE_UNMD_LOC 5 |
| 284 | #define LMP_CTYPE_UNMD_RMT 6 |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 285 | |
| 286 | #define LMP_CTYPE_1 1 |
| 287 | #define LMP_CTYPE_2 2 |
| 288 | |
| 289 | #define LMP_CTYPE_HELLO_CONFIG 1 |
| 290 | #define LMP_CTYPE_HELLO 1 |
| 291 | |
| 292 | #define LMP_CTYPE_BEGIN_VERIFY_ERROR 1 |
| 293 | #define LMP_CTYPE_LINK_SUMMARY_ERROR 2 |
| 294 | |
| 295 | /* C-Types for Service Config Object */ |
| 296 | #define LMP_CTYPE_SERVICE_CONFIG_SP 1 |
| 297 | #define LMP_CTYPE_SERVICE_CONFIG_CPSA 2 |
| 298 | #define LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM 3 |
| 299 | #define LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY 4 |
| 300 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 301 | /* |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 302 | * Different link types allowed in the Client Port Service Attributes |
| 303 | * subobject defined for LMP Service Discovery in the UNI 1.0 spec |
| 304 | */ |
| 305 | #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH 5 /* UNI 1.0 Sec 9.4.2 */ |
| 306 | #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET 6 /* UNI 1.0 Sec 9.4.2 */ |
| 307 | |
| 308 | /* |
| 309 | * the ctypes are not globally unique so for |
| 310 | * translating it to strings we build a table based |
| 311 | * on objects offsetted by the ctype |
| 312 | */ |
| 313 | |
| 314 | static const struct tok lmp_ctype_values[] = { |
| 315 | { 256*LMP_OBJ_CC_ID+LMP_CTYPE_LOC, "Local" }, |
| 316 | { 256*LMP_OBJ_CC_ID+LMP_CTYPE_RMT, "Remote" }, |
| 317 | { 256*LMP_OBJ_NODE_ID+LMP_CTYPE_LOC, "Local" }, |
| 318 | { 256*LMP_OBJ_NODE_ID+LMP_CTYPE_RMT, "Remote" }, |
| 319 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV4_LOC, "IPv4 Local" }, |
| 320 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV4_RMT, "IPv4 Remote" }, |
| 321 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV6_LOC, "IPv6 Local" }, |
| 322 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV6_RMT, "IPv6 Remote" }, |
| 323 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_UNMD_LOC, "Unnumbered Local" }, |
| 324 | { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_UNMD_RMT, "Unnumbered Remote" }, |
| 325 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV4_LOC, "IPv4 Local" }, |
| 326 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV4_RMT, "IPv4 Remote" }, |
| 327 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV6_LOC, "IPv6 Local" }, |
| 328 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV6_RMT, "IPv6 Remote" }, |
| 329 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_UNMD_LOC, "Unnumbered Local" }, |
| 330 | { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_UNMD_RMT, "Unnumbered Remote" }, |
| 331 | { 256*LMP_OBJ_MESSAGE_ID+LMP_CTYPE_1, "1" }, |
| 332 | { 256*LMP_OBJ_MESSAGE_ID+LMP_CTYPE_2, "2" }, |
| 333 | { 256*LMP_OBJ_CONFIG+LMP_CTYPE_1, "1" }, |
| 334 | { 256*LMP_OBJ_HELLO+LMP_CTYPE_1, "1" }, |
| 335 | { 256*LMP_OBJ_VERIFY_BEGIN+LMP_CTYPE_1, "1" }, |
| 336 | { 256*LMP_OBJ_VERIFY_BEGIN_ACK+LMP_CTYPE_1, "1" }, |
| 337 | { 256*LMP_OBJ_VERIFY_ID+LMP_CTYPE_1, "1" }, |
| 338 | { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_IPV4, "IPv4" }, |
| 339 | { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_IPV6, "IPv6" }, |
| 340 | { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_UNMD, "Unnumbered" }, |
| 341 | { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_IPV4, "IPv4" }, |
| 342 | { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_IPV6, "IPv6" }, |
| 343 | { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_UNMD, "Unnumbered" }, |
| 344 | { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_IPV4, "IPv4" }, |
| 345 | { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_IPV6, "IPv6" }, |
| 346 | { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_UNMD, "Unnumbered" }, |
| 347 | { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_IPV4, "IPv4" }, |
| 348 | { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_IPV6, "IPv6" }, |
| 349 | { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_UNMD, "Unnumbered" }, |
| 350 | { 256*LMP_OBJ_ERROR_CODE+LMP_CTYPE_1, "1" }, |
| 351 | { 256*LMP_OBJ_ERROR_CODE+LMP_CTYPE_2, "2" }, |
| 352 | { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_SP, "1" }, |
| 353 | { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_CPSA, "2" }, |
| 354 | { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM, "3" }, |
| 355 | { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY, "4" }, |
| 356 | { 0, NULL} |
| 357 | }; |
| 358 | |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 359 | static int |
| 360 | lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr, |
| 361 | int total_subobj_len, int offset) |
| 362 | { |
| 363 | int hexdump = FALSE; |
| 364 | int subobj_type, subobj_len; |
| 365 | |
| 366 | union { /* int to float conversion buffer */ |
| 367 | float f; |
| 368 | uint32_t i; |
| 369 | } bw; |
| 370 | |
| 371 | while (total_subobj_len > 0 && hexdump == FALSE ) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 372 | subobj_type = GET_U_1(obj_tptr + offset); |
| 373 | subobj_len = GET_U_1(obj_tptr + offset + 1); |
| 374 | ND_PRINT("\n\t Subobject, Type: %s (%u), Length: %u", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 375 | tok2str(lmp_data_link_subobj, |
| 376 | "Unknown", |
| 377 | subobj_type), |
| 378 | subobj_type, |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 379 | subobj_len); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 380 | if (subobj_len < 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 381 | ND_PRINT(" (too short)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 382 | break; |
| 383 | } |
| 384 | if ((subobj_len % 4) != 0) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 385 | ND_PRINT(" (not a multiple of 4)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 386 | break; |
| 387 | } |
| 388 | if (total_subobj_len < subobj_len) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 389 | ND_PRINT(" (goes past the end of the object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 390 | break; |
| 391 | } |
| 392 | switch(subobj_type) { |
| 393 | case INT_SWITCHING_TYPE_SUBOBJ: |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 394 | ND_PRINT("\n\t Switching Type: %s (%u)", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 395 | tok2str(gmpls_switch_cap_values, |
| 396 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 397 | GET_U_1(obj_tptr + offset + 2)), |
| 398 | GET_U_1(obj_tptr + offset + 2)); |
| 399 | ND_PRINT("\n\t Encoding Type: %s (%u)", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 400 | tok2str(gmpls_encoding_values, |
| 401 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 402 | GET_U_1(obj_tptr + offset + 3)), |
| 403 | GET_U_1(obj_tptr + offset + 3)); |
| 404 | bw.i = GET_BE_U_4(obj_tptr + offset + 4); |
| 405 | ND_PRINT("\n\t Min Reservable Bandwidth: %.3f Mbps", |
| 406 | bw.f*8/1000000); |
| 407 | bw.i = GET_BE_U_4(obj_tptr + offset + 8); |
| 408 | ND_PRINT("\n\t Max Reservable Bandwidth: %.3f Mbps", |
| 409 | bw.f*8/1000000); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 410 | break; |
| 411 | case WAVELENGTH_SUBOBJ: |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 412 | ND_PRINT("\n\t Wavelength: %u", |
| 413 | GET_BE_U_4(obj_tptr + offset + 4)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 414 | break; |
| 415 | default: |
| 416 | /* Any Unknown Subobject ==> Exit loop */ |
| 417 | hexdump=TRUE; |
| 418 | break; |
| 419 | } |
| 420 | total_subobj_len-=subobj_len; |
| 421 | offset+=subobj_len; |
| 422 | } |
| 423 | return (hexdump); |
| 424 | } |
| 425 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 426 | void |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 427 | lmp_print(netdissect_options *ndo, |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 428 | const u_char *pptr, u_int length) |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 429 | { |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 430 | const struct lmp_common_header *lmp_com_header; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 431 | const u_char *tptr,*obj_tptr; |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 432 | u_int version_res, tlen, lmp_obj_len, lmp_obj_ctype, obj_tlen; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 433 | int hexdump; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 434 | u_int offset; |
| 435 | u_int link_type; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 436 | |
| 437 | union { /* int to float conversion buffer */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 438 | float f; |
| 439 | uint32_t i; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 440 | } bw; |
| 441 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 442 | ndo->ndo_protocol = "lmp"; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 443 | tptr=pptr; |
| 444 | lmp_com_header = (const struct lmp_common_header *)pptr; |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 445 | ND_TCHECK_SIZE(lmp_com_header); |
| 446 | |
| 447 | version_res = GET_BE_U_2(lmp_com_header->version_res); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 448 | |
| 449 | /* |
| 450 | * Sanity checking of the header. |
| 451 | */ |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 452 | if (LMP_EXTRACT_VERSION(version_res) != LMP_VERSION) { |
| 453 | ND_PRINT("LMP version %u packet not supported", |
| 454 | LMP_EXTRACT_VERSION(version_res)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 455 | return; |
| 456 | } |
| 457 | |
| 458 | /* in non-verbose mode just lets print the basic Message Type*/ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 459 | if (ndo->ndo_vflag < 1) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 460 | ND_PRINT("LMPv%u %s Message, length: %u", |
| 461 | LMP_EXTRACT_VERSION(version_res), |
| 462 | tok2str(lmp_msg_type_values, "unknown (%u)",GET_U_1(lmp_com_header->msg_type)), |
| 463 | length); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 464 | return; |
| 465 | } |
| 466 | |
| 467 | /* ok they seem to want to know everything - lets fully decode it */ |
| 468 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 469 | tlen=GET_BE_U_2(lmp_com_header->length); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 470 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 471 | ND_PRINT("\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u", |
| 472 | LMP_EXTRACT_VERSION(version_res), |
| 473 | tok2str(lmp_msg_type_values, "unknown, type: %u",GET_U_1(lmp_com_header->msg_type)), |
| 474 | bittok2str(lmp_header_flag_values,"none",GET_U_1(lmp_com_header->flags)), |
| 475 | tlen); |
| 476 | if (tlen < sizeof(struct lmp_common_header)) { |
| 477 | ND_PRINT(" (too short)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 478 | return; |
| 479 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 480 | if (tlen > length) { |
| 481 | ND_PRINT(" (too long)"); |
| 482 | tlen = length; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 483 | } |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 484 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 485 | tptr+=sizeof(struct lmp_common_header); |
| 486 | tlen-=sizeof(struct lmp_common_header); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 487 | |
| 488 | while(tlen>0) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 489 | const struct lmp_object_header *lmp_obj_header = |
| 490 | (const struct lmp_object_header *)tptr; |
| 491 | lmp_obj_len=GET_BE_U_2(lmp_obj_header->length); |
| 492 | lmp_obj_ctype=GET_U_1(lmp_obj_header->ctype)&0x7f; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 493 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 494 | ND_PRINT("\n\t %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 495 | tok2str(lmp_obj_values, |
| 496 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 497 | GET_U_1(lmp_obj_header->class_num)), |
| 498 | GET_U_1(lmp_obj_header->class_num), |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 499 | tok2str(lmp_ctype_values, |
| 500 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 501 | (GET_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype), |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 502 | lmp_obj_ctype, |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 503 | GET_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-", |
| 504 | lmp_obj_len); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 505 | |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 506 | if (lmp_obj_len < 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 507 | ND_PRINT(" (too short)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 508 | return; |
| 509 | } |
| 510 | if ((lmp_obj_len % 4) != 0) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 511 | ND_PRINT(" (not a multiple of 4)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 512 | return; |
| 513 | } |
| 514 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 515 | obj_tptr=tptr+sizeof(struct lmp_object_header); |
| 516 | obj_tlen=lmp_obj_len-sizeof(struct lmp_object_header); |
| 517 | |
| 518 | /* did we capture enough for fully decoding the object ? */ |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 519 | ND_TCHECK_LEN(tptr, lmp_obj_len); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 520 | hexdump=FALSE; |
| 521 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 522 | switch(GET_U_1(lmp_obj_header->class_num)) { |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 523 | |
| 524 | case LMP_OBJ_CC_ID: |
| 525 | switch(lmp_obj_ctype) { |
| 526 | case LMP_CTYPE_LOC: |
| 527 | case LMP_CTYPE_RMT: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 528 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 529 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 530 | break; |
| 531 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 532 | ND_PRINT("\n\t Control Channel ID: %u (0x%08x)", |
| 533 | GET_BE_U_4(obj_tptr), |
| 534 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 535 | break; |
| 536 | |
| 537 | default: |
| 538 | hexdump=TRUE; |
| 539 | } |
| 540 | break; |
| 541 | |
| 542 | case LMP_OBJ_LINK_ID: |
| 543 | case LMP_OBJ_INTERFACE_ID: |
| 544 | switch(lmp_obj_ctype) { |
| 545 | case LMP_CTYPE_IPV4_LOC: |
| 546 | case LMP_CTYPE_IPV4_RMT: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 547 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 548 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 549 | break; |
| 550 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 551 | ND_PRINT("\n\t IPv4 Link ID: %s (0x%08x)", |
| 552 | GET_IPADDR_STRING(obj_tptr), |
| 553 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 554 | break; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 555 | case LMP_CTYPE_IPV6_LOC: |
| 556 | case LMP_CTYPE_IPV6_RMT: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 557 | if (obj_tlen != 16) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 558 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 559 | break; |
| 560 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 561 | ND_PRINT("\n\t IPv6 Link ID: %s (0x%08x)", |
| 562 | GET_IP6ADDR_STRING(obj_tptr), |
| 563 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 564 | break; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 565 | case LMP_CTYPE_UNMD_LOC: |
| 566 | case LMP_CTYPE_UNMD_RMT: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 567 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 568 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 569 | break; |
| 570 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 571 | ND_PRINT("\n\t Link ID: %u (0x%08x)", |
| 572 | GET_BE_U_4(obj_tptr), |
| 573 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 574 | break; |
| 575 | default: |
| 576 | hexdump=TRUE; |
| 577 | } |
| 578 | break; |
| 579 | |
| 580 | case LMP_OBJ_MESSAGE_ID: |
| 581 | switch(lmp_obj_ctype) { |
| 582 | case LMP_CTYPE_1: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 583 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 584 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 585 | break; |
| 586 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 587 | ND_PRINT("\n\t Message ID: %u (0x%08x)", |
| 588 | GET_BE_U_4(obj_tptr), |
| 589 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 590 | break; |
| 591 | case LMP_CTYPE_2: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 592 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 593 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 594 | break; |
| 595 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 596 | ND_PRINT("\n\t Message ID Ack: %u (0x%08x)", |
| 597 | GET_BE_U_4(obj_tptr), |
| 598 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 599 | break; |
| 600 | default: |
| 601 | hexdump=TRUE; |
| 602 | } |
| 603 | break; |
| 604 | |
| 605 | case LMP_OBJ_NODE_ID: |
| 606 | switch(lmp_obj_ctype) { |
| 607 | case LMP_CTYPE_LOC: |
| 608 | case LMP_CTYPE_RMT: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 609 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 610 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 611 | break; |
| 612 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 613 | ND_PRINT("\n\t Node ID: %s (0x%08x)", |
| 614 | GET_IPADDR_STRING(obj_tptr), |
| 615 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 616 | break; |
| 617 | |
| 618 | default: |
| 619 | hexdump=TRUE; |
| 620 | } |
| 621 | break; |
| 622 | |
| 623 | case LMP_OBJ_CONFIG: |
| 624 | switch(lmp_obj_ctype) { |
| 625 | case LMP_CTYPE_HELLO_CONFIG: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 626 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 627 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 628 | break; |
| 629 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 630 | ND_PRINT("\n\t Hello Interval: %u\n\t Hello Dead Interval: %u", |
| 631 | GET_BE_U_2(obj_tptr), |
| 632 | GET_BE_U_2(obj_tptr + 2)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 633 | break; |
| 634 | |
| 635 | default: |
| 636 | hexdump=TRUE; |
| 637 | } |
| 638 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 639 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 640 | case LMP_OBJ_HELLO: |
| 641 | switch(lmp_obj_ctype) { |
| 642 | case LMP_CTYPE_HELLO: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 643 | if (obj_tlen != 8) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 644 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 645 | break; |
| 646 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 647 | ND_PRINT("\n\t Tx Seq: %u, Rx Seq: %u", |
| 648 | GET_BE_U_4(obj_tptr), |
| 649 | GET_BE_U_4(obj_tptr + 4)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 650 | break; |
| 651 | |
| 652 | default: |
| 653 | hexdump=TRUE; |
| 654 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 655 | break; |
| 656 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 657 | case LMP_OBJ_TE_LINK: |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 658 | switch(lmp_obj_ctype) { |
| 659 | case LMP_CTYPE_IPV4: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 660 | if (obj_tlen != 12) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 661 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 662 | break; |
| 663 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 664 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 665 | bittok2str(lmp_obj_te_link_flag_values, |
| 666 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 667 | GET_U_1(obj_tptr))); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 668 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 669 | ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 670 | "\n\t Remote Link-ID: %s (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 671 | GET_IPADDR_STRING(obj_tptr+4), |
| 672 | GET_BE_U_4(obj_tptr + 4), |
| 673 | GET_IPADDR_STRING(obj_tptr+8), |
| 674 | GET_BE_U_4(obj_tptr + 8)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 675 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 676 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 677 | case LMP_CTYPE_IPV6: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 678 | if (obj_tlen != 36) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 679 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 680 | break; |
| 681 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 682 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 683 | bittok2str(lmp_obj_te_link_flag_values, |
| 684 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 685 | GET_U_1(obj_tptr))); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 686 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 687 | ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 688 | "\n\t Remote Link-ID: %s (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 689 | GET_IP6ADDR_STRING(obj_tptr+4), |
| 690 | GET_BE_U_4(obj_tptr + 4), |
| 691 | GET_IP6ADDR_STRING(obj_tptr+20), |
| 692 | GET_BE_U_4(obj_tptr + 20)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 693 | break; |
| 694 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 695 | case LMP_CTYPE_UNMD: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 696 | if (obj_tlen != 12) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 697 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 698 | break; |
| 699 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 700 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 701 | bittok2str(lmp_obj_te_link_flag_values, |
| 702 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 703 | GET_U_1(obj_tptr))); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 704 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 705 | ND_PRINT("\n\t Local Link-ID: %u (0x%08x)" |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 706 | "\n\t Remote Link-ID: %u (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 707 | GET_BE_U_4(obj_tptr + 4), |
| 708 | GET_BE_U_4(obj_tptr + 4), |
| 709 | GET_BE_U_4(obj_tptr + 8), |
| 710 | GET_BE_U_4(obj_tptr + 8)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 711 | break; |
| 712 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 713 | default: |
| 714 | hexdump=TRUE; |
| 715 | } |
| 716 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 717 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 718 | case LMP_OBJ_DATA_LINK: |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 719 | switch(lmp_obj_ctype) { |
| 720 | case LMP_CTYPE_IPV4: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 721 | if (obj_tlen < 12) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 722 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 723 | break; |
| 724 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 725 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 726 | bittok2str(lmp_obj_data_link_flag_values, |
| 727 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 728 | GET_U_1(obj_tptr))); |
| 729 | ND_PRINT("\n\t Local Interface ID: %s (0x%08x)" |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 730 | "\n\t Remote Interface ID: %s (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 731 | GET_IPADDR_STRING(obj_tptr+4), |
| 732 | GET_BE_U_4(obj_tptr + 4), |
| 733 | GET_IPADDR_STRING(obj_tptr+8), |
| 734 | GET_BE_U_4(obj_tptr + 8)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 735 | |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 736 | if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) |
| 737 | hexdump=TRUE; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 738 | break; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 739 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 740 | case LMP_CTYPE_IPV6: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 741 | if (obj_tlen < 36) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 742 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 743 | break; |
| 744 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 745 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 746 | bittok2str(lmp_obj_data_link_flag_values, |
| 747 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 748 | GET_U_1(obj_tptr))); |
| 749 | ND_PRINT("\n\t Local Interface ID: %s (0x%08x)" |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 750 | "\n\t Remote Interface ID: %s (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 751 | GET_IP6ADDR_STRING(obj_tptr+4), |
| 752 | GET_BE_U_4(obj_tptr + 4), |
| 753 | GET_IP6ADDR_STRING(obj_tptr+20), |
| 754 | GET_BE_U_4(obj_tptr + 20)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 755 | |
| 756 | if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36)) |
| 757 | hexdump=TRUE; |
| 758 | break; |
| 759 | |
| 760 | case LMP_CTYPE_UNMD: |
| 761 | if (obj_tlen < 12) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 762 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 763 | break; |
| 764 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 765 | ND_PRINT("\n\t Flags: [%s]", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 766 | bittok2str(lmp_obj_data_link_flag_values, |
| 767 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 768 | GET_U_1(obj_tptr))); |
| 769 | ND_PRINT("\n\t Local Interface ID: %u (0x%08x)" |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 770 | "\n\t Remote Interface ID: %u (0x%08x)", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 771 | GET_BE_U_4(obj_tptr + 4), |
| 772 | GET_BE_U_4(obj_tptr + 4), |
| 773 | GET_BE_U_4(obj_tptr + 8), |
| 774 | GET_BE_U_4(obj_tptr + 8)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 775 | |
| 776 | if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) |
| 777 | hexdump=TRUE; |
| 778 | break; |
| 779 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 780 | default: |
| 781 | hexdump=TRUE; |
| 782 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 783 | break; |
| 784 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 785 | case LMP_OBJ_VERIFY_BEGIN: |
| 786 | switch(lmp_obj_ctype) { |
| 787 | case LMP_CTYPE_1: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 788 | if (obj_tlen != 20) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 789 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 790 | break; |
| 791 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 792 | ND_PRINT("\n\t Flags: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 793 | bittok2str(lmp_obj_begin_verify_flag_values, |
| 794 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 795 | GET_BE_U_2(obj_tptr))); |
| 796 | ND_PRINT("\n\t Verify Interval: %u", |
| 797 | GET_BE_U_2(obj_tptr + 2)); |
| 798 | ND_PRINT("\n\t Data links: %u", |
| 799 | GET_BE_U_4(obj_tptr + 4)); |
| 800 | ND_PRINT("\n\t Encoding type: %s", |
| 801 | tok2str(gmpls_encoding_values, "Unknown", GET_U_1((obj_tptr + 8)))); |
| 802 | ND_PRINT("\n\t Verify Transport Mechanism: %u (0x%x)%s", |
| 803 | GET_BE_U_2(obj_tptr + 10), |
| 804 | GET_BE_U_2(obj_tptr + 10), |
| 805 | GET_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : ""); |
| 806 | bw.i = GET_BE_U_4(obj_tptr + 12); |
| 807 | ND_PRINT("\n\t Transmission Rate: %.3f Mbps",bw.f*8/1000000); |
| 808 | ND_PRINT("\n\t Wavelength: %u", |
| 809 | GET_BE_U_4(obj_tptr + 16)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 810 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 811 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 812 | default: |
| 813 | hexdump=TRUE; |
| 814 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 815 | break; |
| 816 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 817 | case LMP_OBJ_VERIFY_BEGIN_ACK: |
| 818 | switch(lmp_obj_ctype) { |
| 819 | case LMP_CTYPE_1: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 820 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 821 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 822 | break; |
| 823 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 824 | ND_PRINT("\n\t Verify Dead Interval: %u" |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 825 | "\n\t Verify Transport Response: %u", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 826 | GET_BE_U_2(obj_tptr), |
| 827 | GET_BE_U_2(obj_tptr + 2)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 828 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 829 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 830 | default: |
| 831 | hexdump=TRUE; |
| 832 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 833 | break; |
| 834 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 835 | case LMP_OBJ_VERIFY_ID: |
| 836 | switch(lmp_obj_ctype) { |
| 837 | case LMP_CTYPE_1: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 838 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 839 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 840 | break; |
| 841 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 842 | ND_PRINT("\n\t Verify ID: %u", |
| 843 | GET_BE_U_4(obj_tptr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 844 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 845 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 846 | default: |
| 847 | hexdump=TRUE; |
| 848 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 849 | break; |
| 850 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 851 | case LMP_OBJ_CHANNEL_STATUS: |
| 852 | switch(lmp_obj_ctype) { |
| 853 | case LMP_CTYPE_IPV4: |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 854 | offset = 0; |
| 855 | /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 856 | while (offset+8 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 857 | ND_PRINT("\n\t Interface ID: %s (0x%08x)", |
| 858 | GET_IPADDR_STRING(obj_tptr+offset), |
| 859 | GET_BE_U_4(obj_tptr + offset)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 860 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 861 | ND_PRINT("\n\t\t Active: %s (%u)", |
| 862 | (GET_BE_U_4(obj_tptr + offset + 4)>>31) ? |
| 863 | "Allocated" : "Non-allocated", |
| 864 | (GET_BE_U_4(obj_tptr + offset + 4)>>31)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 865 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 866 | ND_PRINT("\n\t\t Direction: %s (%u)", |
| 867 | (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? |
| 868 | "Transmit" : "Receive", |
| 869 | (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 870 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 871 | ND_PRINT("\n\t\t Channel Status: %s (%u)", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 872 | tok2str(lmp_obj_channel_status_values, |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 873 | "Unknown", |
| 874 | GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), |
| 875 | GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 876 | offset+=8; |
| 877 | } |
| 878 | break; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 879 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 880 | case LMP_CTYPE_IPV6: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 881 | offset = 0; |
| 882 | /* Decode pairs: <Interface_ID (16 bytes), Channel_status (4 bytes)> */ |
| 883 | while (offset+20 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 884 | ND_PRINT("\n\t Interface ID: %s (0x%08x)", |
| 885 | GET_IP6ADDR_STRING(obj_tptr+offset), |
| 886 | GET_BE_U_4(obj_tptr + offset)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 887 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 888 | ND_PRINT("\n\t\t Active: %s (%u)", |
| 889 | (GET_BE_U_4(obj_tptr + offset + 16)>>31) ? |
| 890 | "Allocated" : "Non-allocated", |
| 891 | (GET_BE_U_4(obj_tptr + offset + 16)>>31)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 892 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 893 | ND_PRINT("\n\t\t Direction: %s (%u)", |
| 894 | (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1 ? |
| 895 | "Transmit" : "Receive", |
| 896 | (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 897 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 898 | ND_PRINT("\n\t\t Channel Status: %s (%u)", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 899 | tok2str(lmp_obj_channel_status_values, |
| 900 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 901 | GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF), |
| 902 | GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 903 | offset+=20; |
| 904 | } |
| 905 | break; |
| 906 | |
| 907 | case LMP_CTYPE_UNMD: |
| 908 | offset = 0; |
| 909 | /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ |
| 910 | while (offset+8 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 911 | ND_PRINT("\n\t Interface ID: %u (0x%08x)", |
| 912 | GET_BE_U_4(obj_tptr + offset), |
| 913 | GET_BE_U_4(obj_tptr + offset)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 914 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 915 | ND_PRINT("\n\t\t Active: %s (%u)", |
| 916 | (GET_BE_U_4(obj_tptr + offset + 4)>>31) ? |
| 917 | "Allocated" : "Non-allocated", |
| 918 | (GET_BE_U_4(obj_tptr + offset + 4)>>31)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 919 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 920 | ND_PRINT("\n\t\t Direction: %s (%u)", |
| 921 | (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? |
| 922 | "Transmit" : "Receive", |
| 923 | (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 924 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 925 | ND_PRINT("\n\t\t Channel Status: %s (%u)", |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 926 | tok2str(lmp_obj_channel_status_values, |
| 927 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 928 | GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), |
| 929 | GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 930 | offset+=8; |
| 931 | } |
| 932 | break; |
| 933 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 934 | default: |
| 935 | hexdump=TRUE; |
| 936 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 937 | break; |
| 938 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 939 | case LMP_OBJ_CHANNEL_STATUS_REQ: |
| 940 | switch(lmp_obj_ctype) { |
| 941 | case LMP_CTYPE_IPV4: |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 942 | offset = 0; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 943 | while (offset+4 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 944 | ND_PRINT("\n\t Interface ID: %s (0x%08x)", |
| 945 | GET_IPADDR_STRING(obj_tptr+offset), |
| 946 | GET_BE_U_4(obj_tptr + offset)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 947 | offset+=4; |
| 948 | } |
| 949 | break; |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 950 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 951 | case LMP_CTYPE_IPV6: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 952 | offset = 0; |
| 953 | while (offset+16 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 954 | ND_PRINT("\n\t Interface ID: %s (0x%08x)", |
| 955 | GET_IP6ADDR_STRING(obj_tptr+offset), |
| 956 | GET_BE_U_4(obj_tptr + offset)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 957 | offset+=16; |
| 958 | } |
| 959 | break; |
| 960 | |
| 961 | case LMP_CTYPE_UNMD: |
| 962 | offset = 0; |
| 963 | while (offset+4 <= obj_tlen) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 964 | ND_PRINT("\n\t Interface ID: %u (0x%08x)", |
| 965 | GET_BE_U_4(obj_tptr + offset), |
| 966 | GET_BE_U_4(obj_tptr + offset)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 967 | offset+=4; |
| 968 | } |
| 969 | break; |
| 970 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 971 | default: |
| 972 | hexdump=TRUE; |
| 973 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 974 | break; |
| 975 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 976 | case LMP_OBJ_ERROR_CODE: |
| 977 | switch(lmp_obj_ctype) { |
| 978 | case LMP_CTYPE_BEGIN_VERIFY_ERROR: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 979 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 980 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 981 | break; |
| 982 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 983 | ND_PRINT("\n\t Error Code: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 984 | bittok2str(lmp_obj_begin_verify_error_values, |
| 985 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 986 | GET_BE_U_4(obj_tptr))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 987 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 988 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 989 | case LMP_CTYPE_LINK_SUMMARY_ERROR: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 990 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 991 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 992 | break; |
| 993 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 994 | ND_PRINT("\n\t Error Code: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 995 | bittok2str(lmp_obj_link_summary_error_values, |
| 996 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 997 | GET_BE_U_4(obj_tptr))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 998 | break; |
| 999 | default: |
| 1000 | hexdump=TRUE; |
| 1001 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1002 | break; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1003 | |
| 1004 | case LMP_OBJ_SERVICE_CONFIG: |
| 1005 | switch (lmp_obj_ctype) { |
| 1006 | case LMP_CTYPE_SERVICE_CONFIG_SP: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1007 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1008 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1009 | break; |
| 1010 | } |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1011 | ND_PRINT("\n\t Flags: %s", |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1012 | bittok2str(lmp_obj_service_config_sp_flag_values, |
| 1013 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1014 | GET_U_1(obj_tptr))); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1015 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1016 | ND_PRINT("\n\t UNI Version: %u", |
| 1017 | GET_U_1(obj_tptr + 1)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1018 | |
| 1019 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1020 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1021 | case LMP_CTYPE_SERVICE_CONFIG_CPSA: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1022 | if (obj_tlen != 16) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1023 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1024 | break; |
| 1025 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1026 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1027 | link_type = GET_U_1(obj_tptr); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1028 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1029 | ND_PRINT("\n\t Link Type: %s (%u)", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1030 | tok2str(lmp_sd_service_config_cpsa_link_type_values, |
| 1031 | "Unknown", link_type), |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1032 | link_type); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1033 | |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1034 | switch (link_type) { |
| 1035 | case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH: |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1036 | ND_PRINT("\n\t Signal Type: %s (%u)", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1037 | tok2str(lmp_sd_service_config_cpsa_signal_type_sdh_values, |
| 1038 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1039 | GET_U_1(obj_tptr + 1)), |
| 1040 | GET_U_1(obj_tptr + 1)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1041 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1042 | |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1043 | case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET: |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1044 | ND_PRINT("\n\t Signal Type: %s (%u)", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1045 | tok2str(lmp_sd_service_config_cpsa_signal_type_sonet_values, |
| 1046 | "Unknown", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1047 | GET_U_1(obj_tptr + 1)), |
| 1048 | GET_U_1(obj_tptr + 1)); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1049 | break; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1050 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1051 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1052 | ND_PRINT("\n\t Transparency: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1053 | bittok2str(lmp_obj_service_config_cpsa_tp_flag_values, |
| 1054 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1055 | GET_U_1(obj_tptr + 2))); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1056 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1057 | ND_PRINT("\n\t Contiguous Concatenation Types: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1058 | bittok2str(lmp_obj_service_config_cpsa_cct_flag_values, |
| 1059 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1060 | GET_U_1(obj_tptr + 3))); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1061 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1062 | ND_PRINT("\n\t Minimum NCC: %u", |
| 1063 | GET_BE_U_2(obj_tptr + 4)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1064 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1065 | ND_PRINT("\n\t Maximum NCC: %u", |
| 1066 | GET_BE_U_2(obj_tptr + 6)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1067 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1068 | ND_PRINT("\n\t Minimum NVC:%u", |
| 1069 | GET_BE_U_2(obj_tptr + 8)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1070 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1071 | ND_PRINT("\n\t Maximum NVC:%u", |
| 1072 | GET_BE_U_2(obj_tptr + 10)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1073 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1074 | ND_PRINT("\n\t Local Interface ID: %s (0x%08x)", |
| 1075 | GET_IPADDR_STRING(obj_tptr+12), |
| 1076 | GET_BE_U_4(obj_tptr + 12)); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1077 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1078 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1079 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1080 | case LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1081 | if (obj_tlen != 8) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1082 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1083 | break; |
| 1084 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1085 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1086 | ND_PRINT("\n\t Transparency Flags: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1087 | bittok2str( |
| 1088 | lmp_obj_service_config_nsa_transparency_flag_values, |
| 1089 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1090 | GET_BE_U_4(obj_tptr))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1091 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1092 | ND_PRINT("\n\t TCM Monitoring Flags: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1093 | bittok2str( |
| 1094 | lmp_obj_service_config_nsa_tcm_flag_values, |
| 1095 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1096 | GET_U_1(obj_tptr + 7))); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1097 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1098 | break; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1099 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1100 | case LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY: |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1101 | if (obj_tlen != 4) { |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1102 | ND_PRINT(" (not correct for object)"); |
Elliott Hughes | cec480a | 2017-12-19 16:54:57 -0800 | [diff] [blame] | 1103 | break; |
| 1104 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1105 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1106 | ND_PRINT("\n\t Diversity: Flags: %s", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1107 | bittok2str( |
| 1108 | lmp_obj_service_config_nsa_network_diversity_flag_values, |
| 1109 | "none", |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1110 | GET_U_1(obj_tptr + 3))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1111 | break; |
| 1112 | |
| 1113 | default: |
| 1114 | hexdump = TRUE; |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 1115 | } |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1116 | |
| 1117 | break; |
| 1118 | |
| 1119 | default: |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1120 | if (ndo->ndo_vflag <= 1) |
| 1121 | print_unknown_data(ndo,obj_tptr,"\n\t ",obj_tlen); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1122 | break; |
| 1123 | } |
| 1124 | /* do we want to see an additionally hexdump ? */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 1125 | if (ndo->ndo_vflag > 1 || hexdump==TRUE) |
| 1126 | print_unknown_data(ndo,tptr+sizeof(struct lmp_object_header),"\n\t ", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1127 | lmp_obj_len-sizeof(struct lmp_object_header)); |
| 1128 | |
Elliott Hughes | 820eced | 2021-08-20 18:00:50 -0700 | [diff] [blame] | 1129 | if (tlen < lmp_obj_len) { |
| 1130 | ND_PRINT(" [remaining objects length %u < %u]", tlen, lmp_obj_len); |
| 1131 | nd_print_invalid(ndo); |
| 1132 | break; |
| 1133 | } |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1134 | tptr+=lmp_obj_len; |
| 1135 | tlen-=lmp_obj_len; |
| 1136 | } |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1137 | } |