PPP_HDRLEN
rptr += PPP_HDRLEN;
slen = mp->m_len - PPP_HDRLEN;
if (olen + PPP_HDRLEN + BSD_OVHD > maxolen) {
return olen + PPP_HDRLEN + BSD_OVHD;
rptr += PPP_HDRLEN;
slen = dmsg->m_len - PPP_HDRLEN;
rptr += PPP_HDRLEN;
len = cmp->m_len - PPP_HDRLEN;
space = m_trailingspace(dmp) - PPP_HDRLEN + 1;
wptr += PPP_HDRLEN - 1;
if (m->m_len <= PPP_HDRLEN) {
dp = mtod(mp, u_char *) + PPP_HDRLEN;
xlen = sl_uncompress_tcp_core(cp + PPP_HDRLEN,
m->m_len - PPP_HDRLEN, ilen - PPP_HDRLEN,
if (hlen + PPP_HDRLEN > MHLEN) {
if (m_trailingspace(mp) < hlen + PPP_HDRLEN) {
bcopy(iphdr, cp + PPP_HDRLEN, hlen);
mp->m_len = hlen + PPP_HDRLEN;
m->m_data += PPP_HDRLEN + xlen;
m->m_len -= PPP_HDRLEN + xlen;
xlen = sl_uncompress_tcp_core(cp + PPP_HDRLEN,
m->m_len - PPP_HDRLEN, ilen - PPP_HDRLEN,
m->m_pkthdr.len -= PPP_HDRLEN;
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
m->m_pkthdr.len -= PPP_HDRLEN;
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
sc->sc_if.if_hdrlen = PPP_HDRLEN;
bpfattach(&ifp->if_bpf, ifp, DLT_PPP, PPP_HDRLEN);
M_PREPEND(m0, PPP_HDRLEN, M_DONTWAIT);
ip = (struct ip *)(cp + PPP_HDRLEN);
if (mp->m_len <= PPP_HDRLEN) {
sc->sc_if.if_mtu + PPP_HDRLEN : 0));
if (m0->m_pkthdr.len < PPP_HDRLEN)
if ((m0 = m_pullup(m0, PPP_HDRLEN)) == NULL)
if (state->hdrlen + PPP_HDRLEN + 2 < wspace) {
wptr += PPP_HDRLEN;
state->strm.avail_out = wspace - (PPP_HDRLEN + 2);
&& !(olen == PPP_HDRLEN + 3 && *wptr == 0)) {
u_char hdr[PPP_HDRLEN + DEFLATE_OVHD];
for (i = 0; i < PPP_HDRLEN + DEFLATE_OVHD; ++i) {
seq = (hdr[PPP_HDRLEN] << 8) + hdr[PPP_HDRLEN+1];
if (state->hdrlen + PPP_HDRLEN < ospace) {
rlen += PPP_HDRLEN + DEFLATE_OVHD;
olen = PPP_HDRLEN;
state->strm.avail_out = ospace - PPP_HDRLEN;
if (olen > state->mru + PPP_HDRLEN)
state->unit, olen, state->mru + PPP_HDRLEN);
#define PKT_MAXLEN(_sc) ((_sc)->sc_mru + PPP_HDRLEN + PPP_FCSLEN)
if (uio->uio_resid > sc->sc_if.if_mtu + PPP_HDRLEN ||
uio->uio_resid < PPP_HDRLEN)
m->m_pkthdr.len = uio->uio_resid - PPP_HDRLEN;
bcopy(mtod(m0, u_char *), dst.sa_data, PPP_HDRLEN);
m0->m_data += PPP_HDRLEN;
m0->m_len -= PPP_HDRLEN;
if (ilen < PPP_HDRLEN + PPP_FCSLEN) {
outp = f->ppp->outpacket_buf + PPP_HDRLEN + HEADERLEN;
return _this->outpacket_buf + (PPP_HDRLEN - save);
output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN);
output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN);
output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN);
if (len < PPP_HDRLEN)
if (len < PPP_HDRLEN)
framemax += PPP_HDRLEN + PPP_FCSLEN;
outp = outpacket_buf + PPP_HDRLEN + HEADERLEN;
if (datalen && data != outp + PPP_HDRLEN + HEADERLEN)
BCOPY(data, outp + PPP_HDRLEN + HEADERLEN, datalen);
output(f->unit, outpacket_buf, outlen + PPP_HDRLEN);
len -= PPP_HDRLEN;
pkt += PPP_HDRLEN;
u_char outpacket_buf[PPP_MRU+PPP_HDRLEN]; /* buffer for outgoing packet */
u_char inpacket_buf[PPP_MRU+PPP_HDRLEN]; /* buffer for incoming packet */
if (len >= PPP_HDRLEN && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) {
len -= PPP_HDRLEN;
if (len < PPP_HDRLEN) {
len -= PPP_HDRLEN;
lcp_sprotrej(0, p - PPP_HDRLEN, len + PPP_HDRLEN);
pc.snapshot = PPP_HDRLEN;
pc.snapshot = PPP_HDRLEN;
if ((len = read(ttyfd, buf, PPP_MTU + PPP_HDRLEN)) == -1) {
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
default_print((const u_char *)(p + PPP_HDRLEN),
caplen - PPP_HDRLEN);