(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-lapd.c) |
| |
| 383 | | | dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 384 | | | { |
| 385 | | | proto_tree *lapd_tree, *addr_tree, *checksum_tree; |
| 386 | | | proto_item *lapd_ti, *addr_ti, *checksum_ti; |
| 387 | | | int direction; |
| 388 | | | guint16 control, checksum, checksum_calculated; |
| 389 | | | int , checksum_offset; |
| 390 | | | guint16 address, cr, sapi, tei; |
| 391 | | | gboolean is_response = 0; |
| 392 | | | tvbuff_t *next_tvb; |
| 393 | | | const char *srcname = "?"; |
| 394 | | | const char *dstname = "?"; |
| 395 | | | |
| 396 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
Event 1:
Taking true branch. check_col(...) evaluates to true.
hide
|
|
| 397 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPD"); |
| 398 | [+] | | if (check_col(pinfo->cinfo, COL_INFO)) |
 |
| 399 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 400 | | | |
| 401 | | | address = tvb_get_ntohs(tvb, 0); |
| 402 | | | cr = address & LAPD_CR; |
| 403 | | | tei = (address & LAPD_TEI) >> LAPD_TEI_SHIFT; |
| 404 | | | sapi = (address & LAPD_SAPI) >> LAPD_SAPI_SHIFT; |
| 405 | | | = 2; |
| 406 | | | |
| 407 | [+] | | if (check_col(pinfo->cinfo, COL_TEI)) |
 |
| 408 | | | col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei); |
| 409 | | | |
| 410 | | | if (pinfo->fd->lnk_t == WTAP_ENCAP_LINUX_LAPD) { |
Event 8:
Taking false branch. pinfo->fd->lnk_t == 88 evaluates to false.
hide
|
|
| 411 | | | |
| 412 | | | if (pinfo->->lapd.pkttype == 4 ) { |
| 413 | | | if (pinfo->->lapd.we_network) { |
| 414 | | | is_response = cr ? FALSE : TRUE; |
| 415 | | | srcname = "Local Network"; |
| 416 | | | dstname = "Remote User"; |
| 417 | | | direction = P2P_DIR_RECV; |
| 418 | | | } else { |
| 419 | | | srcname = "Local User"; |
| 420 | | | dstname = "Remote Network"; |
| 421 435 |  | | [ Lines 421 to 435 omitted. ] |
| 436 | | | srcname = "Remote User"; |
| 437 | | | dstname = "Local Network"; |
| 438 | | | direction = P2P_DIR_SENT; |
| 439 | | | } else { |
| 440 | | | is_response = cr ? FALSE : TRUE; |
| 441 | | | srcname = "Remote Network"; |
| 442 | | | dstname = "Local User"; |
| 443 | | | direction = P2P_DIR_RECV; |
| 444 | | | } |
| 445 | | | } |
| 446 | | | } else { |
| 447 | | | direction = pinfo->p2p_dir; |
| 448 | | | if (pinfo->p2p_dir == P2P_DIR_RECV) { |
Event 9:
Taking true branch. pinfo->p2p_dir == 1 evaluates to true.
hide
|
|
| 449 | | | is_response = cr ? FALSE : TRUE; |
Event 10:
cr evaluates to true.
hide
|
|
| 450 | | | srcname = "Network"; |
| 451 | | | dstname = "User"; |
| 452 | | | } |
| 453 | | | else if (pinfo->p2p_dir == P2P_DIR_SENT) { |
| 454 | | | is_response = cr ? TRUE : FALSE; |
| 455 | | | srcname = "User"; |
| 456 | | | dstname = "Network"; |
| 457 | | | } |
| 458 | | | } |
| 459 | | | |
| 460 | | | if(check_col(pinfo->cinfo, COL_RES_DL_SRC)) |
Event 11:
Taking true branch. check_col(...) evaluates to true.
hide
|
|
| 461 | | | col_set_str(pinfo->cinfo, COL_RES_DL_SRC, srcname); |
| 462 | [+] | | if(check_col(pinfo->cinfo, COL_RES_DL_DST)) |
 |
