X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/38a040b901be76dffddec748c877944346ee581f..7e1b82f7368ffd2b7787dba6ed5a6b0b628e9040:/print-slow.c diff --git a/print-slow.c b/print-slow.c index 327b852f..eaf94ed9 100644 --- a/print-slow.c +++ b/print-slow.c @@ -20,7 +20,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-slow.c,v 1.5 2006-05-18 08:23:26 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-slow.c,v 1.8 2006-10-12 05:44:33 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -93,7 +93,7 @@ struct slow_oam_info_t { u_int8_t revision[2]; u_int8_t state; u_int8_t oam_config; - u_int8_t oam_pdu_config; + u_int8_t oam_pdu_config[2]; u_int8_t oui[3]; u_int8_t vendor_private[4]; }; @@ -178,6 +178,10 @@ struct slow_oam_variableresponse_t { u_int8_t length; }; +struct slow_oam_loopbackctrl_t { + u_int8_t command; +}; + static const struct tok slow_oam_loopbackctrl_cmd_values[] = { { 0x01, "Enable OAM Remote Loopback" }, { 0x02, "Disable OAM Remote Loopback" }, @@ -473,6 +477,7 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { const struct slow_oam_link_event_t *slow_oam_link_event; const struct slow_oam_variablerequest_t *slow_oam_variablerequest; const struct slow_oam_variableresponse_t *slow_oam_variableresponse; + const struct slow_oam_loopbackctrl_t *slow_oam_loopbackctrl; } tlv; ptr.slow_oam_common_header = (struct slow_oam_common_header_t *)tptr; @@ -509,8 +514,8 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { if (tlv.slow_oam_info->info_length != sizeof(struct slow_oam_info_t)) { - printf("\n\t ERROR: illegal length - should be %u", - sizeof(struct slow_oam_info_t)); + printf("\n\t ERROR: illegal length - should be %lu", + (unsigned long) sizeof(struct slow_oam_info_t)); return; } @@ -518,7 +523,7 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { tlv.slow_oam_info->oam_version, EXTRACT_16BITS(&tlv.slow_oam_info->revision)); - printf("\n\t State-MUX-Action %s, State-Parser-Action %s", + printf("\n\t State-Parser-Action %s, State-MUX-Action %s", tok2str(slow_oam_info_type_state_parser_values, "Reserved", tlv.slow_oam_info->state & OAM_INFO_TYPE_PARSER_MASK), tok2str(slow_oam_info_type_state_mux_values, "Reserved", @@ -585,8 +590,8 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { if (tlv.slow_oam_link_event->event_length != sizeof(struct slow_oam_link_event_t)) { - printf("\n\t ERROR: illegal length - should be %u", - sizeof(struct slow_oam_link_event_t)); + printf("\n\t ERROR: illegal length - should be %lu", + (unsigned long) sizeof(struct slow_oam_link_event_t)); return; } @@ -627,6 +632,17 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { tptr += ptr.slow_oam_tlv_header->length; } break; + + case SLOW_OAM_CODE_LOOPBACK_CTRL: + tlv.slow_oam_loopbackctrl = (const struct slow_oam_loopbackctrl_t *)tptr; + printf("\n\t Command %s (%u)", + tok2str(slow_oam_loopbackctrl_cmd_values, + "Unknown", + tlv.slow_oam_loopbackctrl->command), + tlv.slow_oam_loopbackctrl->command); + tptr ++; + tlen --; + break; /* * FIXME those are the defined codes that lack a decoder @@ -634,7 +650,6 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { */ case SLOW_OAM_CODE_VAR_REQUEST: case SLOW_OAM_CODE_VAR_RESPONSE: - case SLOW_OAM_CODE_LOOPBACK_CTRL: case SLOW_OAM_CODE_PRIVATE: default: if (vflag <= 1) {