6 #include "tcplay_api.h"
14 error = tc_api_init(/* verbose */1);
17 memset(&api_opts, 0, sizeof(api_opts));
18 api_opts.tc_device = "/dev/vn1s0";
19 api_opts.tc_passphrase = "apitest2";
20 api_opts.tc_keyfiles = NULL;
21 api_opts.tc_keyfiles_hidden = NULL;
22 api_opts.tc_size_hidden_in_bytes = 12000*512;
23 api_opts.tc_passphrase_hidden = "apihidden";
24 api_opts.tc_cipher = "AES-256-XTS,TWOFISH-256-XTS,SERPENT-256-XTS";
25 api_opts.tc_cipher_hidden = "SERPENT-256-XTS,TWOFISH-256-XTS";
26 api_opts.tc_prf_hash = "whirlpool";
27 api_opts.tc_prf_hash_hidden = "RIPEMD160";
29 error = tc_api_create_volume(&api_opts);
31 printf("API ERROR: %s\n", tc_api_get_error_msg());
34 error = tc_api_uninit();
37 error = tc_api_init(/*verbose */ 1);
40 api_opts.tc_passphrase = NULL;
41 api_opts.tc_map_name = "dragonfly-test";
42 api_opts.tc_password_retries = 5;
43 api_opts.tc_interactive_prompt = 1;
44 api_opts.tc_prompt_timeout = 5;
45 error = tc_api_map_volume(&api_opts);
47 printf("API MAP ERROR: %s\n", tc_api_get_error_msg());
51 tc_api_unmap_volume(&api_opts);
53 error = tc_api_uninit();