(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-icmpv6.c) |
| |
| 1445 | | | dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 1446 | | | { |
| 1447 | | | proto_tree *icmp6_tree, *field_tree; |
| 1448 | | | proto_item *ti, *hidden_item, *tf = NULL; |
| 1449 | | | struct icmp6_hdr icmp6_hdr, *dp; |
| 1450 | | | struct icmp6_nodeinfo *ni = NULL; |
| 1451 | | | const char *codename, *typename; |
| 1452 | | | const char *colcodename, *coltypename; |
| 1453 | | | int len; |
| 1454 | | | guint length, reported_length; |
| 1455 | | | vec_t cksum_vec[4]; |
| 1456 | | | guint32 phdr[2]; |
| 1457 | | | guint16 cksum, computed_cksum; |
| 1458 | | | int offset; |
| 1459 | | | tvbuff_t *next_tvb; |
| 1460 | | | |
| 1461 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 1462 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "ICMPv6"); |
| 1463 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 1464 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 1465 | | | |
| 1466 | | | offset = 0; |
| 1467 | | | tvb_memcpy(tvb, (guint8 *)&icmp6_hdr, offset, sizeof icmp6_hdr); |
| 1468 | | | dp = &icmp6_hdr; |
| 1469 | | | codename = typename = colcodename = coltypename = "Unknown"; |
| 1470 | | | len = sizeof(*dp); |
| 1471 | | | switch (dp->icmp6_type) { |
| 1472 | | | case ICMP6_DST_UNREACH: |
| 1473 | | | typename = coltypename = "Unreachable"; |
| 1474 | | | switch (dp->icmp6_code) { |
| 1475 | | | case ICMP6_DST_UNREACH_NOROUTE: |
| 1476 | | | codename = colcodename = "Route unreachable"; |
| 1477 | | | break; |
| 1478 | | | case ICMP6_DST_UNREACH_ADMIN: |
| 1479 | | | codename = colcodename = "Administratively prohibited"; |
| 1480 | | | break; |
| 1481 | | | case ICMP6_DST_UNREACH_NOTNEIGHBOR: |
| 1482 | | | codename = colcodename = "Not a neighbor"; |
| 1483 | | | break; |
| 1484 | | | case ICMP6_DST_UNREACH_ADDR: |
| 1485 | | | codename = colcodename = "Address unreachable"; |
| 1486 | | | break; |
| 1487 | | | case ICMP6_DST_UNREACH_NOPORT: |
| 1488 | | | codename = colcodename = "Port unreachable"; |
| 1489 | | | break; |
| 1490 | | | } |
| 1491 | | | break; |
| 1492 | | | case ICMP6_PACKET_TOO_BIG: |
| 1493 | | | typename = coltypename = "Too big"; |
| 1494 | | | codename = colcodename = NULL; |
| 1495 | | | break; |
| 1496 | | | case ICMP6_TIME_EXCEEDED: |
| 1497 | | | typename = coltypename = "Time exceeded"; |
| 1498 | | | switch (dp->icmp6_code) { |
| 1499 | | | case ICMP6_TIME_EXCEED_TRANSIT: |
| 1500 | | | codename = colcodename = "In-transit"; |
| 1501 | | | break; |
| 1502 | | | case ICMP6_TIME_EXCEED_REASSEMBLY: |
| 1503 | | | codename = colcodename = "Reassembly"; |
| 1504 | | | break; |
| 1505 | | | } |
| 1506 | | | break; |
| 1507 | | | case ICMP6_PARAM_PROB: |
| 1508 | | | typename = coltypename = "Parameter problem"; |
| 1509 | | | switch (dp->icmp6_code) { |
| 1510 | | | case : |
| 1511 | | | codename = colcodename = ""; |
| 1512 | | | break; |
| 1513 | | | case : |
| 1514 | | | codename = colcodename = "Next "; |
| 1515 | | | break; |
| 1516 | | | case ICMP6_PARAMPROB_OPTION: |
| 1517 | | | codename = colcodename = "Option"; |
| 1518 | | | break; |
| 1519 | | | } |
| 1520 | | | break; |
| 1521 | | | case ICMP6_ECHO_REQUEST: |
| 1522 | | | typename = coltypename = "Echo request"; |
| 1523 | | | codename = colcodename = NULL; |
| 1524 | | | break; |
| 1525 | | | case ICMP6_ECHO_REPLY: |
| 1526 | | | typename = coltypename = "Echo reply"; |
| 1527 | | | codename = colcodename = NULL; |
| 1528 | | | break; |
| 1529 | | | case ICMP6_MEMBERSHIP_QUERY: |
| 1530 | | | typename = coltypename = "Multicast listener query"; |
| 1531 | | | codename = colcodename = NULL; |
| 1532 | | | break; |
| 1533 | | | case ICMP6_MEMBERSHIP_REPORT: |
| 1534 | | | typename = coltypename = "Multicast listener report"; |
| 1535 | | | codename = colcodename = NULL; |
| 1536 | | | break; |
| 1537 | | | case ICMP6_MEMBERSHIP_REDUCTION:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
252 | #define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ |
| |
|
| 1538 | | | typename = coltypename = "Multicast listener done"; |
| 1539 | | | codename = colcodename = NULL; |
| 1540 | | | break; |
| 1541 | | | case ND_ROUTER_SOLICIT: |
| 1542 | | | typename = coltypename = "Router solicitation"; |
| 1543 | | | codename = colcodename = NULL; |
| 1544 | | | len = sizeof(struct nd_router_solicit); |
| 1545 | | | break; |
| 1546 | | | case ND_ROUTER_ADVERT: |
| 1547 | | | typename = coltypename = "Router advertisement"; |
| 1548 | | | codename = colcodename = NULL; |
| 1549 | | | len = sizeof(struct nd_router_advert); |
| 1550 | | | break; |
| 1551 | | | case ND_NEIGHBOR_SOLICIT: |
| 1552 | | | typename = coltypename = "Neighbor solicitation"; |
| 1553 | | | codename = colcodename = NULL; |
| 1554 | | | len = sizeof(struct nd_neighbor_solicit); |
| 1555 | | | break; |
| 1556 | | | case ND_NEIGHBOR_ADVERT: |
| 1557 | | | typename = coltypename = "Neighbor advertisement"; |
| 1558 | | | codename = colcodename = NULL; |
| 1559 | | | len = sizeof(struct nd_neighbor_advert); |
| 1560 | | | break; |
| 1561 | | | case ND_REDIRECT: |
| 1562 | | | typename = coltypename = "Redirect"; |
| 1563 | | | codename = colcodename = NULL; |
| 1564 | | | len = sizeof(struct nd_redirect); |
| 1565 | | | break; |
| 1566 | | | case ICMP6_ROUTER_RENUMBERING: |
| 1567 | | | typename = coltypename = "Router renumbering"; |
| 1568 | | | switch (dp->icmp6_code) { |
| 1569 | | | case ICMP6_ROUTER_RENUMBERING_COMMAND: |
| 1570 | | | codename = colcodename = "Command"; |
| 1571 | | | break; |
| 1572 | | | case ICMP6_ROUTER_RENUMBERING_RESULT: |
| 1573 | | | codename = colcodename = "Result"; |
| 1574 | | | break; |
| 1575 | | | case ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
307 | #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ |
| |
|
| 1576 | | | codename = colcodename = "Sequence number reset"; |
| 1577 | | | break; |
| 1578 | | | } |
| 1579 | | | len = sizeof(struct icmp6_router_renum); |
| 1580 | | | break; |
| 1581 | | | case ICMP6_NI_QUERY: |
| 1582 | | | case ICMP6_NI_REPLY: |
| 1583 | | | ni = (struct icmp6_nodeinfo *)dp; |
| 1584 | | | if (ni->ni_type == ICMP6_NI_QUERY) { |
| 1585 | | | typename = coltypename = "Node information query"; |
| 1586 | | | switch (ni->ni_code) { |
| 1587 | | | case ICMP6_NI_SUBJ_IPV6: |
| 1588 | | | codename = "Query subject = IPv6 addresses"; |
| 1589 | | | break; |
| 1590 | | | case ICMP6_NI_SUBJ_FQDN: |
| 1591 | | | if (tvb_bytes_exist(tvb, offset, sizeof(*ni))) |
| 1592 | | | codename = "Query subject = DNS name"; |
| 1593 | | | else |
| 1594 | | | codename = "Query subject = empty"; |
| 1595 | | | break; |
| 1596 | | | case ICMP6_NI_SUBJ_IPV4: |
| 1597 | | | codename = "Query subject = IPv4 addresses"; |
| 1598 | | | break; |
| 1599 | | | } |
| 1600 | | | } else { |
| 1601 | | | typename = coltypename = "Node information reply"; |
| 1602 | | | switch (ni->ni_code) { |
| 1603 | | | case ICMP6_NI_SUCCESS: |
| 1604 | | | codename = "Successful"; |
| 1605 | | | break; |
| 1606 | | | case ICMP6_NI_REFUSED: |
| 1607 | | | codename = "Refused"; |
| 1608 | | | break; |
| 1609 | | | case ICMP6_NI_UNKNOWN: |
| 1610 | | | codename = "Unknown query type"; |
| 1611 | | | break; |
| 1612 | | | } |
| 1613 | | | } |
| 1614 | | | colcodename = val_to_str(pntohs(&ni->ni_qtype), names_nodeinfo_qtype,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 1615 | | | "Unknown"); |
Ignored Return Value
The return value of val_to_str() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of val_to_str() is checked 98% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt val_to_str() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 1616 | | | len = sizeof(struct icmp6_nodeinfo); |
| 1617 | | | break; |
| 1618 | | | case ICMP6_MIP6_DHAAD_REQUEST: |
| 1619 | | | typename = coltypename = "Dynamic Home Agent Address Discovery Request"; |
| 1620 | | | codename = "Should always be zero"; |
| 1621 | | | colcodename = NULL; |
| 1622 | | | break; |
| 1623 | | | case ICMP6_MIP6_DHAAD_REPLY: |
| 1624 | | | typename = coltypename = "Dynamic Home Agent Address Discovery Reply"; |
| 1625 | | | codename = "Should always be zero"; |
| 1626 | | | colcodename = NULL; |
| 1627 | | | break; |
| 1628 | | | case ICMP6_MIP6_MPS: |
| 1629 | | | typename = coltypename = "Mobile Prefix Solicitation"; |
| 1630 | | | codename = "Should always be zero"; |
| 1631 | | | colcodename = NULL; |
| 1632 | | | break; |
| 1633 | | | case ICMP6_MIP6_MPA: |
| 1634 | | | typename = coltypename = "Mobile Prefix Advertisement"; |
| 1635 | | | codename = "Should always be zero"; |
| 1636 | | | colcodename = NULL; |
| 1637 | | | break; |
| 1638 | | | case ICMP6_CERT_PATH_SOL:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
277 | #define ICMP6_CERT_PATH_SOL 148 /* Certification Path Solicitation Message [RFC3971] */ |
| |
|
| 1639 | | | typename = coltypename = "Certification Path Solicitation"; |
| 1640 | | | codename = "Should always be zero"; |
| 1641 | | | colcodename = NULL; |
| 1642 | | | break; |
| 1643 | | | case ICMP6_CERT_PATH_AD:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
278 | #define ICMP6_CERT_PATH_AD 149 /* Certification Path Advertisement Message [RFC3971] */ |
| |
|
| 1644 | | | typename = coltypename = "Certification Path Advertisement"; |
| 1645 | | | codename = "Should always be zero"; |
| 1646 | | | colcodename = NULL; |
| 1647 | | | break; |
| 1648 | | | case ICMP6_MLDV2_REPORT:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
271 | #define ICMP6_MLDV2_REPORT 143 /* MLD v2 report message : draft-vida-mld-v2-08.txt */ |
| |
|
| 1649 | | | typename = coltypename = "Multicast Listener Report Message v2"; |
| 1650 | | | codename = "Should always be zero"; |
| 1651 | | | colcodename = NULL; |
| 1652 | | | break; |
| 1653 | | | case ICMP6_EXPERIMENTAL_MOBILITY:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
628 | #define ICMP6_EXPERIMENTAL_MOBILITY 150 /* ICMP Experimental Mobility Protocol Type */ |
| |
|
| 1654 | | | typename = coltypename ="Experimental Mobility"; |
| 1655 | | | switch (dp->icmp6_data8[0]) { |
| 1656 | | | case FMIP6_SUBTYPE_RTSOLPR:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
630 | #define FMIP6_SUBTYPE_RTSOLPR 2 /* Router Solicitation for Proxy Advertisement */ |
| |
|
| 1657 | | | typename = coltypename ="RtSolPr (ICMPv6 Experimental Mobility)"; |
| 1658 | | | codename = "Should always be zero"; |
| 1659 | | | colcodename = NULL; |
| 1660 | | | break; |
| 1661 | | | case FMIP6_SUBTYPE_PRRTADV: |
| 1662 | | | typename = coltypename ="PrRtAdv (ICMPv6 Experimental Mobility)"; |
| 1663 | | | codename = val_to_str(dp->icmp6_code, names_fmip6_prrtadv_code, "Unknown"); |
| 1664 | | | colcodename = NULL; |
| 1665 | | | break; |
| 1666 | | | case FMIP6_SUBTYPE_HI: |
| 1667 | | | typename = coltypename ="HI (ICMPv6 Experimental Mobility)"; |
| 1668 | | | codename = val_to_str(dp->icmp6_code, names_fmip6_hi_code, "Unknown"); |
| 1669 | | | colcodename = NULL; |
| 1670 | | | break; |
| 1671 | | | case FMIP6_SUBTYPE_HACK: |
| 1672 | | | typename = coltypename ="HAck (ICMPv6 Experimental Mobility)"; |
| 1673 | | | codename = val_to_str(dp->icmp6_code, names_fmip6_hack_code, "Unknown"); |
| 1674 | | | colcodename = NULL; |
| 1675 | | | break; |
| 1676 | | | } |
| 1677 | | | break; |
| 1678 | | | } |
| 1679 | | | |
| 1680 | | | if (check_col(pinfo->cinfo, COL_INFO)) { |
Event 2:
Skipping " if". check_col(...) evaluates to false.
hide
|
|
| 1681 | | | char typebuf[256], codebuf[256]; |
| 1682 | | | |
| 1683 | | | if (coltypename && strcmp(coltypename, "Unknown") == 0) { |
| 1684 | | | g_snprintf(typebuf, sizeof(typebuf), "Unknown (0x%02x)", |
| 1685 | | | dp->icmp6_type); |
| 1686 | | | coltypename = typebuf; |
| 1687 | | | } |
| 1688 | | | if (colcodename && strcmp(colcodename, "Unknown") == 0) { |
| 1689 | | | g_snprintf(codebuf, sizeof(codebuf), "Unknown (0x%02x)", |
| 1690 | | | dp->icmp6_code); |
| 1691 | | | colcodename = codebuf; |
| 1692 | | | } |
| 1693 | | | if (colcodename) { |
| 1694 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)", coltypename, colcodename); |
| 1695 | | | } else { |
| 1696 | | | col_add_str(pinfo->cinfo, COL_INFO, coltypename); |
| 1697 | | | } |
| 1698 | | | } |
| 1699 | | | |
| 1700 | | | if (tree) { |
Event 3:
Taking true branch. tree evaluates to true.
hide
|
|
| 1701 | | | |
| 1702 | | | ti = proto_tree_add_item(tree, proto_icmpv6, tvb, offset, -1, FALSE); |
| 1703 | | | icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6); |
| 1704 | | | |
| 1705 | | | proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_type, tvb, |
| 1706 | | | offset + offsetof(struct icmp6_hdr, icmp6_type), 1,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1707 | | | dp->icmp6_type, |
| 1708 | | | "Type: %u (%s)", dp->icmp6_type, typename); |
| 1709 | | | if (codename) { |
Event 4:
Taking true branch. codename evaluates to true.
hide
|
|
| 1710 | | | proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_code, tvb, |
| 1711 | | | offset + offsetof(struct icmp6_hdr, icmp6_code), 1,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1712 | | | dp->icmp6_code, |
| 1713 | | | "Code: %u (%s)", dp->icmp6_code, codename); |
| 1714 | | | } else { |
| 1715 | | | proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_code, tvb, |
| 1716 | | | offset + offsetof(struct icmp6_hdr, icmp6_code), 1,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1717 | | | dp->icmp6_code, |
| 1718 | | | "Code: %u", dp->icmp6_code); |
| 1719 | | | } |
| 1720 | | | cksum = (guint16)g_htons(dp->icmp6_cksum);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
350 | #define g_htons(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
Event 5:
Taking false branch. 0 evaluates to false.
hide
|
|
| 1721 | | | length = tvb_length(tvb); |
| 1722 | | | reported_length = tvb_reported_length(tvb); |
| 1723 | | | if (!pinfo->fragmented && length >= reported_length) { |
| 1724 | | | |
| 1725 | | | |
| 1726 | | | |
| 1727 | | | |
| 1728 | | | cksum_vec[0].ptr = pinfo->src.data; |
| 1729 | | | cksum_vec[0].len = pinfo->src.len; |
| 1730 | | | cksum_vec[1].ptr = pinfo->dst.data; |
| 1731 | | | cksum_vec[1].len = pinfo->dst.len; |
| 1732 | | | cksum_vec[2].ptr = (const guint8 *)&phdr; |
| 1733 | | | phdr[0] = g_htonl(tvb_reported_length(tvb));
x /usr/include/glib-2.0/glib/gtypes.h |
| |
349 | #define g_htonl(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
Event 7:
Taking false branch. 0 evaluates to false.
hide
|
|
| 1734 | | | phdr[1] = g_htonl(IP_PROTO_ICMPV6);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
349 | #define g_htonl(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
Event 8:
Taking false branch. 0 evaluates to false.
hide
|
|
| 1735 | | | cksum_vec[2].len = 8; |
| 1736 | | | cksum_vec[3].len = tvb_reported_length(tvb); |
| 1737 | | | cksum_vec[3].ptr = tvb_get_ptr(tvb, offset, cksum_vec[3].len); |
| 1738 | | | computed_cksum = in_cksum(cksum_vec, 4); |
| 1739 | | | if (computed_cksum == 0) { |
Event 9:
Taking false branch. computed_cksum == 0 evaluates to false.
hide
|
|
| 1740 | | | proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_checksum, |
| 1741 | | | tvb, |
| 1742 | | | offset + offsetof(struct icmp6_hdr, icmp6_cksum), 2,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1743 | | | cksum, |
| 1744 | | | "Checksum: 0x%04x [correct]", cksum); |
| 1745 | | | } else { |
| 1746 | | | hidden_item = proto_tree_add_boolean(icmp6_tree, hf_icmpv6_checksum_bad, |
| 1747 | | | tvb, |
| 1748 | | | offset + offsetof(struct icmp6_hdr, icmp6_cksum), 2,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1749 | | | TRUE); |
Event 10:
!0 evaluates to true.
hide
|
|
| 1750 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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 11:
hidden_item evaluates to true.
hide
|
|
| 1751 | | | proto_tree_add_uint_format(icmp6_tree, hf_icmpv6_checksum, |
| 1752 | | | tvb, |
| 1753 | | | offset + offsetof(struct icmp6_hdr, icmp6_cksum), 2,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1754 | | | cksum, |
| 1755 | | | "Checksum: 0x%04x [incorrect, should be 0x%04x]", |
| 1756 | | | cksum, in_cksum_shouldbe(cksum, computed_cksum)); |
| 1757 | | | } |
| 1758 | | | } else { |
| 1759 | | | proto_tree_add_uint(icmp6_tree, hf_icmpv6_checksum, tvb, |
| 1760 | | | offset + offsetof(struct icmp6_hdr, icmp6_cksum), 2,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1761 | | | cksum); |
| 1762 | | | } |
| 1763 | | | |
| 1764 | | | #define ICMP6_DATA_OFFSET 4 |
| 1765 | | | #define ICMP6_SEQ_OFFSET 4 |
| 1766 | | | |
| 1767 | | | switch (dp->icmp6_type) { |
Event 12:
dp->icmp6_type evaluates to 140.
hide
|
|
| 1768 | | | case ICMP6_DST_UNREACH: |
| 1769 | | | case ICMP6_TIME_EXCEEDED: |
| 1770 | | | dissect_contained_icmpv6(tvb, offset + sizeof(*dp), pinfo, |
| 1771 | | | icmp6_tree); |
| 1772 | | | break; |
| 1773 | | | case ICMP6_PACKET_TOO_BIG: |
| 1774 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1775 | | | offset + ICMP6_DATA_OFFSET, 4, |
| 1776 | | | "MTU: %u", pntohl(&dp->icmp6_mtu));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
45 | #define pntohl(p) ((guint32)*((const guint8 *)(p)+0)<<24| \ |
46 | (guint32)*((const guint8 *)(p)+1)<<16| \ |
47 | (guint32)*((const guint8 *)(p)+2)<<8| \ |
48 | (guint32)*((const guint8 *)(p)+3)<<0) |
| |
|
| 1777 | | | dissect_contained_icmpv6(tvb, offset + sizeof(*dp), pinfo, |
| 1778 | | | icmp6_tree); |
| 1779 | | | break; |
| 1780 | | | case ICMP6_PARAM_PROB: |
| 1781 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1782 | | | offset + ICMP6_DATA_OFFSET, 4, |
| 1783 | | | "Problem pointer: 0x%04x", pntohl(&dp->icmp6_pptr));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
45 | #define pntohl(p) ((guint32)*((const guint8 *)(p)+0)<<24| \ |
46 | (guint32)*((const guint8 *)(p)+1)<<16| \ |
47 | (guint32)*((const guint8 *)(p)+2)<<8| \ |
48 | (guint32)*((const guint8 *)(p)+3)<<0) |
| |
|
| 1784 | | | dissect_contained_icmpv6(tvb, offset + sizeof(*dp), pinfo, |
| 1785 | | | icmp6_tree); |
| 1786 | | | break; |
| 1787 | | | case ICMP6_ECHO_REQUEST: |
| 1788 | | | case ICMP6_ECHO_REPLY: |
| 1789 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1790 | | | offset + ICMP6_DATA_OFFSET, 2, |
| 1791 | | | "ID: 0x%04x", (guint16)g_ntohs(dp->icmp6_id));
x /usr/include/glib-2.0/glib/gtypes.h |
| |
348 | #define g_ntohs(val) (GUINT16_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
318 | #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
| 1792 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1793 | | | offset + ICMP6_SEQ_OFFSET, 2, |
| 1794 | | | "Sequence: 0x%04x", (guint16)g_ntohs(dp->icmp6_seq));
x /usr/include/glib-2.0/glib/gtypes.h |
| |
348 | #define g_ntohs(val) (GUINT16_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
318 | #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
| 1795 | | | next_tvb = tvb_new_subset(tvb, offset + sizeof(*dp), -1, -1); |
| 1796 | | | call_dissector(data_handle,next_tvb, pinfo, icmp6_tree); |
| 1797 | | | break; |
| 1798 | | | case ICMP6_MEMBERSHIP_QUERY: |
| 1799 | | | case ICMP6_MEMBERSHIP_REPORT: |
| 1800 | | | case ICMP6_MEMBERSHIP_REDUCTION:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
252 | #define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ |
| |
|
| 1801 | | | #define MLDV2_MINLEN 28 |
| 1802 | | | #define MLDV1_MINLEN 24 |
| 1803 | | | if (dp->icmp6_type == ICMP6_MEMBERSHIP_QUERY) { |
| 1804 | | | if (length >= MLDV2_MINLEN) { |
| 1805 | | | guint32 mrc; |
| 1806 | | | guint16 qqi; |
| 1807 | | | guint8 flag; |
| 1808 | | | guint16 nsrcs; |
| 1809 | | | |
| 1810 | | | mrc = g_ntohs(dp->icmp6_maxdelay);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
348 | #define g_ntohs(val) (GUINT16_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
318 | #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
| 1811 | | | flag = tvb_get_guint8(tvb, offset + sizeof(*dp) + 16); |
| 1812 | | | qqi = tvb_get_guint8(tvb, offset + sizeof(*dp) + 16 + 1); |
| 1813 | | | nsrcs = tvb_get_ntohs(tvb, offset + sizeof(*dp) + 16 + 2); |
| 1814 | | | |
| 1815 | | | if (mrc >= 32768) |
| 1816 | | | mrc = ((mrc & 0x0fff) | 0x1000) << |
| 1817 | | | (((mrc & 0x7000) >> 12) + 3); |
| 1818 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1819 | | | offset + ICMP6_DATA_OFFSET, 2, |
| 1820 | | | "Maximum response delay[ms]: %u", mrc); |
| 1821 | | | |
| 1822 | | | proto_tree_add_text(icmp6_tree, tvb, offset + sizeof(*dp), |
| 1823 | | | 16, "Multicast Address: %s", |
| 1824 | | | ip6_to_str((const struct e_in6_addr *)(tvb_get_ptr(tvb, |
| 1825 | | | offset + sizeof *dp, sizeof (struct e_in6_addr))))); |
| 1826 | | | |
| 1827 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1828 | | | offset + sizeof(*dp) + 16, 1, "S Flag: %s", |
| 1829 | | | flag & 0x08 ? "ON" : "OFF"); |
| 1830 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1831 | | | offset + sizeof(*dp) + 16, 1, "Robustness: %d", |
| 1832 | | | flag & 0x07); |
| 1833 | | | if (qqi >= 128) |
| 1834 | | | qqi = ((qqi & 0x0f) | 0x10) << (((qqi & 0x70) >> 4) + 3); |
| 1835 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1836 | | | offset + sizeof(*dp) + 17, 1, "QQI: %d", qqi); |
| 1837 | | | |
| 1838 | | | dissect_mldqv2(tvb, offset + sizeof(*dp) + 20, nsrcs, |
| 1839 | | | icmp6_tree); |
| 1840 | | | break; |
| 1841 | | | } else if (length > MLDV1_MINLEN) { |
| 1842 | | | next_tvb = tvb_new_subset(tvb, offset + sizeof(*dp), -1, -1); |
| 1843 | | | call_dissector(data_handle,next_tvb, pinfo, tree); |
| 1844 | | | break; |
| 1845 | | | } |
| 1846 | | | |
| 1847 | | | } |
| 1848 | | | #undef MLDV2_MINLEN |
| 1849 | | | #undef MLDV1_MINLEN |
| 1850 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1851 | | | offset + ICMP6_DATA_OFFSET, 2, |
| 1852 | | | "Maximum response delay: %u", |
| 1853 | | | (guint16)g_ntohs(dp->icmp6_maxdelay));
x /usr/include/glib-2.0/glib/gtypes.h |
| |
348 | #define g_ntohs(val) (GUINT16_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
318 | #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
| 1854 | | | proto_tree_add_text(icmp6_tree, tvb, offset + sizeof(*dp), 16, |
| 1855 | | | "Multicast Address: %s", |
| 1856 | | | ip6_to_str((const struct e_in6_addr *)(tvb_get_ptr(tvb, offset + sizeof *dp, sizeof (struct e_in6_addr))))); |
| 1857 | | | break; |
| 1858 | | | case ND_ROUTER_SOLICIT: |
| 1859 | | | dissect_icmpv6ndopt(tvb, offset + sizeof(*dp), pinfo, icmp6_tree); |
| 1860 | | | break; |
| 1861 | | | case ICMP6_MLDV2_REPORT: {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
271 | #define ICMP6_MLDV2_REPORT 143 /* MLD v2 report message : draft-vida-mld-v2-08.txt */ |
| |
|
| 1862 | | | guint16 nbRecords; |
| 1863 | | | |
| 1864 | | | nbRecords = tvb_get_ntohs( tvb, offset+4+2 ); |
| 1865 | | | dissect_mldrv2( tvb, offset+4+2+2, nbRecords, icmp6_tree ); |
| 1866 | | | break; |
| 1867 | | | } |
| 1868 | | | #define ND_RA_CURHOPLIMIT_OFFSET 4 |
| 1869 | | | #define ND_RA_FLAGS_RESERVED_OFFSET 4 |
| 1870 | | | #define ND_RA_ROUTER_LIFETIME_OFFSET 5 |
| 1871 | | | case ND_ROUTER_ADVERT: |
| 1872 | | | { |
| 1873 | | | struct nd_router_advert nd_router_advert, *ra; |
| 1874 | | | int flagoff; |
| 1875 | | | guint32 ra_flags; |
| 1876 | | | |
| 1877 | | | ra = &nd_router_advert; |
| 1878 | | | tvb_memcpy(tvb, (guint8 *)ra, offset, sizeof *ra); |
| 1879 | | | |
| 1880 | | | |
| 1881 | | | proto_tree_add_uint(icmp6_tree, hf_icmpv6_ra_cur_hop_limit, tvb, |
| 1882 | | | offset + ND_RA_CURHOPLIMIT_OFFSET, |
| 1883 | | | 1, ra->nd_ra_curhoplimit); |
| 1884 | | | |
| 1885 | | | |
| 1886 | | | flagoff = offset + ND_RA_FLAGS_RESERVED_OFFSET; |
| 1887 | | | ra_flags = tvb_get_guint8(tvb, flagoff); |
| 1888 | | | tf = proto_tree_add_text(icmp6_tree, tvb, flagoff, 1, "Flags: 0x%02x", ra_flags); |
| 1889 | | | field_tree = proto_item_add_subtree(tf, ett_icmpv6flag); |
| 1890 | | | |
| 1891 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 1892 | | | decode_boolean_bitfield(ra_flags, |
| 1893 | | | ND_RA_FLAG_MANAGED, 8, "Managed", "Not managed")); |
| 1894 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 1895 | | | decode_boolean_bitfield(ra_flags, |
| 1896 | | | ND_RA_FLAG_OTHER, 8, "Other", "Not other")); |
| 1897 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 1898 | | | decode_boolean_bitfield(ra_flags, |
| 1899 | | | ND_RA_FLAG_HOME_AGENT, 8, |
| 1900 | | | "Home Agent", "Not Home Agent")); |
| 1901 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 1902 | | | decode_enumerated_bitfield(ra_flags, ND_RA_FLAG_RTPREF_MASK, 8, |
| 1903 | | | names_router_pref, "Router preference: %s")); |
| 1904 | | | |
| 1905 | | | |
| 1906 | | | proto_tree_add_uint(icmp6_tree, hf_icmpv6_ra_router_lifetime, tvb, |
| 1907 | | | offset + ND_RA_ROUTER_LIFETIME_OFFSET, |
| 1908 | | | 2, (guint16)g_ntohs(ra->nd_ra_router_lifetime));
x /usr/include/glib-2.0/glib/gtypes.h |
| |
348 | #define g_ntohs(val) (GUINT16_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
318 | #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
192 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
228 | # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
175 | # define GUINT16_SWAP_LE_BE_IA32(val) \ |
176 | (__extension__ \ |
177 | ({ register guint16 __v, __x = ((guint16) (val)); \ |
178 | if (__builtin_constant_p (__x)) \ |
179 | __v = GUINT16_SWAP_LE_BE_CONSTANT (__x); \ |
180 | else \ |
181 | __asm__ ("rorw $8, %w0" \ |
182 | : "=r" (__v) \ |
183 | : "0" (__x) \ |
184 | : "cc"); \ |
185 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
143 | #define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \ |
144 | (guint16) ((guint16) (val) >> 8) | \ |
145 | (guint16) ((guint16) (val) << 8))) |
| |
|
| 1909 | | | |
| 1910 | | | |
| 1911 | | | proto_tree_add_uint(icmp6_tree, hf_icmpv6_ra_reachable_time, tvb, |
| 1912 | | | offset + offsetof(struct nd_router_advert, nd_ra_reachable), 4,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1913 | | | pntohl(&ra->nd_ra_reachable));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
45 | #define pntohl(p) ((guint32)*((const guint8 *)(p)+0)<<24| \ |
46 | (guint32)*((const guint8 *)(p)+1)<<16| \ |
47 | (guint32)*((const guint8 *)(p)+2)<<8| \ |
48 | (guint32)*((const guint8 *)(p)+3)<<0) |
| |
|
| 1914 | | | |
| 1915 | | | |
| 1916 | | | proto_tree_add_uint(icmp6_tree, hf_icmpv6_ra_retrans_timer, tvb, |
| 1917 | | | offset + offsetof(struct nd_router_advert, nd_ra_retransmit), 4,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1918 | | | pntohl(&ra->nd_ra_retransmit));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
45 | #define pntohl(p) ((guint32)*((const guint8 *)(p)+0)<<24| \ |
46 | (guint32)*((const guint8 *)(p)+1)<<16| \ |
47 | (guint32)*((const guint8 *)(p)+2)<<8| \ |
48 | (guint32)*((const guint8 *)(p)+3)<<0) |
| |
|
| 1919 | | | |
| 1920 | | | dissect_icmpv6ndopt(tvb, offset + sizeof(struct nd_router_advert), pinfo, icmp6_tree); |
| 1921 | | | break; |
| 1922 | | | } |
| 1923 | | | case ND_NEIGHBOR_SOLICIT: |
| 1924 | | | { |
| 1925 | | | struct nd_neighbor_solicit nd_neighbor_solicit, *ns; |
| 1926 | | | |
| 1927 | | | ns = &nd_neighbor_solicit; |
| 1928 | | | tvb_memcpy(tvb, (guint8 *)ns, offset, sizeof *ns); |
| 1929 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1930 | | | offset + offsetof(struct nd_neighbor_solicit, nd_ns_target), 16,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1931 | | | #ifdef INET6 |
| 1932 | | | "Target: %s (%s)", |
| 1933 | | | get_hostname6(&ns->nd_ns_target), |
| 1934 | | | #else |
| 1935 | | | "Target: %s", |
| 1936 | | | #endif |
| 1937 | | | ip6_to_str(&ns->nd_ns_target)); |
| 1938 | | | |
| 1939 | | | dissect_icmpv6ndopt(tvb, offset + sizeof(*ns), pinfo, icmp6_tree); |
| 1940 | | | break; |
| 1941 | | | } |
| 1942 | | | #define ND_NA_FLAGS_RESERVED_OFFSET 4 |
| 1943 | | | case ND_NEIGHBOR_ADVERT: |
| 1944 | | | { |
| 1945 | | | int flagoff, targetoff; |
| 1946 | | | guint32 na_flags; |
| 1947 | | | struct e_in6_addr na_target; |
| 1948 | | | |
| 1949 | | | flagoff = offset + ND_NA_FLAGS_RESERVED_OFFSET; |
| 1950 | | | na_flags = tvb_get_ntohl(tvb, flagoff); |
| 1951 | | | |
| 1952 | | | tf = proto_tree_add_text(icmp6_tree, tvb, flagoff, 4, "Flags: 0x%08x", na_flags); |
| 1953 | | | field_tree = proto_item_add_subtree(tf, ett_icmpv6flag); |
| 1954 | | | proto_tree_add_text(field_tree, tvb, flagoff, 4, "%s", |
| 1955 | | | decode_boolean_bitfield(na_flags, |
| 1956 | | | ND_NA_FLAG_ROUTER, 32, "Router", "Not router")); |
| 1957 | | | proto_tree_add_text(field_tree, tvb, flagoff, 4, "%s", |
| 1958 | | | decode_boolean_bitfield(na_flags, |
| 1959 | | | ND_NA_FLAG_SOLICITED, 32, "Solicited", "Not adverted")); |
| 1960 | | | proto_tree_add_text(field_tree, tvb, flagoff, 4, "%s", |
| 1961 | | | decode_boolean_bitfield(na_flags, |
| 1962 | | | ND_NA_FLAG_OVERRIDE, 32, "Override", "Not override")); |
| 1963 | | | |
| 1964 | | | targetoff = offset + offsetof(struct nd_neighbor_advert, nd_na_target);
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1965 | | | tvb_memcpy(tvb, (guint8 *)&na_target, targetoff, sizeof na_target); |
| 1966 | | | proto_tree_add_text(icmp6_tree, tvb, targetoff, 16, |
| 1967 | | | #ifdef INET6 |
| 1968 | | | "Target: %s (%s)", |
| 1969 | | | get_hostname6(&na_target), |
| 1970 | | | #else |
| 1971 | | | "Target: %s", |
| 1972 | | | #endif |
| 1973 | | | ip6_to_str(&na_target)); |
| 1974 | | | |
| 1975 | | | dissect_icmpv6ndopt(tvb, offset + sizeof(struct nd_neighbor_advert), pinfo, icmp6_tree); |
| 1976 | | | break; |
| 1977 | | | } |
| 1978 | | | case ND_REDIRECT: |
| 1979 | | | { |
| 1980 | | | struct nd_redirect nd_redirect, *rd; |
| 1981 | | | |
| 1982 | | | rd = &nd_redirect; |
| 1983 | | | tvb_memcpy(tvb, (guint8 *)rd, offset, sizeof *rd); |
| 1984 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1985 | | | offset + offsetof(struct nd_redirect, nd_rd_target), 16,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1986 | | | #ifdef INET6 |
| 1987 | | | "Target: %s (%s)", |
| 1988 | | | get_hostname6(&rd->nd_rd_target), |
| 1989 | | | #else |
| 1990 | | | "Target: %s", |
| 1991 | | | #endif |
| 1992 | | | ip6_to_str(&rd->nd_rd_target)); |
| 1993 | | | |
| 1994 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 1995 | | | offset + offsetof(struct nd_redirect, nd_rd_dst), 16,
x /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h |
| |
411 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) |
| |
|
| 1996 | | | #ifdef INET6 |
| 1997 | | | "Destination: %s (%s)", |
| 1998 | | | get_hostname6(&rd->nd_rd_dst), |
| 1999 | | | #else |
| 2000 | | | "Destination: %s", |
| 2001 | | | #endif |
| 2002 | | | ip6_to_str(&rd->nd_rd_dst)); |
| 2003 | | | |
| 2004 | | | dissect_icmpv6ndopt(tvb, offset + sizeof(*rd), pinfo, icmp6_tree); |
| 2005 | | | break; |
| 2006 | | | } |
| 2007 | | | case ICMP6_ROUTER_RENUMBERING: |
| 2008 | | | dissect_rrenum(tvb, offset, pinfo, icmp6_tree); |
| 2009 | | | break; |
| 2010 | | | #define NI_QTYPE_OFFSET 4 |
| 2011 | | | case ICMP6_NI_QUERY: |
| 2012 | | | case ICMP6_NI_REPLY: |
| 2013 | | | ni = (struct icmp6_nodeinfo *)dp; |
| 2014 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2015 | | | offset + NI_QTYPE_OFFSET, |
| 2016 | | | sizeof(ni->ni_qtype), |
| 2017 | | | "Query type: 0x%04x (%s)", pntohs(&ni->ni_qtype),
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2018 | | | val_to_str(pntohs(&ni->ni_qtype), names_nodeinfo_qtype,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2019 | | | "Unknown")); |
| 2020 | | | dissect_nodeinfo(tvb, offset, pinfo, icmp6_tree); |
| 2021 | | | break; |
| 2022 | | | case ICMP6_MIP6_DHAAD_REQUEST: |
| 2023 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2024 | | | offset + 4, 2, "Identifier: %d (0x%02x)", |
| 2025 | | | tvb_get_ntohs(tvb, offset + 4), |
| 2026 | | | tvb_get_ntohs(tvb, offset + 4)); |
| 2027 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2028 | | | offset + 6, 2, "Reserved: %d", |
| 2029 | | | tvb_get_ntohs(tvb, offset + 6)); |
| 2030 | | | break; |
| 2031 | | | case ICMP6_MIP6_DHAAD_REPLY: |
| 2032 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2033 | | | offset + 4, 2, "Identifier: %d (0x%02x)", |
| 2034 | | | tvb_get_ntohs(tvb, offset + 4), |
| 2035 | | | tvb_get_ntohs(tvb, offset + 4)); |
| 2036 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2037 | | | offset + 6, 2, "Reserved: %d", |
| 2038 | | | tvb_get_ntohs(tvb, offset + 6)); |
| 2039 | | | |
| 2040 | | | { |
| 2041 | | | int i, suboffset; |
| 2042 | | | int ha_num = (length - 8)/16; |
| 2043 | | | |
| 2044 | | | for (i = 0; i < ha_num; i++) { |
| 2045 | | | suboffset = 16 * i; |
| 2046 | | | proto_tree_add_ipv6(icmp6_tree, hf_icmpv6_haad_ha_addrs, |
| 2047 | | | tvb, offset + 8 + suboffset, 16, |
| 2048 | | | tvb_get_ptr(tvb, offset + 8 + suboffset, 16)); |
| 2049 | | | } |
| 2050 | | | } |
| 2051 | | | break; |
| 2052 | | | case ICMP6_MIP6_MPS: |
| 2053 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2054 | | | offset + 4, 2, "Identifier: %d (0x%02x)", |
| 2055 | | | tvb_get_ntohs(tvb, offset + 4), |
| 2056 | | | tvb_get_ntohs(tvb, offset + 4)); |
| 2057 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2058 | | | offset + 6, 2, "Reserved: %d", |
| 2059 | | | tvb_get_ntohs(tvb, offset + 6)); |
| 2060 | | | break; |
| 2061 | | | case ICMP6_MIP6_MPA: |
| 2062 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2063 | | | offset + 4, 2, "Identifier: %d (0x%02x)", |
| 2064 | | | tvb_get_ntohs(tvb, offset + 4), |
| 2065 | | | tvb_get_ntohs(tvb, offset + 4)); |
| 2066 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2067 | | | offset + 6, 1, "%s", |
| 2068 | | | decode_boolean_bitfield(tvb_get_guint8(tvb, offset + 6), |
| 2069 | | | 0x80, 8, |
| 2070 | | | "Managed Address Configuration", |
| 2071 | | | "No Managed Address Configuration")); |
| 2072 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2073 | | | offset + 6, 1, "%s", |
| 2074 | | | decode_boolean_bitfield(tvb_get_guint8(tvb, offset + 6), |
| 2075 | | | 0x40, 8, |
| 2076 | | | "Other Stateful Configuration", |
| 2077 | | | "No Other Stateful Configuration")); |
| 2078 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2079 | | | offset + 7, 1, "Reserved: %d", |
| 2080 | | | tvb_get_guint8(tvb, offset + 7)); |
| 2081 | | | |
| 2082 | | | dissect_icmpv6ndopt(tvb, offset + 8, pinfo, icmp6_tree); |
| 2083 | | | break; |
| 2084 | | | case ICMP6_EXPERIMENTAL_MOBILITY:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
628 | #define ICMP6_EXPERIMENTAL_MOBILITY 150 /* ICMP Experimental Mobility Protocol Type */ |
| |
|
| 2085 | | | switch (dp->icmp6_data8[0]) { |
| 2086 | | | case FMIP6_SUBTYPE_RTSOLPR:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
630 | #define FMIP6_SUBTYPE_RTSOLPR 2 /* Router Solicitation for Proxy Advertisement */ |
| |
|
| 2087 | | | { |
| 2088 | | | struct fmip6_rtsolpr *rtsolpr; |
| 2089 | | | rtsolpr = (struct fmip6_rtsolpr*) dp; |
| 2090 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2091 | | | offset + 4, 1, |
| 2092 | | | "Subtype: Router Solicitation for Proxy Advertisement"); |
| 2093 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2094 | | | offset + 6, 2, |
| 2095 | | | "Identifier: %d", pntohs(&rtsolpr->fmip6_rtsolpr_id));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2096 | | | dissect_icmpv6fmip6opt(tvb, offset + sizeof(*dp), icmp6_tree); |
| 2097 | | | break; |
| 2098 | | | } |
| 2099 | | | case FMIP6_SUBTYPE_PRRTADV: |
| 2100 | | | { |
| 2101 | | | struct fmip6_prrtadv *prrtadv; |
| 2102 | | | prrtadv = (struct fmip6_prrtadv*) dp; |
| 2103 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2104 | | | offset + 4, 1, |
| 2105 | | | "Subtype: Proxy Router Advertisement"); |
| 2106 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2107 | | | offset + 6, 2, |
| 2108 | | | "Identifier: %d", pntohs(&prrtadv->fmip6_prrtadv_id));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2109 | | | dissect_icmpv6fmip6opt(tvb, offset + sizeof(*dp), icmp6_tree); |
| 2110 | | | break; |
| 2111 | | | } |
| 2112 | | | case FMIP6_SUBTYPE_HI: |
| 2113 | | | { |
| 2114 | | | struct fmip6_hi *hi; |
| 2115 | | | int flagoff; |
| 2116 | | | guint8 hi_flags; |
| 2117 | | | hi = (struct fmip6_hi*) dp; |
| 2118 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2119 | | | offset + 4, 1, |
| 2120 | | | "Subtype: Handover Initiate"); |
| 2121 | | | |
| 2122 | | | flagoff = offset + 5; |
| 2123 | | | hi_flags = tvb_get_guint8(tvb, flagoff); |
| 2124 | | | tf = proto_tree_add_text(icmp6_tree, tvb, flagoff, 1, "Flags: 0x%02x", hi_flags); |
| 2125 | | | field_tree = proto_item_add_subtree(tf, ett_icmpv6flag); |
| 2126 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 2127 | | | decode_boolean_bitfield(hi_flags, |
| 2128 | | | FMIP_HI_FLAG_ASSIGNED, 8, "Assigned", "Not assigned")); |
| 2129 | | | proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", |
| 2130 | | | decode_boolean_bitfield(hi_flags, |
| 2131 | | | FMIP_HI_FLAG_BUFFER, 8, "Buffered", "Not buffered")); |
| 2132 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2133 | | | offset + 6, 2, |
| 2134 | | | "Identifier: %d", pntohs(&hi->fmip6_hi_id));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2135 | | | dissect_icmpv6fmip6opt(tvb, offset + sizeof(*dp), icmp6_tree); |
| 2136 | | | break; |
| 2137 | | | } |
| 2138 | | | case FMIP6_SUBTYPE_HACK: |
| 2139 | | | { |
| 2140 | | | struct fmip6_hack *hack; |
| 2141 | | | hack = (struct fmip6_hack*) dp; |
| 2142 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2143 | | | offset + 4, 1, |
| 2144 | | | "Subtype: Handover Acknowledge"); |
| 2145 | | | proto_tree_add_text(icmp6_tree, tvb, |
| 2146 | | | offset + 6, 2, |
| 2147 | | | "Identifier: %d", pntohs(&hack->fmip6_hack_id));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 2148 | | | dissect_icmpv6fmip6opt(tvb, offset + sizeof(*dp), icmp6_tree); |
| 2149 | | | break; |
| 2150 | | | } |
| 2151 | | | } |
| 2152 | | | break; |
| 2153 | | | case ICMP6_CERT_PATH_SOL:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
277 | #define ICMP6_CERT_PATH_SOL 148 /* Certification Path Solicitation Message [RFC3971] */ |
| |
|
| 2154 | | | |
| 2155 | | | offset += 4; |
| 2156 | | | proto_tree_add_text(icmp6_tree, tvb, offset, -1, |
| 2157 | | | "Certification Path Solicitation Message"); |
| 2158 | | | |
| 2159 | | | proto_tree_add_item(icmp6_tree, hf_icmpv6_identifier, tvb, offset, |
| 2160 | | | 2, FALSE); |
| 2161 | | | offset += 2; |
| 2162 | | | |
| 2163 | | | |
| 2164 | | | |
| 2165 | | | |
| 2166 | | | proto_tree_add_item(icmp6_tree, hf_icmpv6_comp, tvb, offset, 2, |
| 2167 | | | FALSE); |
| 2168 | | | offset += 2; |
| 2169 | | | dissect_icmpv6ndopt(tvb, offset, pinfo, icmp6_tree); |
| 2170 | | | break; |
| 2171 | | | case ICMP6_CERT_PATH_AD:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ipv6.h |
| |
278 | #define ICMP6_CERT_PATH_AD 149 /* Certification Path Advertisement Message [RFC3971] */ |
| |
|
| 2172 | | | |
| 2173 | | | offset = offset +4; |
| 2174 | | | proto_tree_add_text(icmp6_tree, tvb, offset, -1,"Certification Path Advertisement Message"); |
| 2175 | | | |
| 2176 | | | |
| 2177 | | | proto_tree_add_item(icmp6_tree, hf_icmpv6_identifier, tvb, offset, 2, FALSE); |
| 2178 | | | offset = offset + 2; |
| 2179 | | | |
| 2180 | | | proto_tree_add_item(icmp6_tree, hf_icmpv6_all_comp, tvb, offset, 2, FALSE); |
| 2181 | | | offset = offset + 2; |
| 2182 | | | |
| 2183 | | | |
| 2184 | | | |
| 2185 | | | |
| 2186 | | | proto_tree_add_item(icmp6_tree, hf_icmpv6_comp, tvb, offset, 2, FALSE); |
| 2187 | | | offset = offset + 2; |
| 2188 | | | |
| 2189 | | | |
| 2190 | | | proto_tree_add_text(icmp6_tree, tvb, offset, 2,"Reserved"); |
| 2191 | | | offset = offset + 2; |
| 2192 | | | |
| 2193 | | | dissect_icmpv6ndopt(tvb, offset, pinfo, icmp6_tree); |
| 2194 | | | break; |
| 2195 | | | default: |
| 2196 | | | next_tvb = tvb_new_subset(tvb, offset + sizeof(*dp), -1, -1); |
| 2197 | | | call_dissector(data_handle,next_tvb, pinfo, tree); |
| 2198 | | | break; |
| 2199 | | | } |
| 2200 | | | } |
| 2201 | | | } |
| |