RDK Documentation (Open Sourced RDK Components)
Service_Storage.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file Service_Storage.h
22  * @brief The header file provides storage service information APIs.
23  */
24 
25 /**
26  * @defgroup TR69_HOSTIF_STORAGE TR-069 Object (Device.StorageService)
27  *
28  * TR-069 Data Model for Storage Service Devices, permits the remote
29  * management of Storage Service devices via CWMP . It covers the data model for describing
30  * a Storage Service device as well as rules regarding notifications on parameter value change.
31  * General use cases are also described including standard data model profiles that would
32  * typically be seen while remotely managing a device of this nature.
33  *
34  * @par Basic Managed Storage Service
35  * A basic managed storage service offers a Service Provider the option to assist the
36  * customer as soon as the customer’s StorageService-enabled device is activated and being
37  * managed by the ACS.
38  *
39  * The following is a sample list of support capabilities an ACS can
40  * provide using CWMP (NOTE: Not all of these capabilities are handled with this data
41  * model; some are handled from a protocol perspective and some are handled via other data
42  * models):
43  * - Basic configuration and setup during device activation [addressed by this document
44  * (configuration parameters) & TR-106 (configuration parameters)]
45  * - User credentials setup and file privilege access [addressed by this document (Folder
46  * Access)]
47  * - Firmware upgrade [addressed by TR-069 (Download command)]
48  * - Retrieval of device status [addressed by this document (parameters) and TR-106]
49  * - Wireless setup (e.g., WEP security) for a Storage Service device with Wi-Fi access
50  * [addressed by a future version of TR-106]
51  * - Configuration and log file retrieval for root cause analysis of problems [addressed by
52  * a future version of TR-106]
53  * - Monitoring active/passive notification events, e.g., volume capacity reached, and
54  * potential physical media failures [addressed by this document (parameters) and TR-
55  * 069 (notification mechanism)]
56  * - Network diagnostics and troubleshooting, e.g., network connectivity to the Internet
57  * gateway device, and to the Internet [addressed by TR-106 (connection parameters)]
58  * With such support capabilities from the ACS, a technical support agent will be better
59  * equipped to help a customer with Storage Service issues during trouble calls. The goal
60  * is to provide a true “plug-and-play” solution for the customers.
61  * @ingroup TR69_HOSTIF_PROFILE
62  *
63  * @defgroup TR69_HOSTIF_STORAGE_SERVICE TR-069 Object (Device.StorageService.Interface)
64  * The Service Object for a Storage Service device.
65  * At most one entry in this table can exist with a given value for Alias.
66  * @note Alias
67  * is a non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to
68  * label this instance for future reference.
69  *
70  * If the CPE supports the Alias-based Addressing feature the following mandatory constraints MUST be enforced:
71  * - Its value MUST NOT be empty.
72  * - Its value MUST start with a letter.
73  * If its value is not assigned by the ACS, it MUST start with a 'cpe-' prefix.
74  * The CPE MUST NOT change the parameter value.
75  *
76  * @par The overall capabilities of a Storage Service device.
77  * This is a constant read-only object, meaning that only a firmware upgrade will cause these
78  * values to be altered.
79  *
80  * @ingroup TR69_HOSTIF_STORAGE
81  *
82  * @defgroup TR69_HOSTIF_STORAGE_SERVICE_API TR-069 Object (Device.StorageService.Interface.{i}) Public APIs
83  * Describe the details about RDK TR-069 storage service APIs specifications.
84  * @ingroup TR69_HOSTIF_STORAGE_SERVICE
85  *
86  * @defgroup TR69_HOSTIF_STORAGE_SERVICE_CLASSES TR-069 Object (Device.StorageService.Interface.{i}) Public Classes
87  * Describe the details about classes used in TR069 storage service.
88  * @ingroup TR69_HOSTIF_STORAGE_SERVICE
89  */
90 #ifndef _SERVICE_STORAGE_H_
91 #define _SERVICE_STORAGE_H_
92 #include "hostIf_msgHandler.h"
93 #include "hostIf_updateHandler.h"
94 
95 /**
96  * @brief This class provides the TR-069 storage service information.
97  * @ingroup TR69_HOSTIF_STORAGE_SERVICE_CLASSES
98  */
100 {
101 
102  static GHashTable *storageSrvHash;
103 
104  static GMutex *m_mutex;
105 
106  int dev_id;
107 
108  hostIf_StorageSrvc(int dev_id);
109 
110  public:
111 
112  static hostIf_StorageSrvc* getInstance(int dev_id);
113 
114  static void closeInstance(hostIf_StorageSrvc*);
115 
116  static GList* getAllInstances();
117 
118  static void closeAllInstances();
119 
120  static unsigned int get_Device_StorageSrvc_ClientNumberOfEntries(HOSTIF_MsgData_t *stMsgData);
121 
122  int handleGetMsg(HOSTIF_MsgData_t *stMsgData);
123 
124 /**
125  * @brief This function set the hostIf storage service interface such as total number
126  * physical medium entries, attributes of physical medium "Name", "SmartCapable" and
127  * "Health". Currently not implemented.
128  *
129  * @param[in] stMsgData HostIf Message Request data contains the storage service attribute value.
130  *
131  * @return Returns an Integer value.
132  * @retval 0 If successfully set the hostIf storage service interface attribute.
133  * @retval -1 If Not able to set the hostIf storage service interface attribute.
134  * @retval -2 If Not handle the hostIf storage service interface attribute.
135  * @ingroup TR69_HOSTIF_STORAGE_SERVICE_API
136  */
137  int handleSetMsg(HOSTIF_MsgData_t *stMsgData);
138 
139  static void getLock();
140 
141  static void releaseLock();
142 
143 };
144 #endif
hostIf_StorageSrvc::handleSetMsg
int handleSetMsg(HOSTIF_MsgData_t *stMsgData)
This function set the hostIf storage service interface such as total number physical medium entries,...
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_StorageSrvc::handleGetMsg
int handleGetMsg(HOSTIF_MsgData_t *stMsgData)
This function get the hostIf storage service interface such as total number physical medium entries,...
Definition: Service_Storage.cpp:158
hostIf_StorageSrvc
This class provides the TR-069 storage service information.
Definition: Service_Storage.h:99
hostIf_msgHandler.h
The header file provides HostIf message handler information APIs.
hostIf_StorageSrvc::hostIf_StorageSrvc
hostIf_StorageSrvc(int dev_id)
Class Constructor of the class hostIf_StorageSrvc.
Definition: Service_Storage.cpp:45