RDK Documentation (Open Sourced RDK Components)
Device_MoCA_Interface_Stats.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 Device_MoCA_Interface_Stats.h
22  *
23  * @brief TR-069 Device.Moca.Interface.Stats object Public API.
24  */
25 
26 /**
27  * @defgroup TR69_HOSTIF_MOCA_INTERFACE_STATS TR-069 Object (Device.MoCA.Interface.{i}.Stats) Public APIs
28  *
29  * Provides Throughput statistics for this interface.
30  *
31  * The CPE MUST reset the MoCA interface's Stats parameters (unless otherwise stated in individual object or
32  * parameter descriptions) either when the MoCA interface becomes operationally down due to a previous
33  * administrative down (i.e. the MoCA interface's Status parameter transitions to a down state after the
34  * interface is disabled) or when the MoCA interface becomes administratively up (i.e. the MoCA interface's
35  * Enable parameter transitions from false to true). Administrative and operational interface status
36  * is discussed in [Section 4.2.2/TR-181i2].
37  *
38  * @ingroup TR69_HOSTIF_MOCA
39  */
40 
41 
42 
43 
44 /**
45 * @defgroup tr69hostif
46 * @{
47 * @defgroup hostif
48 * @{
49 **/
50 
51 
52 #ifndef HOSTIF_MOCA_INTERFACE_STATS_H_
53 #define HOSTIF_MOCA_INTERFACE_STATS_H_
54 
55 #include "hostIf_main.h"
56 #include "hostIf_tr69ReqHandler.h"
57 #include "hostIf_utils.h"
58 #include "Device_MoCA_Interface.h"
59 
60 
61 /*****************************************************************************
62  * TR069-SPECIFIC INCLUDE FILES
63  *****************************************************************************/
64 
65 /** @defgroup TR_069_DEVICE_MOCA_INTERFACE_STATS_API TR-069 Device.Moca.Interface.Stats object API.
66  * @ingroup TR_069_DEVICE_MOCA_INTERFACE_API
67  *
68  * The Device.Moca.Interface.Stats object provides throughput statistics for this interface.
69  *
70  * @note The CPE MUST reset the interface's Stats parameters (unless otherwise stated
71  * in individual object or parameter descriptions) either when the interface
72  * becomes operationally down due to a previous administrative down (i.e. the
73  * interface's Status parameter transitions to a down state after the interface
74  * is disabled) or when the interface becomes administratively up (i.e. the
75  * interface's Enable parameter transitions from <tt>false</tt> to <tt>true</tt>).
76  */
77 
78 /** @addtogroup TR_069_DEVICE_MOCA_INTERFACE_STATS_GETTER_API TR-069 Device.Moca.Interface.Stats Getter API.
79  * @ingroup TR_069_DEVICE_MOCA_INTERFACE_STATS_API
80  *
81  * \section dev_moca_if_stats_getter TR-069 Device.MoCA.Interface.Stats object Getter API
82  *
83  * This is the getter group of API for the <b>Device.MoCA.Interface.{i}.Stats</b> object.
84  *
85  * The interface for all functions is identical and is described here.
86  *
87  * @param[in] *name This is the complete path name of the parameter extracted from
88  * soap message, e.g. ::get_Device_MoCA_Interface_Stats_BytesSent.
89  * In this case, the path is "Device.MoCA.Interface.{i}.Stats.BytesSent".
90  * @param[in] *type Data type of parameter defined for TR-069. This is same as the
91  * data type used in the Xi3 data-model.xml file.
92  * (see parameter.h)
93  * @param[out] *value This is the value of the parameter requested by the ACS.
94  * (see paramaccess.h)
95  *
96  * @return The status of the operation.
97  * @retval OK If parameter requested was successfully fetched. (Same as <b>NO_ERROR</b>).
98  * @retval NO_ERROR If parameter requested was successfully fetched. (Same as <b>OK</b>).
99  * @retval DIAG_ERROR Diagnostic error.
100  * @retval ERR_??? Appropriate error value otherwise (see dimark_globals.h).
101  *
102  * @todo Clarify description of DIAG_ERROR.
103  *
104  * @{
105  */
106 
107 
108 
110 
111 
112  int m_i32DevID;
113  unsigned long m_ulBytesSent;
114  unsigned long m_ulBytesReceived;
115  unsigned long m_ulPacketsSent;
116  unsigned long m_ulPacketsReceived;
117  unsigned int m_ulErrorsSent;
118  unsigned int m_ulErrorsReceived;
119  unsigned long m_ulUnicastPacketsSent;
120  unsigned long m_ulUnicastPacketsReceived;
121  unsigned int m_ulDiscardPacketsSent;
122  unsigned int m_ulDiscardPacketsReceived;
123  unsigned long m_ulMulticastPacketsSent;
124  unsigned long m_ulMulticastPacketsReceived;
125  unsigned long m_ulBroadcastPacketsSent;
126  unsigned long m_ulBroadcastPacketsReceived;
127  unsigned int m_ui32UnknownProtoPacketsReceived;
128 
129  static class MoCAInterfaceStats *pInstance;
130  ~MoCAInterfaceStats() {};
131  MoCAInterfaceStats(int _dev_id);
132 
133 public:
134 
135  static class MoCAInterfaceStats *getInstance();
136 
137  /**
138  * @ingroup TR69_HOSTIF_MOCA_INTERFACE_STATS
139  * @{
140  */
141  /**
142  * @brief Get the total number of bytes transmitted out of the MoCA interface, including framing characters.
143  *
144  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.BytesSent parameter.
145  *
146  * @param[in] stMsgData TR-069 Host interface message request.
147  * @param[out] pChanged pChange set to not NULL if the object value got changed.
148  *
149  * @return Returns 0 on success, otherwise will return the appropriate error code.
150  */
151  int get_BytesSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
152 
153  /**
154  * @brief Get the total number of bytes received on the MoCA interface, including framing characters.
155  *
156  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.BytesReceived parameter.
157  *
158  * @param[in] stMsgData TR-069 Host interface message request.
159  * @param[out] pChanged pChange set to not NULL if the object value got changed.
160  *
161  * @return Returns 0 on success, otherwise will return the appropriate error code.
162  */
163  int get_BytesReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
164 
165  /**
166  * @brief Get the total number of packets transmitted out of the MoCA interface.
167  *
168  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.PacketsSent parameter.
169  *
170  * @param[in] stMsgData TR-069 Host interface message request.
171  * @param[out] pChanged pChange set to not NULL if the object value got changed.
172  *
173  * @return Returns 0 on success, otherwise will return the appropriate error code.
174  */
175  int get_PacketsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
176 
177  /**
178  * @brief Get the total number of packets received on the MoCA interface.
179  *
180  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.PacketsReceived parameter.
181  *
182  * @param[in] stMsgData TR-069 Host interface message request.
183  * @param[out] pChanged pChange set to not NULL if the object value got changed.
184  *
185  * @return Returns 0 on success, otherwise will return the appropriate error code.
186  */
187  int get_PacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
188 
189  /**
190  * @brief Get the total number of outbound packets that could not be transmitted because of errors.
191  *
192  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.ErrorsSent parameter.
193  *
194  * @param[in] stMsgData TR-069 Host interface message request.
195  * @param[out] pChanged pChange set to not NULL if the object value got changed.
196  *
197  * @return Returns 0 on success, otherwise will return the appropriate error code.
198  */
199  int get_ErrorsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
200 
201  /**
202  * @brief Get the total number of inbound packets that contained errors preventing them from
203  * being delivered to a higher-layer protocol.
204  *
205  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.ErrorsReceived parameter.
206  *
207  * @param[in] stMsgData TR-069 Host interface message request.
208  * @param[out] pChanged pChange set to not NULL if the object value got changed.
209  *
210  * @return Returns 0 on success, otherwise will return the appropriate error code.
211  */
212  int get_ErrorsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
213 
214  /**
215  * @brief Get the total number of packets requested for transmission which were not addressed to a multicast or
216  * broadcast address at this layer, including those that were discarded or not sent.
217  *
218  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.UnicastPacketsSent parameter.
219  *
220  * @param[in] stMsgData TR-069 Host interface message request.
221  * @param[out] pChanged pChange set to not NULL if the object value got changed.
222  *
223  * @return Returns 0 on success, otherwise will return the appropriate error code.
224  */
225  int get_UnicastPacketsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
226 
227  /**
228  * @brief Get the total number of received packets, delivered by this layer to a higher layer,
229  * which were not addressed to a multicast or broadcast address at this layer.
230  *
231  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.UnicastPacketsReceived parameter.
232  *
233  * @param[in] stMsgData TR-069 Host interface message request.
234  * @param[out] pChanged pChange set to not NULL if the object value got changed.
235  *
236  * @return Returns 0 on success, otherwise will return the appropriate error code.
237  */
238  int get_UnicastPacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
239 
240  /**
241  * @brief Get the total number of outbound packets which were chosen to be discarded even though no
242  * errors had been detected to prevent their being transmitted. One possible reason for discarding such a
243  * packet could be to free up buffer space.
244  *
245  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.DiscardPacketsSent parameter.
246  *
247  * @param[in] stMsgData TR-069 Host interface message request.
248  * @param[out] pChanged pChange set to not NULL if the object value got changed.
249  *
250  * @return Returns 0 on success, otherwise will return the appropriate error code.
251  */
252  int get_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
253 
254  /**
255  * @brief Get the total number of inbound packets which were chosen to be discarded even though no errors
256  * had been detected to prevent their being delivered. One possible reason for discarding such a packet
257  * could be to free up buffer space.
258  *
259  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.DiscardPacketsReceived parameter.
260  *
261  * @param[in] stMsgData TR-069 Host interface message request.
262  * @param[out] pChanged pChange set to not NULL if the object value got changed.
263  *
264  * @return Returns 0 on success, otherwise will return the appropriate error code.
265  */
266  int get_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
267 
268  /**
269  * @brief Get the total number of packets that higher-level protocols requested for transmission and which were
270  * addressed to a multicast address at this layer, including those that were discarded or not sent.
271  *
272  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.MulticastPacketsSent parameter.
273  *
274  * @param[in] stMsgData TR-069 Host interface message request.
275  * @param[out] pChanged pChange set to not NULL if the object value got changed.
276  *
277  * @return Returns 0 on success, otherwise will return the appropriate error code.
278  */
279  int get_MulticastPacketsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
280 
281  /**
282  * @brief Get the total number of received packets, delivered by this layer to a higher layer,
283  * which were addressed to a multicast address at this layer.
284  *
285  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.MulticastPacketsReceived parameter.
286  *
287  * @param[in] stMsgData TR-069 Host interface message request.
288  * @param[out] pChanged pChange set to not NULL if the object value got changed.
289  *
290  * @return Returns 0 on success, otherwise will return the appropriate error code.
291  */
292  int get_MulticastPacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
293 
294  /**
295  * @brief Get the total number of packets that higher-level protocols requested for transmission and which were
296  * addressed to a broadcast address at this layer, including those that were discarded or not sent.
297  *
298  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.BroadcastPacketsSent parameter.
299  *
300  * @param[in] stMsgData TR-069 Host interface message request.
301  * @param[out] pChanged pChange set to not NULL if the object value got changed.
302  *
303  * @return Returns 0 on success, otherwise will return the appropriate error code.
304  */
305  int get_BroadcastPacketsSent(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
306 
307  /**
308  * @brief Get the total number of received packets, delivered by this layer to a higher layer,
309  * which were addressed to a broadcast address at this layer.
310  *
311  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.BroadcastPacketsReceived parameter.
312  *
313  * @param[in] stMsgData TR-069 Host interface message request.
314  * @param[out] pChanged pChange set to not NULL if the object value got changed.
315  *
316  * @return Returns 0 on success, otherwise will return the appropriate error code.
317  */
318  int get_BroadcastPacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
319 
320  /**
321  * @brief Get the total number of packets received via the MoCA interface which were discarded because
322  * of an unknown or unsupported protocol.
323  *
324  * This function provides the output as a numeric value available in Device.MoCA.Interface.{i}.Stats.UnknownProtoPacketsReceived parameter.
325  *
326  * @param[in] stMsgData TR-069 Host interface message request.
327  * @param[out] pChanged pChange set to not NULL if the object value got changed.
328  *
329  * @return Returns 0 on success, otherwise will return the appropriate error code.
330  */
331  int get_UnknownProtoPacketsReceived(HOSTIF_MsgData_t *stMsgData,bool *pChanged = NULL);
332 
333  /** @} */ // End of Doxygen tag TR69_HOSTIF_MOCA_INTERFACE_STATS
334 
335 };
336 /* End of TR_069_DEVICE_MOCA_INTERFACE_STATS_GETTER_API doxygen group */
337 /**
338  * @}
339  */
340 
341 
342 #endif /* HOSTIF_MOCA_INTERFACE_STATS_H_ */
343 
344 
345 /** @} */
346 /** @} */
MoCAInterfaceStats::get_ErrorsReceived
int get_ErrorsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of inbound packets that contained errors preventing them from being delivered to...
Definition: Device_MoCA_Interface_Stats.cpp:172
MoCAInterfaceStats::get_DiscardPacketsSent
int get_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of outbound packets which were chosen to be discarded even though no errors had ...
Definition: Device_MoCA_Interface_Stats.cpp:221
MoCAInterfaceStats::get_BytesReceived
int get_BytesReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of bytes received on the MoCA interface, including framing characters.
Definition: Device_MoCA_Interface_Stats.cpp:106
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
MoCAInterfaceStats::get_PacketsSent
int get_PacketsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets transmitted out of the MoCA interface.
Definition: Device_MoCA_Interface_Stats.cpp:123
hostIf_main.h
hostIf_main API.
MoCAInterfaceStats::get_UnknownProtoPacketsReceived
int get_UnknownProtoPacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets received via the MoCA interface which were discarded because of an un...
Definition: Device_MoCA_Interface_Stats.cpp:319
MoCAInterfaceStats::get_UnicastPacketsSent
int get_UnicastPacketsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets requested for transmission which were not addressed to a multicast or...
Definition: Device_MoCA_Interface_Stats.cpp:189
MoCAInterfaceStats
Definition: Device_MoCA_Interface_Stats.h:109
MoCAInterfaceStats::get_BytesSent
int get_BytesSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of bytes transmitted out of the MoCA interface, including framing characters.
Definition: Device_MoCA_Interface_Stats.cpp:90
MoCAInterfaceStats::get_BroadcastPacketsSent
int get_BroadcastPacketsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets that higher-level protocols requested for transmission and which were...
Definition: Device_MoCA_Interface_Stats.cpp:287
MoCAInterfaceStats::get_PacketsReceived
int get_PacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets received on the MoCA interface.
Definition: Device_MoCA_Interface_Stats.cpp:139
Device_MoCA_Interface.h
MoCAInterfaceStats::get_UnicastPacketsReceived
int get_UnicastPacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of received packets, delivered by this layer to a higher layer,...
Definition: Device_MoCA_Interface_Stats.cpp:205
MoCAInterfaceStats::get_ErrorsSent
int get_ErrorsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of outbound packets that could not be transmitted because of errors.
Definition: Device_MoCA_Interface_Stats.cpp:155
MoCAInterfaceStats::get_BroadcastPacketsReceived
int get_BroadcastPacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of received packets, delivered by this layer to a higher layer,...
Definition: Device_MoCA_Interface_Stats.cpp:303
MoCAInterfaceStats::get_MulticastPacketsSent
int get_MulticastPacketsSent(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of packets that higher-level protocols requested for transmission and which were...
Definition: Device_MoCA_Interface_Stats.cpp:253
MoCAInterfaceStats::get_DiscardPacketsReceived
int get_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of inbound packets which were chosen to be discarded even though no errors had b...
Definition: Device_MoCA_Interface_Stats.cpp:237
MoCAInterfaceStats::get_MulticastPacketsReceived
int get_MulticastPacketsReceived(HOSTIF_MsgData_t *stMsgData, bool *pChanged=NULL)
Get the total number of received packets, delivered by this layer to a higher layer,...
Definition: Device_MoCA_Interface_Stats.cpp:270