2 * Network Configuration Module
4 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef NETWORK_STATISTICS_H_
21 #define NETWORK_STATISTICS_H_
27 #include <glib-object.h>
28 #include <dbus/dbus-glib.h>
30 #include <wifi-state.h>
34 typedef struct NetconfigNetworkStatistics NetconfigNetworkStatistics;
35 typedef struct NetconfigNetworkStatisticsClass NetconfigNetworkStatisticsClass;
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) )
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 ) )
45 GType netconfig_network_statistics_get_type(void);
47 gpointer netconfig_network_statistics_create_and_init(DBusGConnection *conn);
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);
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);
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);
65 void netconfig_wifi_statistics_update_powered_off(void);
73 #endif /* NETWORK_STATISTICS_H_ */