| 463 | | | col_set_str(pinfo->cinfo, COL_RES_DL_DST, dstname); |
| 464 | | | |
| 465 | | | if (tree) { |
Event 15:
Taking true branch. tree evaluates to true.
hide
|
|
| 466 | | | proto_item *direction_ti; |
| 467 | | | |
| 468 | | | lapd_ti = proto_tree_add_item(tree, proto_lapd, tvb, 0, -1, |
| 469 | | | FALSE); |
| 470 | | | lapd_tree = proto_item_add_subtree(lapd_ti, ett_lapd); |
| 471 | | | |
| 472 | | | |
| 473 | | | |
| 474 | | | |
| 475 | | | if (direction != P2P_DIR_UNKNOWN) { |
Event 16:
Taking true branch. direction != -1 evaluates to true.
hide
|
|
| 476 | | | direction_ti = proto_tree_add_uint(lapd_tree, hf_lapd_direction, |
| 477 | | | tvb, 0, 0, pinfo->p2p_dir); |
| 478 | | | PROTO_ITEM_SET_GENERATED(direction_ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 17:
direction_ti evaluates to true.
hide
|
|
| 479 | | | } |
| 480 | | | |
| 481 | | | addr_ti = proto_tree_add_uint(lapd_tree, hf_lapd_address, tvb, |
| 482 | | | 0, 2, address); |
| 483 | | | addr_tree = proto_item_add_subtree(addr_ti, ett_lapd_address); |
| 484 | | | |
| 485 | | | if(global_lapd_gsm_sapis){ |
Event 18:
Taking false branch. global_lapd_gsm_sapis evaluates to false.
hide
|
|
| 486 | | | proto_tree_add_uint(addr_tree, hf_lapd_gsm_sapi,tvb, 0, 1, address); |
| 487 | | | }else{ |
| 488 | | | proto_tree_add_uint(addr_tree, hf_lapd_sapi,tvb, 0, 1, address); |
| 489 | | | } |
| 490 | | | proto_tree_add_uint(addr_tree, hf_lapd_cr, tvb, 0, 1, address); |
| 491 | | | proto_tree_add_uint(addr_tree, hf_lapd_ea1, tvb, 0, 1, address); |
| 492 | | | proto_tree_add_uint(addr_tree, hf_lapd_tei, tvb, 1, 1, address); |
| 493 | | | proto_tree_add_uint(addr_tree, hf_lapd_ea2, tvb, 1, 1, address); |
| 494 | | | } |
| 495 | | | else { |
| 496 | | | lapd_ti = NULL; |
| 497 | | | lapd_tree = NULL; |
| 498 | | | } |
| 499 | | | |
| 500 | | | control = dissect_xdlc_control(tvb, 2, pinfo, lapd_tree, hf_lapd_control, |
| 501 | | | ett_lapd_control, &lapd_cf_items, &lapd_cf_items_ext, NULL, NULL, |
| 502 | | | is_response, TRUE, FALSE); |
Event 19:
!0 evaluates to true.
hide
|
|
| 503 | | | += XDLC_CONTROL_LEN(control, TRUE);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/xdlc.h |
| |
107 | #define XDLC_CONTROL_LEN(control, is_extended) \ |
108 | ((((control) & XDLC_S_U_MASK) == XDLC_U || !(is_extended)) ? 1 : 2) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/xdlc.h |
| |
35 | #define XDLC_S_U_MASK 0x03 /* Mask to test for S or U */ |
| |
|
Event 20:
(control & 3) == 3 evaluates to true.
hide
|
|
| 504 | | | |
| 505 | | | if (tree) |
Event 21:
Taking true branch. tree evaluates to true.
hide
|
|
| 506 | | | proto_item_set_len(lapd_ti, ); |
| 507 | | | |
| 508 | [+] | | if (NULL != p_get_proto_data(pinfo->fd, proto_lapd) |
 |
| 509 | [+] | | && ((lapd_ppi_t*)p_get_proto_data(pinfo->fd, proto_lapd))->has_crc) { |
 |
| |