Lines Matching refs:off

160 esp4_input(m, off)
162 int off;
183 if (off % 4 != 0 || m->m_pkthdr.len % 4 != 0) {
185 "(off=%d, pktlen=%d)\n", off, m->m_pkthdr.len));
190 if (m->m_len < off + ESPMAXLEN) {
191 m = m_pullup(m, off + ESPMAXLEN);
206 !(ip->ip_p == IPPROTO_UDP && off >= sizeof(struct udphdr))) {
212 esp = (struct esp *)(void *)(((u_int8_t *)ip) + off);
292 if (m->m_pkthdr.len < off + ESPMAXLEN + siz) {
306 if (esp_auth(m, off, m->m_pkthdr.len - off - siz, sav, sum)) {
320 /* strip off the authentication data */
356 if (m->m_pkthdr.len < off + esplen + ivlen + sizeof(esptail)) {
363 if (m->m_len < off + esplen + ivlen) {
364 m = m_pullup(m, off + esplen + ivlen);
387 if ((*algo->decrypt)(m, off, sav, algo, ivlen)) {
418 /* strip off the trailing pad area. */
428 if (m->m_len < off) {
429 m = m_pullup(m, off);
439 off -= sizeof(struct udphdr); // off no longer includes the udphdr's size
445 struct udphdr *encap_uh = (__typeof__(encap_uh))(void *)((caddr_t)ip + off);
451 ip = esp4_input_strip_UDP_encap(m, off);
452 esp = (struct esp *)(void *)(((u_int8_t *)ip) + off);
456 if (sav->utun_is_keepalive_fn(sav->utun_pcb, &m, nxt, sav->flags, (off + esplen + ivlen))) {
467 if (ipsec4_tunnel_validate(m, off + esplen + ivlen, nxt, sav, &ifamily)) {
472 * strip off all the headers that precedes ESP header.
481 m_adj(m, off + esplen + ivlen);
600 * strip off ESP header and IV.
601 * even in m_pulldown case, we need to strip off ESP so that
609 ovbcopy((caddr_t)ip, (caddr_t)(((u_char *)ip) + stripsiz), off);
656 if (m->m_len < off + sizeof(struct udphdr)) {
657 m = m_pullup(m, off + sizeof(struct udphdr));
666 udp = (struct udphdr *)(void *)(((u_int8_t *)ip) + off);
693 ip_proto_dispatch_in(m, off, nxt, 0);
726 int off = *offp;
740 if (off % 4 != 0 || m->m_pkthdr.len % 4 != 0) {
742 "(off=%d, pktlen=%d)\n", off, m->m_pkthdr.len));
748 IP6_EXTHDR_CHECK(m, off, ESPMAXLEN, {return IPPROTO_DONE;});
749 esp = (struct esp *)(void *)(mtod(m, caddr_t) + off);
751 IP6_EXTHDR_GET(esp, struct esp *, m, off, ESPMAXLEN);
843 if (m->m_pkthdr.len < off + ESPMAXLEN + siz) {
857 if (esp_auth(m, off, m->m_pkthdr.len - off - siz, sav, sum)) {
871 /* strip off the authentication data */
904 if (m->m_pkthdr.len < off + esplen + ivlen + sizeof(esptail)) {
912 IP6_EXTHDR_CHECK(m, off, esplen + ivlen, return IPPROTO_DONE); /*XXX*/
914 IP6_EXTHDR_GET(esp, struct esp *, m, off, esplen + ivlen);
936 if ((*algo->decrypt)(m, off, sav, algo, ivlen)) {
965 /* strip off the trailing pad area. */
971 if (sav->utun_is_keepalive_fn(sav->utun_pcb, &m, nxt, sav->flags, (off + esplen + ivlen))) {
982 if (ipsec6_tunnel_validate(m, off + esplen + ivlen, nxt, sav)) {
987 * strip off all the headers that precedes ESP header.
995 m_adj(m, off + esplen + ivlen);
1061 * strip off ESP header and IV.
1062 * even in m_pulldown case, we need to strip off ESP so that
1071 prvnxtp = ip6_get_prevhdr(m, off); /* XXX */
1077 if (m->m_len >= stripsiz + off) {
1078 ovbcopy((caddr_t)ip6, ((caddr_t)ip6) + stripsiz, off);
1089 n = m_split(m, off, M_DONTWAIT);
1164 *offp = off;
1198 int off;
1212 off = ip6cp->ip6c_off;
1243 if (m->m_pkthdr.len < off + sizeof(esp))
1246 if (m->m_len < off + sizeof(esp)) {
1251 m_copydata(m, off, sizeof(esp), (caddr_t)&esp);
1254 espp = (struct newesp*)(void *)(mtod(m, caddr_t) + off);