diff options
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 6dab6683e42f..c664e6dba0d1 100644 --- a/include/net/tls.h +++ b/include/net/tls.h | |||
@@ -366,13 +366,9 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos, | |||
366 | struct pipe_inode_info *pipe, | 366 | struct pipe_inode_info *pipe, |
367 | size_t len, unsigned int flags); | 367 | size_t len, unsigned int flags); |
368 | 368 | ||
369 | int tls_set_device_offload(struct sock *sk, struct tls_context *ctx); | ||
370 | int tls_device_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); | 369 | int tls_device_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); |
371 | int tls_device_sendpage(struct sock *sk, struct page *page, | 370 | int tls_device_sendpage(struct sock *sk, struct page *page, |
372 | int offset, size_t size, int flags); | 371 | int offset, size_t size, int flags); |
373 | void tls_device_free_resources_tx(struct sock *sk); | ||
374 | void tls_device_init(void); | ||
375 | void tls_device_cleanup(void); | ||
376 | int tls_tx_records(struct sock *sk, int flags); | 372 | int tls_tx_records(struct sock *sk, int flags); |
377 | 373 | ||
378 | struct tls_record_info *tls_get_record(struct tls_offload_context_tx *context, | 374 | struct tls_record_info *tls_get_record(struct tls_offload_context_tx *context, |
@@ -649,7 +645,6 @@ int tls_proccess_cmsg(struct sock *sk, struct msghdr *msg, | |||
649 | unsigned char *record_type); | 645 | unsigned char *record_type); |
650 | void tls_register_device(struct tls_device *device); | 646 | void tls_register_device(struct tls_device *device); |
651 | void tls_unregister_device(struct tls_device *device); | 647 | void tls_unregister_device(struct tls_device *device); |
652 | int tls_device_decrypted(struct sock *sk, struct sk_buff *skb); | ||
653 | int decrypt_skb(struct sock *sk, struct sk_buff *skb, | 648 | int decrypt_skb(struct sock *sk, struct sk_buff *skb, |
654 | struct scatterlist *sgout); | 649 | struct scatterlist *sgout); |
655 | struct sk_buff *tls_encrypt_skb(struct sk_buff *skb); | 650 | struct sk_buff *tls_encrypt_skb(struct sk_buff *skb); |
@@ -662,9 +657,40 @@ int tls_sw_fallback_init(struct sock *sk, | |||
662 | struct tls_offload_context_tx *offload_ctx, | 657 | struct tls_offload_context_tx *offload_ctx, |
663 | struct tls_crypto_info *crypto_info); | 658 | struct tls_crypto_info *crypto_info); |
664 | 659 | ||
660 | #ifdef CONFIG_TLS_DEVICE | ||
661 | void tls_device_init(void); | ||
662 | void tls_device_cleanup(void); | ||
663 | int tls_set_device_offload(struct sock *sk, struct tls_context *ctx); | ||
664 | void tls_device_free_resources_tx(struct sock *sk); | ||
665 | int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx); | 665 | int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx); |
666 | |||
667 | void tls_device_offload_cleanup_rx(struct sock *sk); | 666 | void tls_device_offload_cleanup_rx(struct sock *sk); |
668 | void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq); | 667 | void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq); |
668 | int tls_device_decrypted(struct sock *sk, struct sk_buff *skb); | ||
669 | #else | ||
670 | static inline void tls_device_init(void) {} | ||
671 | static inline void tls_device_cleanup(void) {} | ||
669 | 672 | ||
673 | static inline int | ||
674 | tls_set_device_offload(struct sock *sk, struct tls_context *ctx) | ||
675 | { | ||
676 | return -EOPNOTSUPP; | ||
677 | } | ||
678 | |||
679 | static inline void tls_device_free_resources_tx(struct sock *sk) {} | ||
680 | |||
681 | static inline int | ||
682 | tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) | ||
683 | { | ||
684 | return -EOPNOTSUPP; | ||
685 | } | ||
686 | |||
687 | static inline void tls_device_offload_cleanup_rx(struct sock *sk) {} | ||
688 | static inline void | ||
689 | tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq) {} | ||
690 | |||
691 | static inline int tls_device_decrypted(struct sock *sk, struct sk_buff *skb) | ||
692 | { | ||
693 | return 0; | ||
694 | } | ||
695 | #endif | ||
670 | #endif /* _TLS_OFFLOAD_H */ | 696 | #endif /* _TLS_OFFLOAD_H */ |