linux/net/ipv4/tcp_sigpool.c

// SPDX-License-Identifier: GPL-2.0-or-later

#include <crypto/hash.h>
#include <linux/cpu.h>
#include <linux/kref.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/percpu.h>
#include <linux/workqueue.h>
#include <net/tcp.h>

static size_t __scratch_size;
struct sigpool_scratch {};

static DEFINE_PER_CPU(struct sigpool_scratch, sigpool_scratch) =;

struct sigpool_entry {};

#define CPOOL_SIZE
static struct sigpool_entry cpool[CPOOL_SIZE];
static unsigned int cpool_populated;
static DEFINE_MUTEX(cpool_mutex);

/* Slow-path */
struct scratches_to_free {};

static void free_old_scratches(struct rcu_head *head)
{}

/**
 * sigpool_reserve_scratch - re-allocates scratch buffer, slow-path
 * @size: request size for the scratch/temp buffer
 */
static int sigpool_reserve_scratch(size_t size)
{}

static void sigpool_scratch_free(void)
{}

static int __cpool_try_clone(struct crypto_ahash *hash)
{}

static int __cpool_alloc_ahash(struct sigpool_entry *e, const char *alg)
{}

/**
 * tcp_sigpool_alloc_ahash - allocates pool for ahash requests
 * @alg: name of async hash algorithm
 * @scratch_size: reserve a tcp_sigpool::scratch buffer of this size
 */
int tcp_sigpool_alloc_ahash(const char *alg, size_t scratch_size)
{}
EXPORT_SYMBOL_GPL();

static void __cpool_free_entry(struct sigpool_entry *e)
{}

static void cpool_cleanup_work_cb(struct work_struct *work)
{}

static DECLARE_WORK(cpool_cleanup_work, cpool_cleanup_work_cb);
static void cpool_schedule_cleanup(struct kref *kref)
{}

/**
 * tcp_sigpool_release - decreases number of users for a pool. If it was
 * the last user of the pool, releases any memory that was consumed.
 * @id: tcp_sigpool that was previously allocated by tcp_sigpool_alloc_ahash()
 */
void tcp_sigpool_release(unsigned int id)
{}
EXPORT_SYMBOL_GPL();

/**
 * tcp_sigpool_get - increases number of users (refcounter) for a pool
 * @id: tcp_sigpool that was previously allocated by tcp_sigpool_alloc_ahash()
 */
void tcp_sigpool_get(unsigned int id)
{}
EXPORT_SYMBOL_GPL();

int tcp_sigpool_start(unsigned int id, struct tcp_sigpool *c) __cond_acquires(RCU_BH)
{}
EXPORT_SYMBOL_GPL();

void tcp_sigpool_end(struct tcp_sigpool *c) __releases(RCU_BH)
{}
EXPORT_SYMBOL_GPL();

/**
 * tcp_sigpool_algo - return algorithm of tcp_sigpool
 * @id: tcp_sigpool that was previously allocated by tcp_sigpool_alloc_ahash()
 * @buf: buffer to return name of algorithm
 * @buf_len: size of @buf
 */
size_t tcp_sigpool_algo(unsigned int id, char *buf, size_t buf_len)
{}
EXPORT_SYMBOL_GPL();

/**
 * tcp_sigpool_hash_skb_data - hash data in skb with initialized tcp_sigpool
 * @hp: tcp_sigpool pointer
 * @skb: buffer to add sign for
 * @header_len: TCP header length for this segment
 */
int tcp_sigpool_hash_skb_data(struct tcp_sigpool *hp,
			      const struct sk_buff *skb,
			      unsigned int header_len)
{}
EXPORT_SYMBOL();

MODULE_LICENSE();
MODULE_DESCRIPTION();