|
37 | 37 |
|
38 | 38 | #include "netdissect-stdinc.h" |
39 | 39 |
|
40 | | -#ifdef __bsdi__ |
41 | | -#include <net/slcompress.h> |
42 | | -#include <net/if_ppp.h> |
43 | | -#endif |
44 | | - |
45 | 40 | #include "netdissect.h" |
46 | 41 | #include "extract.h" |
47 | 42 | #include "addrtoname.h" |
@@ -1732,166 +1727,3 @@ ppp_hdlc_if_print(netdissect_options *ndo, |
1732 | 1727 |
|
1733 | 1728 | ndo->ndo_ll_hdr_len += hdrlen; |
1734 | 1729 | } |
1735 | | - |
1736 | | -#define PPP_BSDI_HDRLEN 24 |
1737 | | - |
1738 | | -/* BSD/OS specific PPP printer */ |
1739 | | -void |
1740 | | -ppp_bsdos_if_print(netdissect_options *ndo, |
1741 | | - const struct pcap_pkthdr *h _U_, const u_char *p _U_) |
1742 | | -{ |
1743 | | - u_int hdrlength; |
1744 | | -#ifdef __bsdi__ |
1745 | | - u_int length = h->len; |
1746 | | - u_int caplen = h->caplen; |
1747 | | - uint16_t ptype; |
1748 | | - uint8_t llhl; |
1749 | | - const u_char *q; |
1750 | | - u_int i; |
1751 | | - |
1752 | | - ndo->ndo_protocol = "ppp_bsdos"; |
1753 | | - if (caplen < PPP_BSDI_HDRLEN) { |
1754 | | - nd_print_trunc(ndo); |
1755 | | - ndo->ndo_ll_hdr_len += caplen; |
1756 | | - return; |
1757 | | - } |
1758 | | - |
1759 | | - hdrlength = 0; |
1760 | | - |
1761 | | -#if 0 |
1762 | | - if (GET_U_1(p) == PPP_ADDRESS && |
1763 | | - GET_U_1(p + 1) == PPP_CONTROL) { |
1764 | | - if (ndo->ndo_eflag) |
1765 | | - ND_PRINT("%02x %02x ", GET_U_1(p), |
1766 | | - GET_U_1(p + 1)); |
1767 | | - p += 2; |
1768 | | - hdrlength = 2; |
1769 | | - } |
1770 | | - |
1771 | | - if (ndo->ndo_eflag) |
1772 | | - ND_PRINT("%u ", length); |
1773 | | - /* Retrieve the protocol type */ |
1774 | | - if (GET_U_1(p) & 01) { |
1775 | | - /* Compressed protocol field */ |
1776 | | - ptype = GET_U_1(p); |
1777 | | - if (ndo->ndo_eflag) |
1778 | | - ND_PRINT("%02x ", ptype); |
1779 | | - p++; |
1780 | | - hdrlength += 1; |
1781 | | - } else { |
1782 | | - /* Un-compressed protocol field */ |
1783 | | - ptype = GET_BE_U_2(p); |
1784 | | - if (ndo->ndo_eflag) |
1785 | | - ND_PRINT("%04x ", ptype); |
1786 | | - p += 2; |
1787 | | - hdrlength += 2; |
1788 | | - } |
1789 | | -#else |
1790 | | - ptype = 0; /*XXX*/ |
1791 | | - if (ndo->ndo_eflag) |
1792 | | - ND_PRINT("%c ", GET_U_1(p + SLC_DIR) ? 'O' : 'I'); |
1793 | | - llhl = GET_U_1(p + SLC_LLHL); |
1794 | | - if (llhl) { |
1795 | | - /* link level header */ |
1796 | | - struct ppp_header *ph; |
1797 | | - |
1798 | | - q = p + SLC_BPFHDRLEN; |
1799 | | - ph = (struct ppp_header *)q; |
1800 | | - if (ph->phdr_addr == PPP_ADDRESS |
1801 | | - && ph->phdr_ctl == PPP_CONTROL) { |
1802 | | - if (ndo->ndo_eflag) |
1803 | | - ND_PRINT("%02x %02x ", GET_U_1(q), |
1804 | | - GET_U_1(q + 1)); |
1805 | | - ptype = GET_BE_U_2(&ph->phdr_type); |
1806 | | - if (ndo->ndo_eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) { |
1807 | | - ND_PRINT("%s ", tok2str(ppptype2str, |
1808 | | - "proto-#%u", ptype)); |
1809 | | - } |
1810 | | - } else { |
1811 | | - if (ndo->ndo_eflag) { |
1812 | | - ND_PRINT("LLH=["); |
1813 | | - for (i = 0; i < llhl; i++) |
1814 | | - ND_PRINT("%02x", GET_U_1(q + i)); |
1815 | | - ND_PRINT("] "); |
1816 | | - } |
1817 | | - } |
1818 | | - } |
1819 | | - if (ndo->ndo_eflag) |
1820 | | - ND_PRINT("%u ", length); |
1821 | | - if (GET_U_1(p + SLC_CHL)) { |
1822 | | - q = p + SLC_BPFHDRLEN + llhl; |
1823 | | - |
1824 | | - switch (ptype) { |
1825 | | - case PPP_VJC: |
1826 | | - ptype = vjc_print(ndo, q, ptype); |
1827 | | - hdrlength = PPP_BSDI_HDRLEN; |
1828 | | - p += hdrlength; |
1829 | | - switch (ptype) { |
1830 | | - case PPP_IP: |
1831 | | - ip_print(ndo, p, length); |
1832 | | - break; |
1833 | | - case PPP_IPV6: |
1834 | | - ip6_print(ndo, p, length); |
1835 | | - break; |
1836 | | - case PPP_MPLS_UCAST: |
1837 | | - case PPP_MPLS_MCAST: |
1838 | | - mpls_print(ndo, p, length); |
1839 | | - break; |
1840 | | - } |
1841 | | - goto printx; |
1842 | | - case PPP_VJNC: |
1843 | | - ptype = vjc_print(ndo, q, ptype); |
1844 | | - hdrlength = PPP_BSDI_HDRLEN; |
1845 | | - p += hdrlength; |
1846 | | - switch (ptype) { |
1847 | | - case PPP_IP: |
1848 | | - ip_print(ndo, p, length); |
1849 | | - break; |
1850 | | - case PPP_IPV6: |
1851 | | - ip6_print(ndo, p, length); |
1852 | | - break; |
1853 | | - case PPP_MPLS_UCAST: |
1854 | | - case PPP_MPLS_MCAST: |
1855 | | - mpls_print(ndo, p, length); |
1856 | | - break; |
1857 | | - } |
1858 | | - goto printx; |
1859 | | - default: |
1860 | | - if (ndo->ndo_eflag) { |
1861 | | - ND_PRINT("CH=["); |
1862 | | - for (i = 0; i < llhl; i++) |
1863 | | - ND_PRINT("%02x", |
1864 | | - GET_U_1(q + i)); |
1865 | | - ND_PRINT("] "); |
1866 | | - } |
1867 | | - break; |
1868 | | - } |
1869 | | - } |
1870 | | - |
1871 | | - hdrlength = PPP_BSDI_HDRLEN; |
1872 | | -#endif |
1873 | | - |
1874 | | - length -= hdrlength; |
1875 | | - p += hdrlength; |
1876 | | - |
1877 | | - switch (ptype) { |
1878 | | - case PPP_IP: |
1879 | | - ip_print(p, length); |
1880 | | - break; |
1881 | | - case PPP_IPV6: |
1882 | | - ip6_print(ndo, p, length); |
1883 | | - break; |
1884 | | - case PPP_MPLS_UCAST: |
1885 | | - case PPP_MPLS_MCAST: |
1886 | | - mpls_print(ndo, p, length); |
1887 | | - break; |
1888 | | - default: |
1889 | | - ND_PRINT("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype)); |
1890 | | - } |
1891 | | - |
1892 | | -printx: |
1893 | | -#else /* __bsdi */ |
1894 | | - hdrlength = 0; |
1895 | | -#endif /* __bsdi__ */ |
1896 | | - ndo->ndo_ll_hdr_len += hdrlength; |
1897 | | -} |
0 commit comments