diff options
-rw-r--r-- | include/timeserver.h | 21 | ||||
-rw-r--r-- | src/timeserver.c | 47 |
2 files changed, 0 insertions, 68 deletions
diff --git a/include/timeserver.h b/include/timeserver.h index 83ad5573..d1245376 100644 --- a/include/timeserver.h +++ b/include/timeserver.h @@ -26,30 +26,9 @@ extern "C" { #endif -#define CONNMAN_TIMESERVER_PRIORITY_LOW -100 -#define CONNMAN_TIMESERVER_PRIORITY_DEFAULT 0 -#define CONNMAN_TIMESERVER_PRIORITY_HIGH 100 - -/** - * SECTION:timeserver - * @title: timeserver premitives - * @short_description: Functions for handling time servers (including NTP) - */ - int __connman_timeserver_system_append(const char *server); int __connman_timeserver_system_remove(const char *server); -struct connman_timeserver_driver { - const char *name; - int priority; - int (*append) (const char *server); - int (*remove) (const char *server); - void (*sync) (void); -}; - -int connman_timeserver_driver_register(struct connman_timeserver_driver *driver); -void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver); - #ifdef __cplusplus } #endif diff --git a/src/timeserver.c b/src/timeserver.c index 0a268f5d..d31801f0 100644 --- a/src/timeserver.c +++ b/src/timeserver.c @@ -31,9 +31,6 @@ #include "connman.h" -static GSList *driver_list = NULL; -static GHashTable *server_hash = NULL; - static char **system_timeservers = NULL; static char **timeservers = NULL; @@ -88,45 +85,6 @@ static char **load_timeservers() return servers; } -static gint compare_priority(gconstpointer a, gconstpointer b) -{ - const struct connman_timeserver_driver *driver1 = a; - const struct connman_timeserver_driver *driver2 = b; - - return driver2->priority - driver1->priority; -} - -/** - * connman_timeserver_driver_register: - * @driver: timeserver driver definition - * - * Register a new timeserver driver - * - * Returns: %0 on success - */ -int connman_timeserver_driver_register(struct connman_timeserver_driver *driver) -{ - DBG("driver %p name %s", driver, driver->name); - - driver_list = g_slist_insert_sorted(driver_list, driver, - compare_priority); - - return 0; -} - -/** - * connman_timeserver_driver_unregister: - * @driver: timeserver driver definition - * - * Remove a previously registered timeserver driver - */ -void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver) -{ - DBG("driver %p name %s", driver, driver->name); - - driver_list = g_slist_remove(driver_list, driver); -} - /* Restart NTP procedure */ static void connman_timeserver_restart() { @@ -379,15 +337,10 @@ int __connman_timeserver_init(void) { DBG(""); - server_hash = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, NULL); - return 0; } void __connman_timeserver_cleanup(void) { DBG(""); - - g_hash_table_destroy(server_hash); } |