:orphan: .. index:: pair: group; Test API to control the storage server .. _doxid-group__tapi__storage__server: Test API to control the storage server ====================================== .. toctree:: :hidden: struct_tapi_storage_server.rst struct_tapi_storage_server_methods.rst Overview ~~~~~~~~ Generic server functions for storage server. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef struct :ref:`tapi_storage_server` :target:`tapi_storage_server`; typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_enable`)(tapi_storage_server *server); typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_disable`)(tapi_storage_server *server); typedef bool (*:ref:`tapi_storage_server_method_is_enabled`)(tapi_storage_server *server); typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_add_storage`)( tapi_storage_server *server, const char *storage_name ); typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_add_share`)( tapi_storage_server *server, const char *storage, const char *path ); typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_del_share`)( tapi_storage_server *server, const char *storage, const char *path ); typedef :ref:`te_errno` (*:ref:`tapi_storage_server_method_get_share`)( tapi_storage_server *server, tapi_storage_share_list *share ); typedef struct :ref:`tapi_storage_server_methods` :ref:`tapi_storage_server_methods`; // structs struct :ref:`tapi_storage_server`; struct :ref:`tapi_storage_server_methods`; // global functions static :ref:`te_errno` :ref:`tapi_storage_server_enable`(:ref:`tapi_storage_server`* server); static :ref:`te_errno` :ref:`tapi_storage_server_disable`(:ref:`tapi_storage_server`* server); static bool :ref:`tapi_storage_server_is_enabled`(:ref:`tapi_storage_server`* server); static :ref:`te_errno` :ref:`tapi_storage_server_add_storage`(:ref:`tapi_storage_server`* server, const char* storage_name); static :ref:`te_errno` :ref:`tapi_storage_server_add_share`(:ref:`tapi_storage_server`* server, const char* storage, const char* path); static :ref:`te_errno` :ref:`tapi_storage_server_del_share`(:ref:`tapi_storage_server`* server, const char* storage, const char* path); static :ref:`te_errno` :ref:`tapi_storage_server_get_share`(:ref:`tapi_storage_server`* server, tapi_storage_share_list* share); :ref:`te_errno` :ref:`tapi_storage_server_init`(:ref:`tapi_storage_service_type` type, :ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_storage_server_methods`* methods, :ref:`tapi_storage_auth_params`* auth, void* context, :ref:`tapi_storage_server`* server); void :ref:`tapi_storage_server_fini`(:ref:`tapi_storage_server`* server); // macros #define :ref:`TAPI_STORAGE_SERVER_INIT` .. _details-group__tapi__storage__server: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Generic server functions for storage server. Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved. Typedefs -------- .. index:: pair: typedef; tapi_storage_server_method_enable .. _doxid-group__tapi__storage__server_1ga45643b187960605fc55fc3eac9784e2c: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_enable)(tapi_storage_server *server) Enable a storage server. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: Status code. .. index:: pair: typedef; tapi_storage_server_method_disable .. _doxid-group__tapi__storage__server_1ga587ef8fba3a5c0d6b7456762c0088872: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_disable)(tapi_storage_server *server) Disable a storage server. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: Status code. .. index:: pair: typedef; tapi_storage_server_method_is_enabled .. _doxid-group__tapi__storage__server_1ga76f52d932a8c2a1dfd555dbc8cb30708: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef bool (*tapi_storage_server_method_is_enabled)(tapi_storage_server *server) Check if server enabled or not. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: ``true`` if server is enabled. .. index:: pair: typedef; tapi_storage_server_method_add_storage .. _doxid-group__tapi__storage__server_1ga20ef818312fef2731cc24fa578342464: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_add_storage)( tapi_storage_server *server, const char *storage_name ) Add a storage to the share, i.e. it looks for storage with specified name, gets appropriate mount point and adds the last one to the share list. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage_name - Name of the storage. .. rubric:: Returns: Status code. .. index:: pair: typedef; tapi_storage_server_method_add_share .. _doxid-group__tapi__storage__server_1ga94858ae157d1659dcc66a3cd0b6a4438: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_add_share)( tapi_storage_server *server, const char *storage, const char *path ) Add a directory to storage share. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage - Storage device can be represented by name, mount point, etc. depends on server implementation. May be ``NULL``. * - path - Directory pathname on the ``storage`` to be shared if storage is not ``NULL``, or full path if storage is ``NULL``. May be ``NULL`` if it is required to add all storage data to share. .. rubric:: Returns: Status code. .. index:: pair: typedef; tapi_storage_server_method_del_share .. _doxid-group__tapi__storage__server_1gae6b9ccf1ec6d25ae9f5e3f079982503d: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_del_share)( tapi_storage_server *server, const char *storage, const char *path ) Delete directory from storage sharing. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage - Storage device can be represented by name, mount point, etc. depends on server implementation. May be ``NULL``. * - path - Directory pathname on the ``storage`` to be removed from the sharing list if storage is not ``NULL``, or full path if storage is ``NULL``. May be ``NULL`` if trere are all storage data is shared. .. rubric:: Returns: Status code. .. index:: pair: typedef; tapi_storage_server_method_get_share .. _doxid-group__tapi__storage__server_1ga3178f947466816975a3252eb3b5f54eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tapi_storage_server_method_get_share)( tapi_storage_server *server, tapi_storage_share_list *share ) Get shared directories list. ``share`` should be freed by user with ``tapi_storage_share_list_free`` when it is no longer needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - share - List of shared directories. .. rubric:: Returns: Status code. .. rubric:: See also: :ref:`tapi_storage_share_list_free ` .. index:: pair: typedef; tapi_storage_server_methods .. _doxid-group__tapi__storage__server_1ga2cd834c9f00bf21811f2cc394faa7040: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_storage_server_methods` tapi_storage_server_methods Methods to operate the server. Global Functions ---------------- .. index:: pair: function; tapi_storage_server_enable .. _doxid-group__tapi__storage__server_1gadb030139ab84782e82c43399a2e0c997: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_enable(:ref:`tapi_storage_server`* server) Enable a storage server. Server should be disabled with ``tapi_storage_server_disable`` when it is no longer needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: Status code. .. rubric:: See also: :ref:`tapi_storage_server_disable ` .. index:: pair: function; tapi_storage_server_disable .. _doxid-group__tapi__storage__server_1ga8b48ab90e1a8886dab1154aa55930613: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_disable(:ref:`tapi_storage_server`* server) Disable a storage server that was enabled with ``tapi_storage_server_enable``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: Status code. .. rubric:: See also: :ref:`tapi_storage_server_enable ` .. index:: pair: function; tapi_storage_server_is_enabled .. _doxid-group__tapi__storage__server_1ga035f424b1178e7580e3751b0fe039482: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool tapi_storage_server_is_enabled(:ref:`tapi_storage_server`* server) Check if server enabled or not. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: Returns: ``true`` if server is enabled. .. index:: pair: function; tapi_storage_server_add_storage .. _doxid-group__tapi__storage__server_1ga9d8482c4e06ad13614fea5828723bd5c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_add_storage(:ref:`tapi_storage_server`* server, const char* storage_name) Add a storage to the share, i.e. it looks for storage with specified name, gets appropriate mount point and adds the last one to the share list. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage_name - Name of the storage. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_storage_server_add_share .. _doxid-group__tapi__storage__server_1ga4d501ea067a118382eab437d6ac0a52a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_add_share(:ref:`tapi_storage_server`* server, const char* storage, const char* path) Add a directory to storage share. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage - Storage device can be represented by name, mount point, etc. depends on server implementation. May be ``NULL``. * - path - Directory pathname on the ``storage`` to be shared if storage is not ``NULL``, or full path if storage is ``NULL``. May be ``NULL`` if it is required to add all storage data to share. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_storage_server_del_share .. _doxid-group__tapi__storage__server_1ga524adb7d3c3a57ebe59c3685dc9afd6f: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_del_share(:ref:`tapi_storage_server`* server, const char* storage, const char* path) Delete directory from storage sharing. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - storage - Storage device can be represented by name, mount point, etc. depends on server implementation. May be ``NULL``. * - path - Directory pathname on the ``storage`` to be removed from the sharing list if storage is not ``NULL``, or full path if storage is ``NULL``. May be ``NULL`` if trere are all storage data is shared. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_storage_server_get_share .. _doxid-group__tapi__storage__server_1ga15601bdc563bc80540dbc5487524c13a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`te_errno` tapi_storage_server_get_share(:ref:`tapi_storage_server`* server, tapi_storage_share_list* share) Get shared directories list. ``share`` should be freed by user with ``tapi_storage_share_list_free`` when it is no longer needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. * - share - List of shared directories. .. rubric:: Returns: Status code. .. rubric:: See also: :ref:`tapi_storage_share_list_free ` .. index:: pair: function; tapi_storage_server_init .. _doxid-group__tapi__storage__server_1gad5b2448f9c361ceb2348ebe236671662: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_storage_server_init(:ref:`tapi_storage_service_type` type, :ref:`rcf_rpc_server`* rpcs, const :ref:`tapi_storage_server_methods`* methods, :ref:`tapi_storage_auth_params`* auth, void* context, :ref:`tapi_storage_server`* server) Initialize server handle. Server should be released with ``tapi_storage_server_fini`` when it is no longer needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - type - Back-end server type. * - rpcs - RPC server handle. * - methods - Back-end server specific methods. * - auth - Back-end server specific authorization parameters. May be ``NULL``. * - context - Back-end server specific context. Don't free the ``context`` before finishing work with ``server``. * - server - Server handle. .. rubric:: Returns: Status code. .. rubric:: See also: :ref:`tapi_storage_server_fini ` .. index:: pair: function; tapi_storage_server_fini .. _doxid-group__tapi__storage__server_1gadacd41236a11dd34450a45e9c45672e8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_storage_server_fini(:ref:`tapi_storage_server`* server) Release server that was initialized with ``tapi_storage_server_init``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - server - Server handle. .. rubric:: See also: :ref:`tapi_storage_server_init ` Macros ------ .. index:: pair: define; TAPI_STORAGE_SERVER_INIT .. _doxid-group__tapi__storage__server_1gac8a1d358ba2ff72ff301f813a1d6f909: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_STORAGE_SERVER_INIT On-stack :ref:`tapi_storage_server ` structure initializer.