diff options
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 437a746300bf..3da8e13a6d96 100644 --- a/include/net/tls.h +++ b/include/net/tls.h | |||
@@ -56,6 +56,32 @@ | |||
56 | #define TLS_RECORD_TYPE_DATA 0x17 | 56 | #define TLS_RECORD_TYPE_DATA 0x17 |
57 | 57 | ||
58 | #define TLS_AAD_SPACE_SIZE 13 | 58 | #define TLS_AAD_SPACE_SIZE 13 |
59 | #define TLS_DEVICE_NAME_MAX 32 | ||
60 | |||
61 | /* | ||
62 | * This structure defines the routines for Inline TLS driver. | ||
63 | * The following routines are optional and filled with a | ||
64 | * null pointer if not defined. | ||
65 | * | ||
66 | * @name: Its the name of registered Inline tls device | ||
67 | * @dev_list: Inline tls device list | ||
68 | * int (*feature)(struct tls_device *device); | ||
69 | * Called to return Inline TLS driver capability | ||
70 | * | ||
71 | * int (*hash)(struct tls_device *device, struct sock *sk); | ||
72 | * This function sets Inline driver for listen and program | ||
73 | * device specific functioanlity as required | ||
74 | * | ||
75 | * void (*unhash)(struct tls_device *device, struct sock *sk); | ||
76 | * This function cleans listen state set by Inline TLS driver | ||
77 | */ | ||
78 | struct tls_device { | ||
79 | char name[TLS_DEVICE_NAME_MAX]; | ||
80 | struct list_head dev_list; | ||
81 | int (*feature)(struct tls_device *device); | ||
82 | int (*hash)(struct tls_device *device, struct sock *sk); | ||
83 | void (*unhash)(struct tls_device *device, struct sock *sk); | ||
84 | }; | ||
59 | 85 | ||
60 | struct tls_sw_context { | 86 | struct tls_sw_context { |
61 | struct crypto_aead *aead_send; | 87 | struct crypto_aead *aead_send; |
@@ -114,7 +140,7 @@ struct tls_context { | |||
114 | 140 | ||
115 | void *priv_ctx; | 141 | void *priv_ctx; |
116 | 142 | ||
117 | u8 conf:2; | 143 | u8 conf:3; |
118 | 144 | ||
119 | struct cipher_context tx; | 145 | struct cipher_context tx; |
120 | struct cipher_context rx; | 146 | struct cipher_context rx; |
@@ -135,6 +161,8 @@ struct tls_context { | |||
135 | int (*getsockopt)(struct sock *sk, int level, | 161 | int (*getsockopt)(struct sock *sk, int level, |
136 | int optname, char __user *optval, | 162 | int optname, char __user *optval, |
137 | int __user *optlen); | 163 | int __user *optlen); |
164 | int (*hash)(struct sock *sk); | ||
165 | void (*unhash)(struct sock *sk); | ||
138 | }; | 166 | }; |
139 | 167 | ||
140 | int wait_on_pending_writer(struct sock *sk, long *timeo); | 168 | int wait_on_pending_writer(struct sock *sk, long *timeo); |
@@ -283,5 +311,7 @@ static inline struct tls_offload_context *tls_offload_ctx( | |||
283 | 311 | ||
284 | int tls_proccess_cmsg(struct sock *sk, struct msghdr *msg, | 312 | int tls_proccess_cmsg(struct sock *sk, struct msghdr *msg, |
285 | unsigned char *record_type); | 313 | unsigned char *record_type); |
314 | void tls_register_device(struct tls_device *device); | ||
315 | void tls_unregister_device(struct tls_device *device); | ||
286 | 316 | ||
287 | #endif /* _TLS_OFFLOAD_H */ | 317 | #endif /* _TLS_OFFLOAD_H */ |