]> gitweb.factorcode.org Git - factor.git/blob - extra/libtls/ffi/ffi.factor
a36a211b202feae0663e6039a14c1f669ca3e287
[factor.git] / extra / libtls / ffi / ffi.factor
1 USING: alien alien.c-types alien.destructors alien.libraries
2 alien.syntax combinators io.sockets.secure system unix.types ;
3
4 IN: libtls.ffi
5
6 << "libtls" {
7     { [ os windows? ] [ "libtls-10.dll" ] }
8     { [ os macosx? ] [ "libtls.dylib" ] }
9     { [ os unix? ] [ "libtls.so" ] }
10 } cond cdecl add-library >>
11
12 C-TYPE: tls_config
13 C-TYPE: tls_ctx
14
15 LIBRARY: libtls
16
17 FUNCTION: int tls_init ( )
18 FUNCTION: c-string tls_error ( tls_ctx* ctx )
19 FUNCTION: tls_config*  tls_config_new ( )
20 FUNCTION: void tls_config_free ( tls_config* config )
21 FUNCTION: int tls_config_parse_protocols ( uint32_t* protocols, c-string protostr )
22 FUNCTION: int tls_config_set_ca_file ( tls_config* config, c-string ca_file )
23 FUNCTION: int tls_config_set_ca_path ( tls_config* config, c-string ca_path )
24 FUNCTION: int tls_config_set_ca_mem ( tls_config* config, uint8_t *cert, size_t len )
25 FUNCTION: int tls_config_set_cert_file ( tls_config* config, c-string cert_file )
26 FUNCTION: int tls_config_set_cert_mem ( tls_config* config, uint8_t *cert, size_t len )
27 FUNCTION: int tls_config_set_ciphers ( tls_config* config, c-string ciphers )
28 FUNCTION: int tls_config_set_dheparams ( tls_config* config, c-string params )
29 FUNCTION: int tls_config_set_ecdhecurve ( tls_config* config, c-string name )
30 FUNCTION: int tls_config_set_key_file ( tls_config* config, c-string key_file )
31 FUNCTION: int tls_config_set_key_mem ( tls_config* config, uint8_t *key, size_t len )
32 FUNCTION: void tls_config_set_protocols ( tls_config* config, uint32_t protocols )
33 FUNCTION: void tls_config_set_verify_depth ( tls_config* config, int verify_depth )
34 FUNCTION: void tls_config_prefer_ciphers_client ( tls_config* config )
35 FUNCTION: void tls_config_prefer_ciphers_server ( tls_config* config )
36 FUNCTION: void tls_config_clear_keys ( tls_config* config )
37 FUNCTION: void tls_config_insecure_noverifycert ( tls_config* config )
38 FUNCTION: void tls_config_insecure_noverifyname ( tls_config* config )
39 FUNCTION: void tls_config_insecure_noverifytime ( tls_config* config )
40 FUNCTION: void tls_config_verify ( tls_config* config )
41 FUNCTION: void tls_config_verify_client ( tls_config* config )
42 FUNCTION: void tls_config_verify_client_optional ( tls_config* config )
43 FUNCTION: int tls_peer_cert_provided ( tls_ctx* ctx )
44 FUNCTION: int tls_peer_cert_contains_name ( tls_ctx* ctx, c-string name )
45 FUNCTION: c-string  tls_peer_cert_issuer ( tls_ctx* ctx )
46 FUNCTION: c-string  tls_peer_cert_subject ( tls_ctx* ctx )
47 FUNCTION: c-string  tls_peer_cert_hash ( tls_ctx* ctx )
48 FUNCTION: time_t tls_peer_cert_notbefore ( tls_ctx* ctx )
49 FUNCTION: time_t tls_peer_cert_notafter ( tls_ctx* ctx )
50 FUNCTION: c-string  tls_conn_version ( tls_ctx* ctx )
51 FUNCTION: c-string  tls_conn_cipher ( tls_ctx* ctx )
52 FUNCTION: uint8_t* tls_load_file ( c-string file, size_t *len, char *password )
53 FUNCTION: tls_ctx* tls_client ( )
54 FUNCTION: tls_ctx* tls_server ( )
55 FUNCTION: int tls_configure ( tls_ctx* ctx, tls_config* config )
56 FUNCTION: void tls_reset ( tls_ctx* ctx )
57 FUNCTION: void tls_free ( tls_ctx* ctx )
58 FUNCTION: int tls_connect ( tls_ctx* ctx, c-string host, c-string port )
59 FUNCTION: int tls_connect_fds ( tls_ctx* ctx, int fd_read, int fd_write, c-string servername )
60 FUNCTION: int tls_connect_servername ( tls_ctx* ctx, c-string host, c-string port, c-string servername )
61 FUNCTION: int tls_connect_socket ( tls_ctx* ctx, int s, c-string servername )
62 FUNCTION: int tls_accept_fds ( tls_ctx* tls, tls_ctx* *cctx, int fd_read, int fd_write )
63 FUNCTION: int tls_accept_socket ( tls_ctx* tls, tls_ctx* *cctx, int socket )
64 FUNCTION: int tls_handshake ( tls_ctx* ctx )
65 FUNCTION: ssize_t tls_read ( tls_ctx* ctx, void* buf, size_t buflen )
66 FUNCTION: ssize_t tls_write ( tls_ctx* ctx, void* buf, size_t buflen )
67 FUNCTION: int tls_close ( tls_ctx* ctx )
68
69 DESTRUCTOR: tls_config_free
70 DESTRUCTOR: tls_free