Lines Matching refs:off

129  * Ensure the correct size of various mbuf parameters.  It could be off due
443 int off = off0;
447 KASSERT(off >= 0, ("m_copym, negative off %d", off));
450 if (off == 0 && m->m_flags & M_PKTHDR)
452 while (off > 0) {
454 if (off < m->m_len)
456 off -= m->m_len;
483 n->m_len = min(len, m->m_len - off);
485 n->m_data = m->m_data + off;
488 bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
492 off = 0;
560 * Copy data from an mbuf chain starting "off" bytes from the beginning,
564 m_copydata(const struct mbuf *m, int off, int len, caddr_t cp)
568 KASSERT(off >= 0, ("m_copydata, negative off %d", off));
570 while (off > 0) {
572 if (off < m->m_len)
574 off -= m->m_len;
579 count = min(m->m_len - off, len);
580 bcopy(mtod(m, caddr_t) + off, cp, count);
583 off = 0;
961 * Note that `off' argument is offset into first mbuf of target chain from
965 m_devget(char *buf, int totlen, int off, struct ifnet *ifp,
972 if (off < 0 || off > MHLEN)
977 if (totlen + off >= MINCLSIZE) {
985 if (m && totlen + off + max_linkhdr <= MHLEN) {
995 if (totlen + off >= MINCLSIZE) {
1007 if (off) {
1008 m->m_data += off;
1009 len -= off;
1010 off = 0;
1027 * starting "off" bytes from the beginning, extending the mbuf
1031 m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp)
1039 while (off > (mlen = m->m_len)) {
1040 off -= mlen;
1047 n->m_len = min(MLEN, len + off);
1053 if (m->m_next == NULL && (len > m->m_len - off)) {
1054 m->m_len += min(len - (m->m_len - off),
1057 mlen = min (m->m_len - off, len);
1058 bcopy(cp, off + mtod(m, caddr_t), (u_int)mlen);
1061 mlen += off;
1062 off = 0;
1126 * Apply function f to the data in an mbuf chain starting "off" bytes from
1130 m_apply(struct mbuf *m, int off, int len,
1136 KASSERT(off >= 0, ("m_apply, negative off %d", off));
1138 while (off > 0) {
1140 if (off < m->m_len)
1142 off -= m->m_len;
1147 count = min(m->m_len - off, len);
1148 rval = (*f)(arg, mtod(m, caddr_t) + off, count);
1152 off = 0;
1162 m_getptr(struct mbuf *m, int loc, int *off)
1168 *off = loc;
1175 *off = m->m_len;
1599 int len, off;
1681 off = 0;
1686 memcpy(mtod(n, caddr_t), mtod(m, caddr_t) + off, cc);
1698 off += cc;
1766 /* don't bother locking. if it's slightly off, so what? */