net/tls: add skeleton of MIB statistics
Add a skeleton structure for adding TLS statistics. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9ec1c6ac27
commit
d26b698dd3
8 changed files with 110 additions and 1 deletions
|
|
@ -24,6 +24,9 @@ struct netns_mib {
|
|||
#ifdef CONFIG_XFRM_STATISTICS
|
||||
DEFINE_SNMP_STAT(struct linux_xfrm_mib, xfrm_statistics);
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_TLS)
|
||||
DEFINE_SNMP_STAT(struct linux_tls_mib, tls_statistics);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -111,6 +111,12 @@ struct linux_xfrm_mib {
|
|||
unsigned long mibs[LINUX_MIB_XFRMMAX];
|
||||
};
|
||||
|
||||
/* Linux TLS */
|
||||
#define LINUX_MIB_TLSMAX __LINUX_MIB_TLSMAX
|
||||
struct linux_tls_mib {
|
||||
unsigned long mibs[LINUX_MIB_TLSMAX];
|
||||
};
|
||||
|
||||
#define DEFINE_SNMP_STAT(type, name) \
|
||||
__typeof__(type) __percpu *name
|
||||
#define DEFINE_SNMP_STAT_ATOMIC(type, name) \
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <net/net_namespace.h>
|
||||
#include <net/tcp.h>
|
||||
#include <net/strparser.h>
|
||||
#include <crypto/aead.h>
|
||||
|
|
@ -73,6 +74,15 @@
|
|||
*/
|
||||
#define TLS_AES_CCM_IV_B0_BYTE 2
|
||||
|
||||
#define __TLS_INC_STATS(net, field) \
|
||||
__SNMP_INC_STATS((net)->mib.tls_statistics, field)
|
||||
#define TLS_INC_STATS(net, field) \
|
||||
SNMP_INC_STATS((net)->mib.tls_statistics, field)
|
||||
#define __TLS_DEC_STATS(net, field) \
|
||||
__SNMP_DEC_STATS((net)->mib.tls_statistics, field)
|
||||
#define TLS_DEC_STATS(net, field) \
|
||||
SNMP_DEC_STATS((net)->mib.tls_statistics, field)
|
||||
|
||||
enum {
|
||||
TLS_BASE,
|
||||
TLS_SW,
|
||||
|
|
@ -605,6 +615,9 @@ static inline bool tls_offload_tx_resync_pending(struct sock *sk)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int __net_init tls_proc_init(struct net *net);
|
||||
void __net_exit tls_proc_fini(struct net *net);
|
||||
|
||||
int tls_proccess_cmsg(struct sock *sk, struct msghdr *msg,
|
||||
unsigned char *record_type);
|
||||
int decrypt_skb(struct sock *sk, struct sk_buff *skb,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue