Lines Matching full:esp

11  *	This file is derived from net/ipv4/esp.c
22 #include <net/esp.h>
321 /* Move ESP header back into place. */
381 struct esp_info *esp, in esp6_output_udp_encap() argument
389 len = skb->len + esp->tailen - skb_transport_offset(skb); in esp6_output_udp_encap()
393 uh = (struct udphdr *)esp->esph; in esp6_output_udp_encap()
413 struct esp_info *esp) in esp6_output_tcp_encap() argument
415 __be16 *lenp = (void *)esp->esph; in esp6_output_tcp_encap()
420 len = skb->len + esp->tailen - skb_transport_offset(skb); in esp6_output_tcp_encap()
439 struct esp_info *esp) in esp6_output_tcp_encap() argument
446 struct esp_info *esp) in esp6_output_encap() argument
463 esph = esp6_output_udp_encap(skb, encap_type, esp, sport, dport); in esp6_output_encap()
466 esph = esp6_output_tcp_encap(x, skb, esp); in esp6_output_encap()
473 esp->esph = esph; in esp6_output_encap()
478 int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) in esp6_output_head() argument
485 int tailen = esp->tailen; in esp6_output_head()
488 int err = esp6_output_encap(x, skb, esp); in esp6_output_head()
511 esp->inplace = false; in esp6_output_head()
527 esp_output_fill_trailer(tail, esp->tfclen, esp->plen, esp->proto); in esp6_output_head()
552 esph_offset = (unsigned char *)esp->esph - skb_transport_header(skb); in esp6_output_head()
558 esp->esph = (struct ip_esp_hdr *)(skb_transport_header(skb) + esph_offset); in esp6_output_head()
561 esp_output_fill_trailer(tail, esp->tfclen, esp->plen, esp->proto); in esp6_output_head()
569 int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) in esp6_output_tail() argument
597 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen); in esp6_output_tail()
606 if (esp->inplace) in esp6_output_tail()
609 dsg = &sg[esp->nfrags]; in esp6_output_tail()
611 esph = esp_output_set_esn(skb, x, esp->esph, extra); in esp6_output_tail()
612 esp->esph = esph; in esp6_output_tail()
614 sg_init_table(sg, esp->nfrags); in esp6_output_tail()
617 assoclen + ivlen + esp->clen + alen); in esp6_output_tail()
621 if (!esp->inplace) { in esp6_output_tail()
645 assoclen + ivlen + esp->clen + alen); in esp6_output_tail()
655 aead_request_set_crypt(req, sg, dsg, ivlen + esp->clen, iv); in esp6_output_tail()
659 memcpy(iv + ivlen - min(ivlen, 8), (u8 *)&esp->seqno + 8 - min(ivlen, 8), in esp6_output_tail()
698 struct esp_info esp; in esp6_output() local
700 esp.inplace = true; in esp6_output()
702 esp.proto = *skb_mac_header(skb); in esp6_output()
710 esp.tfclen = 0; in esp6_output()
717 esp.tfclen = padto - skb->len; in esp6_output()
720 esp.clen = ALIGN(skb->len + 2 + esp.tfclen, blksize); in esp6_output()
721 esp.plen = esp.clen - skb->len - esp.tfclen; in esp6_output()
722 esp.tailen = esp.tfclen + esp.plen + alen; in esp6_output()
724 esp.esph = ip_esp_hdr(skb); in esp6_output()
726 esp.nfrags = esp6_output_head(x, skb, &esp); in esp6_output()
727 if (esp.nfrags < 0) in esp6_output()
728 return esp.nfrags; in esp6_output()
730 esph = esp.esph; in esp6_output()
734 esp.seqno = cpu_to_be64(XFRM_SKB_CB(skb)->seq.output.low + in esp6_output()
739 return esp6_output_tail(x, skb, &esp); in esp6_output()
762 net_dbg_ratelimited("ipsec esp packet is garbage padlen=%d, elen=%d\n", in esp_remove_trailer()
1197 NL_SET_ERR_MSG(extack, "ESP: AEAD or CRYPT must be provided"); in esp6_init_state()
1227 NL_SET_ERR_MSG(extack, "Unsupported encapsulation type for ESP"); in esp6_init_state()