summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-09-08 19:08:46 +0000
committerNick Mathewson <nickm@torproject.org>2007-09-08 19:08:46 +0000
commit509bc3b4a055c9bee80d943111e01cf031db81f8 (patch)
tree84a47fa5fd338c4f879c9dd88a0092044087ab22 /src/common/util.h
parenteb3f24f027e9d160c5b5658e7d7f86a2acda880f (diff)
downloadtor-509bc3b4a055c9bee80d943111e01cf031db81f8.tar.gz
tor-509bc3b4a055c9bee80d943111e01cf031db81f8.zip
r14359@Kushana: nickm | 2007-09-08 15:07:17 -0400
Add some generic skew-and-tolerance functions so we can handle time more sanely. svn:r11406
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index d973948c50..950de9bacc 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -206,6 +206,15 @@ void format_local_iso_time(char *buf, time_t t);
void format_iso_time(char *buf, time_t t);
int parse_iso_time(const char *buf, time_t *t);
int parse_http_time(const char *buf, struct tm *tm);
+/* Fuzzy time. */
+void ftime_set_maximum_sloppiness(int seconds);
+void ftime_set_estimated_skew(int seconds);
+/* typedef struct ftime_t { time_t earliest; time_t latest; } ftime_t; */
+/* void ftime_get_window(time_t now, ftime_t *ft_out); */
+int ftime_maybe_after(time_t now, time_t when);
+int ftime_maybe_before(time_t now, time_t when);
+int ftime_definitely_after(time_t now, time_t when);
+int ftime_definitely_before(time_t now, time_t when);
/* File helpers */
int write_all(int fd, const char *buf, size_t count, int isSocket);