Skip to content

Commit 1bec29a

Browse files
committed
Retire BSD/OS support.
The last release of BSD/OS was more than 20 years ago, so remove all bits specific to building tcpdump on it, mainly ppp_bsdos_if_print(), which has been a no-op on platforms other than BSD/OS. Restoring the function would not be practicable because in addition to the generic bit rot it uses SLC_DIR, SLC_LLHL, SLC_BPFHDRLEN, SLC_CHL and struct ppp_header, none of which appear in FreeBSD or illumos or Linux or NetBSD or OpenBSD. This is why protocol decoders should not depend on OS-specific headers. See also commit 4729260.
1 parent 630f9bc commit 1bec29a

File tree

4 files changed

+1
-173
lines changed

4 files changed

+1
-173
lines changed

netdissect.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ extern void null_if_print IF_PRINTER_ARGS;
566566
extern void pflog_if_print IF_PRINTER_ARGS;
567567
extern void pktap_if_print IF_PRINTER_ARGS;
568568
extern void ppi_if_print IF_PRINTER_ARGS;
569-
extern void ppp_bsdos_if_print IF_PRINTER_ARGS;
570569
extern void ppp_hdlc_if_print IF_PRINTER_ARGS;
571570
extern void ppp_if_print IF_PRINTER_ARGS;
572571
extern void pppoe_if_print IF_PRINTER_ARGS;

print-fddi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct fddi_header {
8484
/*
8585
* Some FDDI interfaces use bit-swapped addresses.
8686
*/
87-
#if defined(__alpha) || defined(__bsdi) || defined(__NetBSD__) || defined(__linux__)
87+
#if defined(__alpha) || defined(__NetBSD__) || defined(__linux__)
8888
static int fddi_bitswap = 0;
8989
#else
9090
static int fddi_bitswap = 1;

print-ppp.c

Lines changed: 0 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737

3838
#include "netdissect-stdinc.h"
3939

40-
#ifdef __bsdi__
41-
#include <net/slcompress.h>
42-
#include <net/if_ppp.h>
43-
#endif
44-
4540
#include "netdissect.h"
4641
#include "extract.h"
4742
#include "addrtoname.h"
@@ -1732,166 +1727,3 @@ ppp_hdlc_if_print(netdissect_options *ndo,
17321727

17331728
ndo->ndo_ll_hdr_len += hdrlen;
17341729
}
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-
}

print.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ static const struct printer printers[] = {
194194
#ifdef DLT_PPI
195195
{ ppi_if_print, DLT_PPI },
196196
#endif
197-
#ifdef DLT_PPP_BSDOS
198-
{ ppp_bsdos_if_print, DLT_PPP_BSDOS },
199-
#endif
200197
#ifdef DLT_PPP_SERIAL
201198
{ ppp_hdlc_if_print, DLT_PPP_SERIAL },
202199
#endif

0 commit comments

Comments
 (0)