print-dccp.c (276788) | print-dccp.c (285275) |
---|---|
1/* 2 * Copyright (C) Arnaldo Carvalho de Melo 2004 3 * Copyright (C) Ian McDonald 2005 4 * Copyright (C) Yoshifumi Nishida 2005 5 * 6 * This software may be distributed either under the terms of the 7 * BSD-style license that accompanies tcpdump or the GNU GPL version 2 8 */ --- 12 unchanged lines hidden (view full) --- 21#include "addrtoname.h" 22#include "extract.h" /* must come after interface.h */ 23#include "ip.h" 24#ifdef INET6 25#include "ip6.h" 26#endif 27#include "ipproto.h" 28 | 1/* 2 * Copyright (C) Arnaldo Carvalho de Melo 2004 3 * Copyright (C) Ian McDonald 2005 4 * Copyright (C) Yoshifumi Nishida 2005 5 * 6 * This software may be distributed either under the terms of the 7 * BSD-style license that accompanies tcpdump or the GNU GPL version 2 8 */ --- 12 unchanged lines hidden (view full) --- 21#include "addrtoname.h" 22#include "extract.h" /* must come after interface.h */ 23#include "ip.h" 24#ifdef INET6 25#include "ip6.h" 26#endif 27#include "ipproto.h" 28 |
29/* RFC4340: Datagram Congestion Control Protocol (DCCP) */ 30 |
|
29/** 30 * struct dccp_hdr - generic part of DCCP packet header, with a 24-bit 31 * sequence number 32 * 33 * @dccph_sport - Relevant port on the endpoint that sent this packet 34 * @dccph_dport - Relevant port on the other endpoint 35 * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words 36 * @dccph_ccval - Used by the HC-Sender CCID --- 81 unchanged lines hidden (view full) --- 118 DCCP_PKT_RESPONSE, 119 DCCP_PKT_DATA, 120 DCCP_PKT_ACK, 121 DCCP_PKT_DATAACK, 122 DCCP_PKT_CLOSEREQ, 123 DCCP_PKT_CLOSE, 124 DCCP_PKT_RESET, 125 DCCP_PKT_SYNC, | 31/** 32 * struct dccp_hdr - generic part of DCCP packet header, with a 24-bit 33 * sequence number 34 * 35 * @dccph_sport - Relevant port on the endpoint that sent this packet 36 * @dccph_dport - Relevant port on the other endpoint 37 * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words 38 * @dccph_ccval - Used by the HC-Sender CCID --- 81 unchanged lines hidden (view full) --- 120 DCCP_PKT_RESPONSE, 121 DCCP_PKT_DATA, 122 DCCP_PKT_ACK, 123 DCCP_PKT_DATAACK, 124 DCCP_PKT_CLOSEREQ, 125 DCCP_PKT_CLOSE, 126 DCCP_PKT_RESET, 127 DCCP_PKT_SYNC, |
126 DCCP_PKT_SYNCACK, 127 DCCP_PKT_INVALID | 128 DCCP_PKT_SYNCACK |
128}; 129 | 129}; 130 |
131static const struct tok dccp_pkt_type_str[] = { 132 { DCCP_PKT_REQUEST, "DCCP-Request" }, 133 { DCCP_PKT_RESPONSE, "DCCP-Response" }, 134 { DCCP_PKT_DATA, "DCCP-Data" }, 135 { DCCP_PKT_ACK, "DCCP-Ack" }, 136 { DCCP_PKT_DATAACK, "DCCP-DataAck" }, 137 { DCCP_PKT_CLOSEREQ, "DCCP-CloseReq" }, 138 { DCCP_PKT_CLOSE, "DCCP-Close" }, 139 { DCCP_PKT_RESET, "DCCP-Reset" }, 140 { DCCP_PKT_SYNC, "DCCP-Sync" }, 141 { DCCP_PKT_SYNCACK, "DCCP-SyncAck" }, 142 { 0, NULL} 143}; 144 |
|
130enum dccp_reset_codes { 131 DCCP_RESET_CODE_UNSPECIFIED = 0, 132 DCCP_RESET_CODE_CLOSED, 133 DCCP_RESET_CODE_ABORTED, 134 DCCP_RESET_CODE_NO_CONNECTION, 135 DCCP_RESET_CODE_PACKET_ERROR, 136 DCCP_RESET_CODE_OPTION_ERROR, 137 DCCP_RESET_CODE_MANDATORY_ERROR, --- 110 unchanged lines hidden (view full) --- 248 249/** 250 * dccp_print - show dccp packet 251 * @bp - beginning of dccp packet 252 * @data2 - beginning of enclosing 253 * @len - lenght of ip packet 254 */ 255void dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, | 145enum dccp_reset_codes { 146 DCCP_RESET_CODE_UNSPECIFIED = 0, 147 DCCP_RESET_CODE_CLOSED, 148 DCCP_RESET_CODE_ABORTED, 149 DCCP_RESET_CODE_NO_CONNECTION, 150 DCCP_RESET_CODE_PACKET_ERROR, 151 DCCP_RESET_CODE_OPTION_ERROR, 152 DCCP_RESET_CODE_MANDATORY_ERROR, --- 110 unchanged lines hidden (view full) --- 263 264/** 265 * dccp_print - show dccp packet 266 * @bp - beginning of dccp packet 267 * @data2 - beginning of enclosing 268 * @len - lenght of ip packet 269 */ 270void dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, |
256 u_int len) | 271 u_int len) |
257{ 258 const struct dccp_hdr *dh; 259 const struct ip *ip; 260#ifdef INET6 261 const struct ip6_hdr *ip6; 262#endif 263 const u_char *cp; 264 u_short sport, dport; 265 u_int hlen; 266 u_int fixed_hdrlen; | 272{ 273 const struct dccp_hdr *dh; 274 const struct ip *ip; 275#ifdef INET6 276 const struct ip6_hdr *ip6; 277#endif 278 const u_char *cp; 279 u_short sport, dport; 280 u_int hlen; 281 u_int fixed_hdrlen; |
282 uint8_t dccph_type; |
|
267 268 dh = (const struct dccp_hdr *)bp; 269 270 ip = (struct ip *)data2; 271#ifdef INET6 272 if (IP_V(ip) == 6) 273 ip6 = (const struct ip6_hdr *)data2; 274 else 275 ip6 = NULL; 276#endif /*INET6*/ 277 278 /* make sure we have enough data to look at the X bit */ 279 cp = (const u_char *)(dh + 1); 280 if (cp > ndo->ndo_snapend) { 281 ND_PRINT((ndo, "[Invalid packet|dccp]")); 282 return; 283 } 284 if (len < sizeof(struct dccp_hdr)) { 285 ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", | 283 284 dh = (const struct dccp_hdr *)bp; 285 286 ip = (struct ip *)data2; 287#ifdef INET6 288 if (IP_V(ip) == 6) 289 ip6 = (const struct ip6_hdr *)data2; 290 else 291 ip6 = NULL; 292#endif /*INET6*/ 293 294 /* make sure we have enough data to look at the X bit */ 295 cp = (const u_char *)(dh + 1); 296 if (cp > ndo->ndo_snapend) { 297 ND_PRINT((ndo, "[Invalid packet|dccp]")); 298 return; 299 } 300 if (len < sizeof(struct dccp_hdr)) { 301 ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", |
286 len - (u_int)sizeof(struct dccp_hdr))); | 302 len - (u_int)sizeof(struct dccp_hdr))); |
287 return; 288 } 289 290 /* get the length of the generic header */ 291 fixed_hdrlen = dccp_basic_hdr_len(dh); 292 if (len < fixed_hdrlen) { 293 ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", | 303 return; 304 } 305 306 /* get the length of the generic header */ 307 fixed_hdrlen = dccp_basic_hdr_len(dh); 308 if (len < fixed_hdrlen) { 309 ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", |
294 len - fixed_hdrlen)); | 310 len - fixed_hdrlen)); |
295 return; 296 } 297 ND_TCHECK2(*dh, fixed_hdrlen); 298 299 sport = EXTRACT_16BITS(&dh->dccph_sport); 300 dport = EXTRACT_16BITS(&dh->dccph_dport); 301 hlen = dh->dccph_doff * 4; 302 303#ifdef INET6 304 if (ip6) { 305 ND_PRINT((ndo, "%s.%d > %s.%d: ", | 311 return; 312 } 313 ND_TCHECK2(*dh, fixed_hdrlen); 314 315 sport = EXTRACT_16BITS(&dh->dccph_sport); 316 dport = EXTRACT_16BITS(&dh->dccph_dport); 317 hlen = dh->dccph_doff * 4; 318 319#ifdef INET6 320 if (ip6) { 321 ND_PRINT((ndo, "%s.%d > %s.%d: ", |
306 ip6addr_string(ndo, &ip6->ip6_src), sport, 307 ip6addr_string(ndo, &ip6->ip6_dst), dport)); | 322 ip6addr_string(ndo, &ip6->ip6_src), sport, 323 ip6addr_string(ndo, &ip6->ip6_dst), dport)); |
308 } else 309#endif /*INET6*/ 310 { 311 ND_PRINT((ndo, "%s.%d > %s.%d: ", | 324 } else 325#endif /*INET6*/ 326 { 327 ND_PRINT((ndo, "%s.%d > %s.%d: ", |
312 ipaddr_string(ndo, &ip->ip_src), sport, 313 ipaddr_string(ndo, &ip->ip_dst), dport)); | 328 ipaddr_string(ndo, &ip->ip_src), sport, 329 ipaddr_string(ndo, &ip->ip_dst), dport)); |
314 } 315 | 330 } 331 |
332 ND_PRINT((ndo, "DCCP")); 333 |
|
316 if (ndo->ndo_qflag) { 317 ND_PRINT((ndo, " %d", len - hlen)); 318 if (hlen > len) { | 334 if (ndo->ndo_qflag) { 335 ND_PRINT((ndo, " %d", len - hlen)); 336 if (hlen > len) { |
319 ND_PRINT((ndo, "dccp [bad hdr length %u - too long, > %u]", 320 hlen, len)); | 337 ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]", 338 hlen, len)); |
321 } 322 return; 323 } 324 325 /* other variables in generic header */ 326 if (ndo->ndo_vflag) { | 339 } 340 return; 341 } 342 343 /* other variables in generic header */ 344 if (ndo->ndo_vflag) { |
327 ND_PRINT((ndo, "CCVal %d, CsCov %d, ", DCCPH_CCVAL(dh), DCCPH_CSCOV(dh))); | 345 ND_PRINT((ndo, " (CCVal %d, CsCov %d, ", DCCPH_CCVAL(dh), DCCPH_CSCOV(dh))); |
328 } 329 330 /* checksum calculation */ 331 if (ndo->ndo_vflag && ND_TTEST2(bp[0], len)) { 332 uint16_t sum = 0, dccp_sum; 333 334 dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum); 335 ND_PRINT((ndo, "cksum 0x%04x ", dccp_sum)); 336 if (IP_V(ip) == 4) 337 sum = dccp_cksum(ndo, ip, dh, len); 338#ifdef INET6 339 else if (IP_V(ip) == 6) 340 sum = dccp6_cksum(ip6, dh, len); 341#endif 342 if (sum != 0) | 346 } 347 348 /* checksum calculation */ 349 if (ndo->ndo_vflag && ND_TTEST2(bp[0], len)) { 350 uint16_t sum = 0, dccp_sum; 351 352 dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum); 353 ND_PRINT((ndo, "cksum 0x%04x ", dccp_sum)); 354 if (IP_V(ip) == 4) 355 sum = dccp_cksum(ndo, ip, dh, len); 356#ifdef INET6 357 else if (IP_V(ip) == 6) 358 sum = dccp6_cksum(ip6, dh, len); 359#endif 360 if (sum != 0) |
343 ND_PRINT((ndo, "(incorrect -> 0x%04x), ",in_cksum_shouldbe(dccp_sum, sum))); | 361 ND_PRINT((ndo, "(incorrect -> 0x%04x)",in_cksum_shouldbe(dccp_sum, sum))); |
344 else | 362 else |
345 ND_PRINT((ndo, "(correct), ")); | 363 ND_PRINT((ndo, "(correct)")); |
346 } 347 | 364 } 365 |
348 switch (DCCPH_TYPE(dh)) { | 366 if (ndo->ndo_vflag) 367 ND_PRINT((ndo, ")")); 368 ND_PRINT((ndo, " ")); 369 370 dccph_type = DCCPH_TYPE(dh); 371 switch (dccph_type) { |
349 case DCCP_PKT_REQUEST: { 350 struct dccp_hdr_request *dhr = 351 (struct dccp_hdr_request *)(bp + fixed_hdrlen); 352 fixed_hdrlen += 4; 353 if (len < fixed_hdrlen) { | 372 case DCCP_PKT_REQUEST: { 373 struct dccp_hdr_request *dhr = 374 (struct dccp_hdr_request *)(bp + fixed_hdrlen); 375 fixed_hdrlen += 4; 376 if (len < fixed_hdrlen) { |
354 ND_PRINT((ndo, "truncated-dccp request - %u bytes missing!", 355 len - fixed_hdrlen)); | 377 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 378 tok2str(dccp_pkt_type_str, "", dccph_type), 379 len - fixed_hdrlen)); |
356 return; 357 } 358 ND_TCHECK(*dhr); | 380 return; 381 } 382 ND_TCHECK(*dhr); |
359 ND_PRINT((ndo, "request (service=%d) ", 360 EXTRACT_32BITS(&dhr->dccph_req_service))); | 383 ND_PRINT((ndo, "%s (service=%d) ", 384 tok2str(dccp_pkt_type_str, "", dccph_type), 385 EXTRACT_32BITS(&dhr->dccph_req_service))); |
361 break; 362 } 363 case DCCP_PKT_RESPONSE: { 364 struct dccp_hdr_response *dhr = 365 (struct dccp_hdr_response *)(bp + fixed_hdrlen); 366 fixed_hdrlen += 12; 367 if (len < fixed_hdrlen) { | 386 break; 387 } 388 case DCCP_PKT_RESPONSE: { 389 struct dccp_hdr_response *dhr = 390 (struct dccp_hdr_response *)(bp + fixed_hdrlen); 391 fixed_hdrlen += 12; 392 if (len < fixed_hdrlen) { |
368 ND_PRINT((ndo, "truncated-dccp response - %u bytes missing!", 369 len - fixed_hdrlen)); | 393 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 394 tok2str(dccp_pkt_type_str, "", dccph_type), 395 len - fixed_hdrlen)); |
370 return; 371 } 372 ND_TCHECK(*dhr); | 396 return; 397 } 398 ND_TCHECK(*dhr); |
373 ND_PRINT((ndo, "response (service=%d) ", 374 EXTRACT_32BITS(&dhr->dccph_resp_service))); | 399 ND_PRINT((ndo, "%s (service=%d) ", 400 tok2str(dccp_pkt_type_str, "", dccph_type), 401 EXTRACT_32BITS(&dhr->dccph_resp_service))); |
375 break; 376 } 377 case DCCP_PKT_DATA: | 402 break; 403 } 404 case DCCP_PKT_DATA: |
378 ND_PRINT((ndo, "data ")); | 405 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
379 break; 380 case DCCP_PKT_ACK: { 381 fixed_hdrlen += 8; 382 if (len < fixed_hdrlen) { | 406 break; 407 case DCCP_PKT_ACK: { 408 fixed_hdrlen += 8; 409 if (len < fixed_hdrlen) { |
383 ND_PRINT((ndo, "truncated-dccp ack - %u bytes missing!", 384 len - fixed_hdrlen)); | 410 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 411 tok2str(dccp_pkt_type_str, "", dccph_type), 412 len - fixed_hdrlen)); |
385 return; 386 } | 413 return; 414 } |
387 ND_PRINT((ndo, "ack ")); | 415 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
388 break; 389 } 390 case DCCP_PKT_DATAACK: { 391 fixed_hdrlen += 8; 392 if (len < fixed_hdrlen) { | 416 break; 417 } 418 case DCCP_PKT_DATAACK: { 419 fixed_hdrlen += 8; 420 if (len < fixed_hdrlen) { |
393 ND_PRINT((ndo, "truncated-dccp dataack - %u bytes missing!", 394 len - fixed_hdrlen)); | 421 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 422 tok2str(dccp_pkt_type_str, "", dccph_type), 423 len - fixed_hdrlen)); |
395 return; 396 } | 424 return; 425 } |
397 ND_PRINT((ndo, "dataack ")); | 426 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
398 break; 399 } 400 case DCCP_PKT_CLOSEREQ: 401 fixed_hdrlen += 8; 402 if (len < fixed_hdrlen) { | 427 break; 428 } 429 case DCCP_PKT_CLOSEREQ: 430 fixed_hdrlen += 8; 431 if (len < fixed_hdrlen) { |
403 ND_PRINT((ndo, "truncated-dccp closereq - %u bytes missing!", 404 len - fixed_hdrlen)); | 432 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 433 tok2str(dccp_pkt_type_str, "", dccph_type), 434 len - fixed_hdrlen)); |
405 return; 406 } | 435 return; 436 } |
407 ND_PRINT((ndo, "closereq ")); | 437 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
408 break; 409 case DCCP_PKT_CLOSE: 410 fixed_hdrlen += 8; 411 if (len < fixed_hdrlen) { | 438 break; 439 case DCCP_PKT_CLOSE: 440 fixed_hdrlen += 8; 441 if (len < fixed_hdrlen) { |
412 ND_PRINT((ndo, "truncated-dccp close - %u bytes missing!", 413 len - fixed_hdrlen)); | 442 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 443 tok2str(dccp_pkt_type_str, "", dccph_type), 444 len - fixed_hdrlen)); |
414 return; 415 } | 445 return; 446 } |
416 ND_PRINT((ndo, "close ")); | 447 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
417 break; 418 case DCCP_PKT_RESET: { 419 struct dccp_hdr_reset *dhr = 420 (struct dccp_hdr_reset *)(bp + fixed_hdrlen); 421 fixed_hdrlen += 12; 422 if (len < fixed_hdrlen) { | 448 break; 449 case DCCP_PKT_RESET: { 450 struct dccp_hdr_reset *dhr = 451 (struct dccp_hdr_reset *)(bp + fixed_hdrlen); 452 fixed_hdrlen += 12; 453 if (len < fixed_hdrlen) { |
423 ND_PRINT((ndo, "truncated-dccp reset - %u bytes missing!", 424 len - fixed_hdrlen)); | 454 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 455 tok2str(dccp_pkt_type_str, "", dccph_type), 456 len - fixed_hdrlen)); |
425 return; 426 } 427 ND_TCHECK(*dhr); | 457 return; 458 } 459 ND_TCHECK(*dhr); |
428 ND_PRINT((ndo, "reset (code=%s) ", 429 dccp_reset_code(dhr->dccph_reset_code))); | 460 ND_PRINT((ndo, "%s (code=%s) ", 461 tok2str(dccp_pkt_type_str, "", dccph_type), 462 dccp_reset_code(dhr->dccph_reset_code))); |
430 break; 431 } 432 case DCCP_PKT_SYNC: 433 fixed_hdrlen += 8; 434 if (len < fixed_hdrlen) { | 463 break; 464 } 465 case DCCP_PKT_SYNC: 466 fixed_hdrlen += 8; 467 if (len < fixed_hdrlen) { |
435 ND_PRINT((ndo, "truncated-dccp sync - %u bytes missing!", 436 len - fixed_hdrlen)); | 468 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 469 tok2str(dccp_pkt_type_str, "", dccph_type), 470 len - fixed_hdrlen)); |
437 return; 438 } | 471 return; 472 } |
439 ND_PRINT((ndo, "sync ")); | 473 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
440 break; 441 case DCCP_PKT_SYNCACK: 442 fixed_hdrlen += 8; 443 if (len < fixed_hdrlen) { | 474 break; 475 case DCCP_PKT_SYNCACK: 476 fixed_hdrlen += 8; 477 if (len < fixed_hdrlen) { |
444 ND_PRINT((ndo, "truncated-dccp syncack - %u bytes missing!", 445 len - fixed_hdrlen)); | 478 ND_PRINT((ndo, "truncated-%s - %u bytes missing!", 479 tok2str(dccp_pkt_type_str, "", dccph_type), 480 len - fixed_hdrlen)); |
446 return; 447 } | 481 return; 482 } |
448 ND_PRINT((ndo, "syncack ")); | 483 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); |
449 break; 450 default: | 484 break; 485 default: |
451 ND_PRINT((ndo, "invalid ")); | 486 ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "unknown-type-%u", dccph_type))); |
452 break; 453 } 454 455 if ((DCCPH_TYPE(dh) != DCCP_PKT_DATA) && 456 (DCCPH_TYPE(dh) != DCCP_PKT_REQUEST)) 457 dccp_print_ack_no(ndo, bp); 458 459 if (ndo->ndo_vflag < 2) --- 39 unchanged lines hidden (view full) --- 499 { 37, "ndp_count" }, 500 { 38, "ack_vector0" }, 501 { 39, "ack_vector1" }, 502 { 40, "data_dropped" }, 503 { 41, "timestamp" }, 504 { 42, "timestamp_echo" }, 505 { 43, "elapsed_time" }, 506 { 44, "data_checksum" }, | 487 break; 488 } 489 490 if ((DCCPH_TYPE(dh) != DCCP_PKT_DATA) && 491 (DCCPH_TYPE(dh) != DCCP_PKT_REQUEST)) 492 dccp_print_ack_no(ndo, bp); 493 494 if (ndo->ndo_vflag < 2) --- 39 unchanged lines hidden (view full) --- 534 { 37, "ndp_count" }, 535 { 38, "ack_vector0" }, 536 { 39, "ack_vector1" }, 537 { 40, "data_dropped" }, 538 { 41, "timestamp" }, 539 { 42, "timestamp_echo" }, 540 { 43, "elapsed_time" }, 541 { 44, "data_checksum" }, |
507 { 0, NULL } | 542 { 0, NULL } |
508}; 509 510static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen) 511{ 512 uint8_t optlen, i; 513 514 ND_TCHECK(*option); 515 516 if (*option >= 32) { 517 ND_TCHECK(*(option+1)); 518 optlen = *(option +1); 519 if (optlen < 2) { 520 if (*option >= 128) 521 ND_PRINT((ndo, "CCID option %u optlen too short", *option)); 522 else 523 ND_PRINT((ndo, "%s optlen too short", | 543}; 544 545static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen) 546{ 547 uint8_t optlen, i; 548 549 ND_TCHECK(*option); 550 551 if (*option >= 32) { 552 ND_TCHECK(*(option+1)); 553 optlen = *(option +1); 554 if (optlen < 2) { 555 if (*option >= 128) 556 ND_PRINT((ndo, "CCID option %u optlen too short", *option)); 557 else 558 ND_PRINT((ndo, "%s optlen too short", |
524 tok2str(dccp_option_values, "Option %u", *option))); | 559 tok2str(dccp_option_values, "Option %u", *option))); |
525 return 0; 526 } 527 } else 528 optlen = 1; 529 530 if (hlen < optlen) { 531 if (*option >= 128) 532 ND_PRINT((ndo, "CCID option %u optlen goes past header length", | 560 return 0; 561 } 562 } else 563 optlen = 1; 564 565 if (hlen < optlen) { 566 if (*option >= 128) 567 ND_PRINT((ndo, "CCID option %u optlen goes past header length", |
533 *option)); | 568 *option)); |
534 else 535 ND_PRINT((ndo, "%s optlen goes past header length", | 569 else 570 ND_PRINT((ndo, "%s optlen goes past header length", |
536 tok2str(dccp_option_values, "Option %u", *option))); | 571 tok2str(dccp_option_values, "Option %u", *option))); |
537 return 0; 538 } 539 ND_TCHECK2(*option, optlen); 540 541 if (*option >= 128) { 542 ND_PRINT((ndo, "CCID option %d", *option)); 543 switch (optlen) { 544 case 4: --- 92 unchanged lines hidden --- | 572 return 0; 573 } 574 ND_TCHECK2(*option, optlen); 575 576 if (*option >= 128) { 577 ND_PRINT((ndo, "CCID option %d", *option)); 578 switch (optlen) { 579 case 4: --- 92 unchanged lines hidden --- |