// SPDX-License-Identifier: GPL-2.0-only /* * Handle the TLS Alert protocol * * Author: Chuck Lever <[email protected]> * * Copyright (c) 2023, Oracle and/or its affiliates. */ #include <linux/types.h> #include <linux/socket.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/skbuff.h> #include <linux/inet.h> #include <net/sock.h> #include <net/handshake.h> #include <net/tls.h> #include <net/tls_prot.h> #include "handshake.h" #include <trace/events/handshake.h> /** * tls_alert_send - send a TLS Alert on a kTLS socket * @sock: open kTLS socket to send on * @level: TLS Alert level * @description: TLS Alert description * * Returns zero on success or a negative errno. */ int tls_alert_send(struct socket *sock, u8 level, u8 description) { … } /** * tls_get_record_type - Look for TLS RECORD_TYPE information * @sk: socket (for IP address information) * @cmsg: incoming message to be parsed * * Returns zero or a TLS_RECORD_TYPE value. */ u8 tls_get_record_type(const struct sock *sk, const struct cmsghdr *cmsg) { … } EXPORT_SYMBOL(…); /** * tls_alert_recv - Parse TLS Alert messages * @sk: socket (for IP address information) * @msg: incoming message to be parsed * @level: OUT - TLS AlertLevel value * @description: OUT - TLS AlertDescription value * */ void tls_alert_recv(const struct sock *sk, const struct msghdr *msg, u8 *level, u8 *description) { … } EXPORT_SYMBOL(…);