From 14236b2a2b6121963d1fc1e1eead753a380498f2 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Wed, 30 Jun 2010 13:59:51 +0200 Subject: Add service statistic data structure The static values are maintained in the Service object and exposed through simple accessors. When a Service object enters the ready state it registers itself at Counter. If the Service object is leaving the ready state it will de-register itself from Counter and consequently it will not be updated anymore. The user can shorten the update interval when he registers a Counter object with a shorter interval value. The statistic is stored in the profile file. Only the current value is stored, no history. If there is not Counter object the stats wont be upated. This short coming will be addressed by the 'data threshold netfilter module' patches. --- src/connman.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/connman.h') diff --git a/src/connman.h b/src/connman.h index 8bf5e970..81eda658 100644 --- a/src/connman.h +++ b/src/connman.h @@ -435,6 +435,13 @@ void __connman_service_append_nameserver(struct connman_service *service, void __connman_service_remove_nameserver(struct connman_service *service, const char *nameserver); +unsigned long __connman_service_stats_get_tx_bytes(struct connman_service *service); +unsigned long __connman_service_stats_get_rx_bytes(struct connman_service *service); +unsigned long __connman_service_stats_get_time(struct connman_service *service); +void __connman_service_stats_update(struct connman_service *service, + unsigned long rx_bytes, + unsigned long tx_bytes); + #include int __connman_location_init(void); -- cgit v1.2.3