Lines Matching refs:offset
78 sctp_calculate_cksum(struct mbuf *m, uint32_t offset)
81 * given a mbuf chain with a packetheader offset by 'offset'
85 * mbuf chain. Note: if offset is greater than the total mbuf
92 /* find the correct mbuf and offset into mbuf */
93 while ((at != NULL) && (offset > (uint32_t) SCTP_BUF_LEN(at))) {
94 offset -= SCTP_BUF_LEN(at); /* update remaining offset
99 if ((SCTP_BUF_LEN(at) - offset) > 0) {
101 (unsigned char *)(SCTP_BUF_AT(at, offset)),
102 (unsigned int)(SCTP_BUF_LEN(at) - offset));
104 if (offset) {
105 /* we only offset once into the first mbuf */
106 if (offset < (uint32_t) SCTP_BUF_LEN(at))
107 offset = 0;
109 offset -= SCTP_BUF_LEN(at);
121 sctp_delayed_cksum(struct mbuf *m, uint32_t offset)
130 checksum = sctp_calculate_cksum(m, offset);
133 offset += offsetof(struct sctphdr, checksum);
135 if (offset + sizeof(uint32_t) > (uint32_t) (m->m_len)) {
137 (uint32_t) m->m_len, offset);
145 *(uint32_t *) (m->m_data + offset) = checksum;