]> git.saurik.com Git - apple/security.git/blob - tlsnke/tlsnketest/tlssocket.h
Security-55471.tar.gz
[apple/security.git] / tlsnke / tlsnketest / tlssocket.h
1 //
2 // tlssocket.h
3 // tlsnke
4 //
5 // Created by Fabrice Gautier on 1/6/12.
6 // Copyright (c) 2012 Apple, Inc. All rights reserved.
7 //
8
9 #ifndef __TLSSOCKET_H__
10 #define __TLSSOCKET_H__
11
12 #include <Security/SecureTransportPriv.h>
13
14 /*
15 Attach the TLS socket filter.
16
17 This makes a socket a TLS socket by attaching the TLS socket filter to that socket.
18 Return a positive TLS handle or a negative error.
19 The return TLS handle can be used to route VPN data directly through this TLS
20 socket
21 */
22 int TLSSocket_Attach(int socket);
23
24 /*
25 Detach the TLS socket filter.
26
27 Return 0 or negative error.
28 If the TLS Socket is used with SecureTransport, one should make sure
29 to tear down the SecureTransport session before calling this.
30 It is not required to use this, as closing the socket would have the same effect.
31 */
32 int TLSSocket_Detach(int socket);
33
34 /*
35 Secure Transport Record Layer functions for TLS Sockets.
36
37 To use SecureTransport with a TLS kernel socket, pass this to SSLSetRecordFuncs and
38 the socket descriptor to SSLSetRecordContext
39 */
40 const struct SSLRecordFuncs TLSSocket_Funcs;
41
42
43 #endif