#undef TRACE_SYSTEM
#define TRACE_SYSTEM …
#if !defined(_TRACE_HANDSHAKE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HANDSHAKE_H
#include <linux/net.h>
#include <net/tls_prot.h>
#include <linux/tracepoint.h>
#include <trace/events/net_probe_common.h>
#define TLS_RECORD_TYPE_LIST …
#undef record_type
#undef record_type_end
#define record_type(x) …
#define record_type_end(x) …
TLS_RECORD_TYPE_LIST
#undef record_type
#undef record_type_end
#define record_type(x) …
#define record_type_end(x) …
#define show_tls_content_type(type) …
TRACE_DEFINE_ENUM(TLS_ALERT_LEVEL_WARNING);
TRACE_DEFINE_ENUM(TLS_ALERT_LEVEL_FATAL);
#define show_tls_alert_level(level) …
#define TLS_ALERT_DESCRIPTION_LIST …
#undef alert_description
#undef alert_description_end
#define alert_description(x) …
#define alert_description_end(x) …
TLS_ALERT_DESCRIPTION_LIST
#undef alert_description
#undef alert_description_end
#define alert_description(x) …
#define alert_description_end(x) …
#define show_tls_alert_description(desc) …
DECLARE_EVENT_CLASS(handshake_event_class,
TP_PROTO(
const struct net *net,
const struct handshake_req *req,
const struct sock *sk
),
TP_ARGS(net, req, sk),
TP_STRUCT__entry(
__field(const void *, req)
__field(const void *, sk)
__field(unsigned int, netns_ino)
),
TP_fast_assign(
__entry->req = req;
__entry->sk = sk;
__entry->netns_ino = net->ns.inum;
),
TP_printk("req=%p sk=%p",
__entry->req, __entry->sk
)
);
#define DEFINE_HANDSHAKE_EVENT(name) …
DECLARE_EVENT_CLASS(handshake_fd_class,
TP_PROTO(
const struct net *net,
const struct handshake_req *req,
const struct sock *sk,
int fd
),
TP_ARGS(net, req, sk, fd),
TP_STRUCT__entry(
__field(const void *, req)
__field(const void *, sk)
__field(int, fd)
__field(unsigned int, netns_ino)
),
TP_fast_assign(
__entry->req = req;
__entry->sk = req->hr_sk;
__entry->fd = fd;
__entry->netns_ino = net->ns.inum;
),
TP_printk("req=%p sk=%p fd=%d",
__entry->req, __entry->sk, __entry->fd
)
);
#define DEFINE_HANDSHAKE_FD_EVENT(name) …
DECLARE_EVENT_CLASS(handshake_error_class,
TP_PROTO(
const struct net *net,
const struct handshake_req *req,
const struct sock *sk,
int err
),
TP_ARGS(net, req, sk, err),
TP_STRUCT__entry(
__field(const void *, req)
__field(const void *, sk)
__field(int, err)
__field(unsigned int, netns_ino)
),
TP_fast_assign(
__entry->req = req;
__entry->sk = sk;
__entry->err = err;
__entry->netns_ino = net->ns.inum;
),
TP_printk("req=%p sk=%p err=%d",
__entry->req, __entry->sk, __entry->err
)
);
#define DEFINE_HANDSHAKE_ERROR(name) …
DECLARE_EVENT_CLASS(handshake_alert_class,
TP_PROTO(
const struct sock *sk,
unsigned char level,
unsigned char description
),
TP_ARGS(sk, level, description),
TP_STRUCT__entry(
__array(__u8, saddr, sizeof(struct sockaddr_in6))
__array(__u8, daddr, sizeof(struct sockaddr_in6))
__field(unsigned int, netns_ino)
__field(unsigned long, level)
__field(unsigned long, description)
),
TP_fast_assign(
const struct inet_sock *inet = inet_sk(sk);
memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
TP_STORE_ADDR_PORTS(__entry, inet, sk);
__entry->netns_ino = sock_net(sk)->ns.inum;
__entry->level = level;
__entry->description = description;
),
TP_printk("src=%pISpc dest=%pISpc %s: %s",
__entry->saddr, __entry->daddr,
show_tls_alert_level(__entry->level),
show_tls_alert_description(__entry->description)
)
);
#define DEFINE_HANDSHAKE_ALERT(name) …
DEFINE_HANDSHAKE_EVENT(handshake_submit);
DEFINE_HANDSHAKE_ERROR(handshake_submit_err);
DEFINE_HANDSHAKE_EVENT(handshake_cancel);
DEFINE_HANDSHAKE_EVENT(handshake_cancel_none);
DEFINE_HANDSHAKE_EVENT(handshake_cancel_busy);
DEFINE_HANDSHAKE_EVENT(handshake_destruct);
TRACE_EVENT(handshake_complete,
TP_PROTO(
const struct net *net,
const struct handshake_req *req,
const struct sock *sk,
int status
),
TP_ARGS(net, req, sk, status),
TP_STRUCT__entry(
__field(const void *, req)
__field(const void *, sk)
__field(int, status)
__field(unsigned int, netns_ino)
),
TP_fast_assign(
__entry->req = req;
__entry->sk = sk;
__entry->status = status;
__entry->netns_ino = net->ns.inum;
),
TP_printk("req=%p sk=%p status=%d",
__entry->req, __entry->sk, __entry->status
)
);
DEFINE_HANDSHAKE_ERROR(handshake_notify_err);
DEFINE_HANDSHAKE_FD_EVENT(handshake_cmd_accept);
DEFINE_HANDSHAKE_ERROR(handshake_cmd_accept_err);
DEFINE_HANDSHAKE_FD_EVENT(handshake_cmd_done);
DEFINE_HANDSHAKE_ERROR(handshake_cmd_done_err);
TRACE_EVENT(tls_contenttype,
TP_PROTO(
const struct sock *sk,
unsigned char type
),
TP_ARGS(sk, type),
TP_STRUCT__entry(
__array(__u8, saddr, sizeof(struct sockaddr_in6))
__array(__u8, daddr, sizeof(struct sockaddr_in6))
__field(unsigned int, netns_ino)
__field(unsigned long, type)
),
TP_fast_assign(
const struct inet_sock *inet = inet_sk(sk);
memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
TP_STORE_ADDR_PORTS(__entry, inet, sk);
__entry->netns_ino = sock_net(sk)->ns.inum;
__entry->type = type;
),
TP_printk("src=%pISpc dest=%pISpc %s",
__entry->saddr, __entry->daddr,
show_tls_content_type(__entry->type)
)
);
DEFINE_HANDSHAKE_ALERT(tls_alert_send);
DEFINE_HANDSHAKE_ALERT(tls_alert_recv);
#endif
#include <trace/define_trace.h>