Lines Matching refs:LEN
92 uint16_t len;
126 #define PPPOE_ADD_HEADER(PTR, CODE, SESS, LEN) \
130 PPPOE_ADD_16(PTR, LEN)
252 static struct mbuf *pppoe_get_mbuf(size_t len);
533 pppoe_find_softc_by_hunique(uint8_t *token, size_t len,
547 if (len != sizeof(sc->sc_id)) {
551 memcpy(&t, token, len);
630 uint16_t tag, len;
658 if (m->m_pkthdr.len - off < PPPOE_HEADERLEN) {
681 if (plen + off > m->m_pkthdr.len) {
684 m_adj(m, off + plen - m->m_pkthdr.len); /* ignore trailing garbage */
687 len = 0;
691 while (off + sizeof(*pt) <= m->m_pkthdr.len) {
698 len = ntohs(pt->len);
699 if (off + len + sizeof(*pt) > m->m_pkthdr.len) {
708 if (len > 0) {
709 dlen = 4 * len + 1;
714 n = m_pulldown(m, off + sizeof(*pt), len,
723 mtod(n, char*) + noff, len,
731 n = m_pulldown(m, off + sizeof(*pt), len,
740 hunique_len = len;
745 n = m_pulldown(m, off + sizeof(*pt), len,
753 ac_cookie_len = len;
758 n = m_pulldown(m, off + sizeof(*pt), len,
766 relay_sid_len = len;
784 if (errortag && len) {
785 dlen = 4 * len + 1;
788 n = m_pulldown(m, off + sizeof(*pt), len,
794 mtod(n, char*) + noff, len,
806 off += sizeof(*pt) + len;
1155 if (m->m_pkthdr.len <= PPPOE_HEADERLEN) {
1212 printf("%s: pkthdr.len=%d, pppoe.len=%d",
1213 sc->sc_sppp.pp_if.if_xname, m->m_pkthdr.len, plen);
1224 if (m->m_pkthdr.len < plen)
1228 m_adj(m, plen - m->m_pkthdr.len);
1264 DPRINTF(sc, "(%x) state=%d, session=0x%x output -> %s, len=%d\n",
1266 ether_sprintf((const unsigned char *)&sc->sc_dest), m->m_pkthdr.len);
1275 char **dst, const void *src, size_t len)
1281 bufsiz = len + 1;
1286 bufsiz = len + 1;
1439 pppoe_get_mbuf(size_t len)
1443 if (len + sizeof(struct ether_header) > MCLBYTES)
1449 if (len + sizeof(struct ether_header) > MHLEN) {
1457 m->m_len = len;
1458 m->m_pkthdr.len = len;
1468 int len, l1 = 0, l2 = 0;
1475 len = sizeof(struct pppoetag);
1478 len += l1;
1482 len += sizeof(struct pppoetag) + l2;
1484 len += sizeof(struct pppoetag) + sizeof(sc->sc_id);
1486 len += sizeof(struct pppoetag) + 2;
1490 m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN);
1496 PPPOE_ADD_HEADER(p, PPPOE_CODE_PADI, 0, len);
1523 if (p - mtod(m0, uint8_t *) != len + PPPOE_HEADERLEN)
1524 panic("pppoe_send_padi: garbled output len, should be %ld, is %ld",
1525 (long)(len + PPPOE_HEADERLEN), (long)(p - mtod(m0, uint8_t *)));
1755 size_t len, l1 = 0;
1761 len = sizeof(struct pppoetag);
1764 len += l1;
1767 len += sizeof(struct pppoetag) + sc->sc_ac_cookie_len;
1770 len += sizeof(struct pppoetag) + sc->sc_relay_sid_len;
1772 len += sizeof(struct pppoetag) + sizeof(sc->sc_id);
1774 len += sizeof(struct pppoetag) + 2;
1778 m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN);
1784 PPPOE_ADD_HEADER(p, PPPOE_CODE_PADR, 0, len);
1817 if (p - mtod(m0, uint8_t *) != len + PPPOE_HEADERLEN)
1818 panic("pppoe_send_padr: garbled output len, should be %ld, is %ld",
1819 (long)(len + PPPOE_HEADERLEN), (long)(p - mtod(m0, uint8_t *)));
1857 size_t len;
1863 len = sizeof(struct pppoetag) + sizeof(sc->sc_id);
1865 len += sizeof(struct pppoetag) + sc->sc_hunique_len;
1867 m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN);
1872 PPPOE_ADD_HEADER(p, PPPOE_CODE_PADO, 0, len);
1889 size_t len, l1 = 0; /* XXX: gcc */
1900 len = sizeof(struct pppoetag);
1903 len += l1;
1906 len += sizeof(struct pppoetag) + sc->sc_hunique_len;
1908 m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN);
1913 PPPOE_ADD_HEADER(p, PPPOE_CODE_PADS, sc->sc_session, len);
1995 size_t len;
2009 len = m->m_pkthdr.len;
2016 PPPOE_ADD_HEADER(p, 0, sc->sc_session, len);
2031 size_t len;
2044 len = m->m_pkthdr.len;
2052 PPPOE_ADD_HEADER(p, 0, sc->sc_session, len);