linux/net/ipv4/esp4.c

// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt)

#include <crypto/aead.h>
#include <crypto/authenc.h>
#include <linux/err.h>
#include <linux/module.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/esp.h>
#include <linux/scatterlist.h>
#include <linux/kernel.h>
#include <linux/pfkeyv2.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/in6.h>
#include <net/icmp.h>
#include <net/protocol.h>
#include <net/udp.h>
#include <net/tcp.h>
#include <net/espintcp.h>
#include <linux/skbuff_ref.h>

#include <linux/highmem.h>

struct esp_skb_cb {};

struct esp_output_extra {};

#define ESP_SKB_CB(__skb)

/*
 * Allocate an AEAD request structure with extra space for SG and IV.
 *
 * For alignment considerations the IV is placed at the front, followed
 * by the request and finally the SG list.
 *
 * TODO: Use spare space in skb for this where possible.
 */
static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int extralen)
{}

static inline void *esp_tmp_extra(void *tmp)
{}

static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int extralen)
{}

static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv)
{}

static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,
					     struct aead_request *req)
{}

static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)
{}

#ifdef CONFIG_INET_ESPINTCP
struct esp_tcp_sk {};

static void esp_free_tcp_sk(struct rcu_head *head)
{}

static struct sock *esp_find_tcp_sk(struct xfrm_state *x)
{}

static int esp_output_tcp_finish(struct xfrm_state *x, struct sk_buff *skb)
{}

static int esp_output_tcp_encap_cb(struct net *net, struct sock *sk,
				   struct sk_buff *skb)
{}

static int esp_output_tail_tcp(struct xfrm_state *x, struct sk_buff *skb)
{}
#else
static int esp_output_tail_tcp(struct xfrm_state *x, struct sk_buff *skb)
{
	WARN_ON(1);
	return -EOPNOTSUPP;
}
#endif

static void esp_output_done(void *data, int err)
{}

/* Move ESP header back into place. */
static void esp_restore_header(struct sk_buff *skb, unsigned int offset)
{}

static void esp_output_restore_header(struct sk_buff *skb)
{}

static struct ip_esp_hdr *esp_output_set_extra(struct sk_buff *skb,
					       struct xfrm_state *x,
					       struct ip_esp_hdr *esph,
					       struct esp_output_extra *extra)
{}

static void esp_output_done_esn(void *data, int err)
{}

static struct ip_esp_hdr *esp_output_udp_encap(struct sk_buff *skb,
					       int encap_type,
					       struct esp_info *esp,
					       __be16 sport,
					       __be16 dport)
{}

#ifdef CONFIG_INET_ESPINTCP
static struct ip_esp_hdr *esp_output_tcp_encap(struct xfrm_state *x,
						    struct sk_buff *skb,
						    struct esp_info *esp)
{}
#else
static struct ip_esp_hdr *esp_output_tcp_encap(struct xfrm_state *x,
						    struct sk_buff *skb,
						    struct esp_info *esp)
{
	return ERR_PTR(-EOPNOTSUPP);
}
#endif

static int esp_output_encap(struct xfrm_state *x, struct sk_buff *skb,
			    struct esp_info *esp)
{}

int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp)
{}
EXPORT_SYMBOL_GPL();

int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp)
{}
EXPORT_SYMBOL_GPL();

static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
{}

static inline int esp_remove_trailer(struct sk_buff *skb)
{}

int esp_input_done2(struct sk_buff *skb, int err)
{}
EXPORT_SYMBOL_GPL();

static void esp_input_done(void *data, int err)
{}

static void esp_input_restore_header(struct sk_buff *skb)
{}

static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi)
{}

static void esp_input_done_esn(void *data, int err)
{}

/*
 * Note: detecting truncated vs. non-truncated authentication data is very
 * expensive, so we only support truncated data, which is the recommended
 * and common case.
 */
static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
{}

static int esp4_err(struct sk_buff *skb, u32 info)
{}

static void esp_destroy(struct xfrm_state *x)
{}

static int esp_init_aead(struct xfrm_state *x, struct netlink_ext_ack *extack)
{}

static int esp_init_authenc(struct xfrm_state *x,
			    struct netlink_ext_ack *extack)
{}

static int esp_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
{}

static int esp4_rcv_cb(struct sk_buff *skb, int err)
{}

static const struct xfrm_type esp_type =;

static struct xfrm4_protocol esp4_protocol =;

static int __init esp4_init(void)
{}

static void __exit esp4_fini(void)
{}

module_init();
module_exit(esp4_fini);
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_XFRM_TYPE();