Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef _CCAPI_DEVICE_H_ |
michael@0 | 6 | #define _CCAPI_DEVICE_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include "ccapi_types.h" |
michael@0 | 9 | |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * Get device ID |
michael@0 | 13 | * @return cc_deviceinfo_ref_t - reference handle of the device |
michael@0 | 14 | */ |
michael@0 | 15 | cc_device_handle_t CCAPI_Device_getDeviceID(); |
michael@0 | 16 | |
michael@0 | 17 | /** |
michael@0 | 18 | * Get device reference handle |
michael@0 | 19 | * @param [in] id - device ID |
michael@0 | 20 | * @return cc_deviceinfo_ref_t - reference handle of the device |
michael@0 | 21 | * NOTE: The info returned by this method must be released using CCAPI_Device_releaseDeviceInfo() |
michael@0 | 22 | */ |
michael@0 | 23 | cc_deviceinfo_ref_t CCAPI_Device_getDeviceInfo(cc_device_handle_t id); |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Set full path of device configuration file. API will download and parse the config file using |
michael@0 | 27 | * provided location. |
michael@0 | 28 | * @param handle - device handle |
michael@0 | 29 | * @param [in] file_path - device config file full path |
michael@0 | 30 | * @return void |
michael@0 | 31 | */ |
michael@0 | 32 | void CCAPI_Device_configUpdate(cc_device_handle_t handle, file_path_t file_path); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * Retain the deviceInfo snapshot - this info shall not be freed until a |
michael@0 | 36 | * CCAPI_Device_releaseDeviceInfo() API releases this resource. |
michael@0 | 37 | * @param [in] ref - refrence to the block to be freed |
michael@0 | 38 | * @return void |
michael@0 | 39 | * NOTE: Application may use this API to retain the device info using this API inside |
michael@0 | 40 | * CCAPI_DeviceListener_onDeviceEvent() App must release the Info using |
michael@0 | 41 | * CCAPI_Device_releaseDeviceInfo() once it is done with it. |
michael@0 | 42 | */ |
michael@0 | 43 | void CCAPI_Device_retainDeviceInfo(cc_deviceinfo_ref_t ref); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Release the deviceInfo snapshot |
michael@0 | 47 | * @param [in] ref - reference to the block to be freed |
michael@0 | 48 | * @return void |
michael@0 | 49 | */ |
michael@0 | 50 | void CCAPI_Device_releaseDeviceInfo(cc_deviceinfo_ref_t ref); |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * Create a call on the device |
michael@0 | 54 | * Line selection is on the first available line. Lines that have there MNC reached will be skipped. |
michael@0 | 55 | * @param handle - device handle |
michael@0 | 56 | * @return cc_call_handle_t - handle of the call created |
michael@0 | 57 | */ |
michael@0 | 58 | cc_call_handle_t CCAPI_Device_CreateCall(cc_device_handle_t handle); |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * Enable or disable video capability of the device. |
michael@0 | 62 | * @param handle - device handle |
michael@0 | 63 | * @param [in] enable - a flag to indicate that application wants to enable of |
michael@0 | 64 | * disable video capability of the device. |
michael@0 | 65 | * @return void |
michael@0 | 66 | */ |
michael@0 | 67 | void CCAPI_Device_enableVideo(cc_device_handle_t handle, cc_boolean enable); |
michael@0 | 68 | |
michael@0 | 69 | /** |
michael@0 | 70 | * Enable or disable camera capability of the device. |
michael@0 | 71 | * @param handle - device handle |
michael@0 | 72 | * @param [in] enable - a flag to indicate that application wants to enable of |
michael@0 | 73 | * disable camera capability of the device. |
michael@0 | 74 | * @return void |
michael@0 | 75 | */ |
michael@0 | 76 | void CCAPI_Device_enableCamera(cc_device_handle_t handle, cc_boolean enable); |
michael@0 | 77 | |
michael@0 | 78 | |
michael@0 | 79 | /** |
michael@0 | 80 | * CCAPI_Device_setDigestNamePasswd |
michael@0 | 81 | * |
michael@0 | 82 | * @param handle - device handle |
michael@0 | 83 | * @param name - The Digest auth name |
michael@0 | 84 | * @param passwd - The password for that name for the line |
michael@0 | 85 | * @return void |
michael@0 | 86 | */ |
michael@0 | 87 | void CCAPI_Device_setDigestNamePasswd (cc_device_handle_t handle, |
michael@0 | 88 | char *name, char *pw); |
michael@0 | 89 | |
michael@0 | 90 | |
michael@0 | 91 | /** |
michael@0 | 92 | * CCAPI_Device_IP_Update |
michael@0 | 93 | * |
michael@0 | 94 | * There is a update in the IP address and the values of new set |
michael@0 | 95 | * of signaling and media IP addresses are provided. |
michael@0 | 96 | * These value are compared with the current IP address values |
michael@0 | 97 | * and depending on what changed, restart and/or re-invite |
michael@0 | 98 | * action is taken. |
michael@0 | 99 | * |
michael@0 | 100 | * The case being addressed. |
michael@0 | 101 | * 1) If the signaling IP change happens during a call, |
michael@0 | 102 | * the change is deferred till phone is idle. |
michael@0 | 103 | * 2)If media IP change happens during a call, it is applied immediately. |
michael@0 | 104 | * 3) If both change, and call is active, that is treated same |
michael@0 | 105 | * combination of case 1) and 2). |
michael@0 | 106 | * 4) If no call is present, and signaling IP change, |
michael@0 | 107 | * sipcc will re-register with new IP. |
michael@0 | 108 | * |
michael@0 | 109 | * @param handle - device handle |
michael@0 | 110 | * @param signaling_ip - IP address that Must be used for signalling |
michael@0 | 111 | * @param signaling_interface - Interface name associated with signaling IP |
michael@0 | 112 | * @param signaling_int_type - Interface Type associated with signaling IP |
michael@0 | 113 | * @param media_ip - IP address that Must be used for media |
michael@0 | 114 | * @param media_interface - Interface name associated with Media IP |
michael@0 | 115 | * @param media_int_type - Interface Type associated with Media IP |
michael@0 | 116 | * @return void |
michael@0 | 117 | */ |
michael@0 | 118 | void CCAPI_Device_IP_Update (cc_device_handle_t handle, |
michael@0 | 119 | const char *signaling_ip, |
michael@0 | 120 | const char *sig_interface, |
michael@0 | 121 | int sig_int_type, |
michael@0 | 122 | const char *media_ip, |
michael@0 | 123 | const char *media_interface, |
michael@0 | 124 | int media_int_type); |
michael@0 | 125 | |
michael@0 | 126 | |
michael@0 | 127 | /** |
michael@0 | 128 | * CCAPI_Device_setVideoAutoTxPreference |
michael@0 | 129 | * |
michael@0 | 130 | * @param handle - device handle |
michael@0 | 131 | * @param txPref - TRUE=> auto Tx Video prefered |
michael@0 | 132 | * @return void |
michael@0 | 133 | */ |
michael@0 | 134 | void CCAPI_Device_setVideoAutoTxPreference (cc_device_handle_t handle, cc_boolean txPref); |
michael@0 | 135 | |
michael@0 | 136 | #endif /* _CCAPIAPI_DEVICE_H_ */ |