ba5883a52473704e60c10d610cc4dd3f49b1d4ff
[platform/core/connectivity/net-config.git] / include / network-statistics.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef NETWORK_STATISTICS_H_
21 #define NETWORK_STATISTICS_H_
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib-object.h>
28 #include <dbus/dbus-glib.h>
29
30 #include <wifi-state.h>
31
32 G_BEGIN_DECLS
33
34 typedef struct NetconfigNetworkStatistics       NetconfigNetworkStatistics;
35 typedef struct NetconfigNetworkStatisticsClass  NetconfigNetworkStatisticsClass;
36
37 #define NETCONFIG_TYPE_NETWORK_STATISTICS       ( netconfig_network_statistics_get_type() )
38 #define NETCONFIG_NETWORK_STATISTICS(obj)       ( G_TYPE_CHECK_INSTANCE_CAST( (obj),NETCONFIG_TYPE_NETWORK_STATISTICS, NetconfigNetworkStatistics ) )
39 #define NETCONFIG_IS_NETWORK_STATISTICS(obj)    (G_TYPE_CHECK_INSTANCE_TYPE( (obj), NETCONFIG_TYPE_NETWORK_STATISTICS) )
40
41 #define NETCONFIG_NETWORK_STATISTICS_CLASS(klass)       ( G_TYPE_CHECK_CLASS_CAST( (klass), NETCONFIG_TYPE_NETWORK_STATISTICS, NetconfigNetworkStatisticsClass) )
42 #define NETCONFIG_IS_NETWORK_STATISTICS_CLASS(klass)    ( G_TYPE_CHECK_CLASS_TYPE( (klass), NETCONFIG_TYPE_NETWORK_STATISTICS) )
43 #define NETCONFIG_NETWORK_STATISTICS_GET_CLASS(obj)     ( G_TYPE_INSTANCE_GET_CLASS( (obj), NETCONFIG_TYPE_NETWORK_STATISTICS, NetconfigNetworkStatisticsClass ) )
44
45 GType netconfig_network_statistics_get_type(void);
46
47 gpointer netconfig_network_statistics_create_and_init(DBusGConnection *conn);
48
49
50 gboolean netconfig_iface_network_statistics_get_wifi_total_tx_bytes(NetconfigNetworkStatistics *network_statistics, guint64 *total_bytes, GError **error);
51 gboolean netconfig_iface_network_statistics_get_wifi_total_rx_bytes(NetconfigNetworkStatistics *network_statistics, guint64 *total_bytes, GError **error);
52 gboolean netconfig_iface_network_statistics_get_wifi_last_tx_bytes(NetconfigNetworkStatistics *network_statistics, guint64 *last_bytes, GError **error);
53 gboolean netconfig_iface_network_statistics_get_wifi_last_rx_bytes(NetconfigNetworkStatistics *network_statistics, guint64 *last_bytes, GError **error);
54
55 gboolean netconfig_iface_network_statistics_reset_cellular_total_tx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
56 gboolean netconfig_iface_network_statistics_reset_cellular_total_rx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
57 gboolean netconfig_iface_network_statistics_reset_cellular_last_tx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
58 gboolean netconfig_iface_network_statistics_reset_cellular_last_rx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
59
60 gboolean netconfig_iface_network_statistics_reset_wifi_total_tx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
61 gboolean netconfig_iface_network_statistics_reset_wifi_total_rx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
62 gboolean netconfig_iface_network_statistics_reset_wifi_last_tx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
63 gboolean netconfig_iface_network_statistics_reset_wifi_last_rx_bytes(NetconfigNetworkStatistics *network_statistics, GError **error);
64
65 void netconfig_wifi_statistics_update_powered_off(void);
66
67 G_END_DECLS
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* NETWORK_STATISTICS_H_ */