X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/c38e3ce98599a410a47dc10253faa4d5830f13b2..427c49bcad63d042b29ada2ac27e3dfc4845c779:/tlsnke/tlsnketest/tlssocket.h diff --git a/tlsnke/tlsnketest/tlssocket.h b/tlsnke/tlsnketest/tlssocket.h new file mode 100644 index 00000000..3d43df16 --- /dev/null +++ b/tlsnke/tlsnketest/tlssocket.h @@ -0,0 +1,43 @@ +// +// tlssocket.h +// tlsnke +// +// Created by Fabrice Gautier on 1/6/12. +// Copyright (c) 2012 Apple, Inc. All rights reserved. +// + +#ifndef __TLSSOCKET_H__ +#define __TLSSOCKET_H__ + +#include + +/* + Attach the TLS socket filter. + + This makes a socket a TLS socket by attaching the TLS socket filter to that socket. + Return a positive TLS handle or a negative error. + The return TLS handle can be used to route VPN data directly through this TLS + socket + */ +int TLSSocket_Attach(int socket); + +/* + Detach the TLS socket filter. + + Return 0 or negative error. + If the TLS Socket is used with SecureTransport, one should make sure + to tear down the SecureTransport session before calling this. + It is not required to use this, as closing the socket would have the same effect. +*/ +int TLSSocket_Detach(int socket); + +/* + Secure Transport Record Layer functions for TLS Sockets. + + To use SecureTransport with a TLS kernel socket, pass this to SSLSetRecordFuncs and + the socket descriptor to SSLSetRecordContext + */ +const struct SSLRecordFuncs TLSSocket_Funcs; + + +#endif