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