]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/timesync/timesyncd-manager.h
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / src / timesync / timesyncd-manager.h
index d371f21f6ae4fe3110ecee6c06842463819c33cd..f2200d483b1aeecba57049aef96915d4a0af8594 100644 (file)
@@ -1,24 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
-  This file is part of systemd.
-
-  Copyright 2014 Kay Sievers, Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+  Copyright 2014 Kay Sievers
 ***/
 
+#include <sys/timex.h>
+
+#include "sd-bus.h"
 #include "sd-event.h"
 #include "sd-network.h"
 #include "sd-resolve.h"
@@ -26,6 +15,7 @@
 #include "list.h"
 #include "ratelimit.h"
 #include "time-util.h"
+#include "timesyncd-ntp-message.h"
 
 typedef struct Manager Manager;
 
@@ -39,6 +29,7 @@ typedef struct Manager Manager;
 #define NTP_POLL_INTERVAL_MAX_USEC      (2048 * USEC_PER_SEC)
 
 struct Manager {
+        sd_bus *bus;
         sd_event *event;
         sd_resolve *resolve;
 
@@ -91,7 +82,7 @@ struct Manager {
         /* last change */
         bool jumped;
         bool sync;
-        int drift_ppm;
+        long drift_freq;
 
         /* watch for time changes */
         sd_event_source *event_clock_watch;
@@ -102,6 +93,11 @@ struct Manager {
 
         /* RTC runs in local time, leave it alone */
         bool rtc_local_time;
+
+        /* NTP response */
+        struct ntp_msg ntpmsg;
+        struct timespec origin_time, dest_time;
+        bool spike;
 };
 
 int manager_new(Manager **ret);