#include <crypto/aead.h>
#include <linux/highmem.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <net/dst.h>
#include <net/inet_connection_sock.h>
#include <net/tcp.h>
#include <net/tls.h>
#include <linux/skbuff_ref.h>
#include "tls.h"
#include "trace.h"
static DECLARE_RWSEM(device_offload_lock);
static struct workqueue_struct *destruct_wq __read_mostly;
static LIST_HEAD(tls_device_list);
static LIST_HEAD(tls_device_down_list);
static DEFINE_SPINLOCK(tls_device_lock);
static struct page *dummy_page;
static void tls_device_free_ctx(struct tls_context *ctx)
{ … }
static void tls_device_tx_del_task(struct work_struct *work)
{ … }
static void tls_device_queue_ctx_destruction(struct tls_context *ctx)
{ … }
static struct net_device *get_netdev_for_sock(struct sock *sk)
{ … }
static void destroy_record(struct tls_record_info *record)
{ … }
static void delete_all_records(struct tls_offload_context_tx *offload_ctx)
{ … }
static void tls_icsk_clean_acked(struct sock *sk, u32 acked_seq)
{ … }
void tls_device_sk_destruct(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
void tls_device_free_resources_tx(struct sock *sk)
{ … }
void tls_offload_tx_resync_request(struct sock *sk, u32 got_seq, u32 exp_seq)
{ … }
EXPORT_SYMBOL_GPL(…);
static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx,
u32 seq)
{ … }
static void tls_append_frag(struct tls_record_info *record,
struct page_frag *pfrag,
int size)
{ … }
static int tls_push_record(struct sock *sk,
struct tls_context *ctx,
struct tls_offload_context_tx *offload_ctx,
struct tls_record_info *record,
int flags)
{ … }
static void tls_device_record_close(struct sock *sk,
struct tls_context *ctx,
struct tls_record_info *record,
struct page_frag *pfrag,
unsigned char record_type)
{ … }
static int tls_create_new_record(struct tls_offload_context_tx *offload_ctx,
struct page_frag *pfrag,
size_t prepend_size)
{ … }
static int tls_do_allocation(struct sock *sk,
struct tls_offload_context_tx *offload_ctx,
struct page_frag *pfrag,
size_t prepend_size)
{ … }
static int tls_device_copy_data(void *addr, size_t bytes, struct iov_iter *i)
{ … }
static int tls_push_data(struct sock *sk,
struct iov_iter *iter,
size_t size, int flags,
unsigned char record_type)
{ … }
int tls_device_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
{ … }
void tls_device_splice_eof(struct socket *sock)
{ … }
struct tls_record_info *tls_get_record(struct tls_offload_context_tx *context,
u32 seq, u64 *p_record_sn)
{ … }
EXPORT_SYMBOL(…);
static int tls_device_push_pending_record(struct sock *sk, int flags)
{ … }
void tls_device_write_space(struct sock *sk, struct tls_context *ctx)
{ … }
static void tls_device_resync_rx(struct tls_context *tls_ctx,
struct sock *sk, u32 seq, u8 *rcd_sn)
{ … }
static bool
tls_device_rx_resync_async(struct tls_offload_resync_async *resync_async,
s64 resync_req, u32 *seq, u16 *rcd_delta)
{ … }
void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq)
{ … }
static void tls_device_core_ctrl_rx_resync(struct tls_context *tls_ctx,
struct tls_offload_context_rx *ctx,
struct sock *sk, struct sk_buff *skb)
{ … }
static int
tls_device_reencrypt(struct sock *sk, struct tls_context *tls_ctx)
{ … }
int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx)
{ … }
static void tls_device_attach(struct tls_context *ctx, struct sock *sk,
struct net_device *netdev)
{ … }
static struct tls_offload_context_tx *alloc_offload_ctx_tx(struct tls_context *ctx)
{ … }
int tls_set_device_offload(struct sock *sk)
{ … }
int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
{ … }
void tls_device_offload_cleanup_rx(struct sock *sk)
{ … }
static int tls_device_down(struct net_device *netdev)
{ … }
static int tls_dev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static struct notifier_block tls_dev_notifier = …;
int __init tls_device_init(void)
{ … }
void __exit tls_device_cleanup(void)
{ … }