Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at ngsniffer.c:1861

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

fix_pseudo_header

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c)expand/collapse
Show more  
 1835  static int fix_pseudo_header(int encap, const guint8 *pd, int len,
 1836      union wtap_pseudo_header *pseudo_header)
 1837  {
 1838          switch (encap) {
 1839   
 1840          case WTAP_ENCAP_PER_PACKET:
 1841                  /*
 1842                   * Infer the packet type from the first two bytes.
 1843                   */
 1844                  encap = infer_pkt_encap(pd, len);
 1845   
 1846                  /*
 1847                   * Fix up the pseudo-header to match the new
 1848                   * encapsulation type.
 1849                   */
 1850                  switch (encap) {
 1851   
 1852                  case WTAP_ENCAP_WFLEET_HDLC:
 1853                  case WTAP_ENCAP_CHDLC_WITH_PHDR:
 1854                  case WTAP_ENCAP_PPP_WITH_PHDR:
 1855                          if (pseudo_header->x25.flags == 0)
 1856                                  pseudo_header->p2p.sent = TRUE;
 1857                          else 
 1858                                  pseudo_header->p2p.sent = FALSE;
 1859                          break;
 1860   
 1861                  case WTAP_ENCAP_ISDN:
 1862                          if (pseudo_header->x25.flags == 0x00)
 1863                                  pseudo_header->isdn.uton = FALSE;
 1864                          else 
 1865                                  pseudo_header->isdn.uton = TRUE;
 1866   
 1867                          /*
 1868                           * XXX - this is currently a per-packet
 1869                           * encapsulation type, and we can't determine 
 1870                           * whether a capture is an ISDN capture before
 1871                           * seeing any packets, and B-channel PPP packets
 1872                           * look like PPP packets and are given 
 1873                           * WTAP_ENCAP_PPP_WITH_PHDR, not WTAP_ENCAP_ISDN,
 1874                           * so we assume this is a D-channel packet and
 1875                           * thus give it a channel number of 0.
 1876                           */
 1877                          pseudo_header->isdn.channel = 0;
 1878                          break;
 1879                  }
 1880                  break;
 1881   
 1882          case WTAP_ENCAP_ATM_PDUS:
 1883                  /*
 1884                   * If the Windows Sniffer writes out one of its ATM
 1885                   * capture files in DOS Sniffer format, it doesn't
 1886                   * distinguish between LE Control and LANE encapsulated 
 1887                   * LAN frames, it just marks them as LAN frames,
 1888                   * so we fix that up here.
 1889                   *
 1890                   * I've also seen DOS Sniffer captures claiming that 
 1891                   * LANE packets that *don't* start with FF 00 are 
 1892                   * marked as LE Control frames, so we fix that up 
 1893                   * as well.
 1894                   */
 1895                  if (pseudo_header->atm.type == TRAF_LANE && len >= 2) {
 1896                          if (pd[0] == 0xff && pd[1] == 0x00) {
 1897                                  /*
 1898                                   * This must be LE Control.
 1899                                   */
 1900                                  pseudo_header->atm.subtype =
 1901                                      TRAF_ST_LANE_LE_CTRL;
 1902                          } else {
 1903                                  /*
 1904                                   * This can't be LE Control.
 1905                                   */
 1906                                  if (pseudo_header->atm.subtype ==
 1907                                      TRAF_ST_LANE_LE_CTRL) {
 1908                                          /*
 1909                                           * XXX - Ethernet or Token Ring?
 1910                                           */
 1911                                          pseudo_header->atm.subtype =
 1912                                              TRAF_ST_LANE_802_3;
 1913                                  }
 1914                          }
 1915                  }
 1916                  break;
 1917          }
 1918          return encap;
 1919  }
Show more  




Change Warning 1035.29485 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: