diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2025-04-28 09:50:16 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-04-28 09:50:16 +0200 |
| commit | 30f142dd2ab096eeb80354690b754a452ba471cd (patch) | |
| tree | efc5ff711f46d7a25fe1f37d4d11f1d635fe5bf2 /ios/MullvadRustRuntime | |
| parent | 045a5c33f140945072e42553939adcf7bace52c1 (diff) | |
| parent | 96444846bf5b741483c371a763cb1e9c6a1e7b8d (diff) | |
| download | mullvadvpn-30f142dd2ab096eeb80354690b754a452ba471cd.tar.xz mullvadvpn-30f142dd2ab096eeb80354690b754a452ba471cd.zip | |
Merge branch 'use-mullvad-api-to-implement-a-devicehandling-ios-1103'
Diffstat (limited to 'ios/MullvadRustRuntime')
| -rw-r--r-- | ios/MullvadRustRuntime/include/mullvad_rust_runtime.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h b/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h index 6300b04902..b4f4a65e2f 100644 --- a/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h +++ b/ios/MullvadRustRuntime/include/mullvad_rust_runtime.h @@ -361,6 +361,119 @@ extern void mullvad_api_completion_finish(struct SwiftMullvadApiResponse respons struct CompletionCookie completion_cookie); /** + * Get device info via the Mullvad API client. + * + * # Safety + * + * `api_context` must be pointing to a valid instance of `SwiftApiContext`. A `SwiftApiContext` is created + * by calling `mullvad_ios_init_new`. + * + * This function takes ownership of `completion_cookie`, which must be pointing to a valid instance of Swift + * object `MullvadApiCompletion`. The pointer will be freed by calling `mullvad_ios_completion_finish` + * when completion finishes (in completion.finish). + * + * the `account_number` must be a pointer to a null terminated string. + * the `identifier` must be a pointer to a null terminated string. + * + * This function is not safe to call multiple times with the same `CompletionCookie`. + */ +struct SwiftCancelHandle mullvad_ios_get_device(struct SwiftApiContext api_context, + void *completion_cookie, + struct SwiftRetryStrategy retry_strategy, + const char *account_number, + const char *identifier); + +/** + * Get devices info via the Mullvad API client. + * + * # Safety + * + * `api_context` must be pointing to a valid instance of `SwiftApiContext`. A `SwiftApiContext` is created + * by calling `mullvad_api_init_new`. + * + * This function takes ownership of `completion_cookie`, which must be pointing to a valid instance of Swift + * object `MullvadApiCompletion`. The pointer will be freed by calling `mullvad_api_completion_finish` + * when completion finishes (in completion.finish). + * + * the `account_number` must be a pointer to a null terminated string. + * + * This function is not safe to call multiple times with the same `CompletionCookie`. + */ +struct SwiftCancelHandle mullvad_ios_get_devices(struct SwiftApiContext api_context, + void *completion_cookie, + struct SwiftRetryStrategy retry_strategy, + const char *account_number); + +/** + * create device via the Mullvad API client. + * + * # Safety + * + * `api_context` must be pointing to a valid instance of `SwiftApiContext`. A `SwiftApiContext` is created + * by calling `mullvad_api_init_new`. + * + * This function takes ownership of `completion_cookie`, which must be pointing to a valid instance of Swift + * object `MullvadApiCompletion`. The pointer will be freed by calling `mullvad_api_completion_finish` + * when completion finishes (in completion.finish). + * + * the `account_number` must be a pointer to a null terminated string. + * the `identifier` must be a pointer to a null terminated string. + * the `public_key` pointer must be a valid pointer to 32 unsigned bytes. + * This function is not safe to call multiple times with the same `CompletionCookie`. + */ +struct SwiftCancelHandle mullvad_ios_create_device(struct SwiftApiContext api_context, + void *completion_cookie, + struct SwiftRetryStrategy retry_strategy, + const char *account_number, + const uint8_t *public_key); + +/** + * delete device via the Mullvad API client. + * + * # Safety + * + * `api_context` must be pointing to a valid instance of `SwiftApiContext`. A `SwiftApiContext` is created + * by calling `mullvad_api_init_new`. + * + * This function takes ownership of `completion_cookie`, which must be pointing to a valid instance of Swift + * object `MullvadApiCompletion`. The pointer will be freed by calling `mullvad_api_completion_finish` + * when completion finishes (in completion.finish). + * + * the `account_number` must be a pointer to a null terminated string. + * the `identifier` must be a pointer to a null terminated string. + * This function is not safe to call multiple times with the same `CompletionCookie`. + */ +struct SwiftCancelHandle mullvad_ios_delete_device(struct SwiftApiContext api_context, + void *completion_cookie, + struct SwiftRetryStrategy retry_strategy, + const char *account_number, + const char *identifier); + +/** + * rotate device key via the Mullvad API client. + * + * # Safety + * + * `api_context` must be pointing to a valid instance of `SwiftApiContext`. A `SwiftApiContext` is created + * by calling `mullvad_api_init_new`. + * + * This function takes ownership of `completion_cookie`, which must be pointing to a valid instance of Swift + * object `MullvadApiCompletion`. The pointer will be freed by calling `mullvad_api_completion_finish` + * when completion finishes (in completion.finish). + * + * the `account_number` must be a pointer to a null terminated string. + * the `identifier` must be a pointer to a null terminated string. + * the `public_key` pointer must be a valid pointer to 32 unsigned bytes. + * This function is not safe to call multiple times with the same `CompletionCookie`. + */ +struct SwiftCancelHandle mullvad_ios_rotate_device_key(struct SwiftApiContext api_context, + void *completion_cookie, + struct SwiftRetryStrategy retry_strategy, + const char *account_number, + const char *identifier, + const uint8_t *public_key); + +/** * Converts parameters into a boxed `Shadowsocks` configuration that is safe * to send across the FFI boundary * |
