summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorVincent Blut <vincent.debian@free.fr>2015-09-26 17:05:50 +0200
committerVincent Blut <vincent.debian@free.fr>2015-09-26 17:05:50 +0200
commit55697823c8a320c595ad93947965f29f94c5a1da (patch)
tree55efda509aef466d40b907913c7a435feb90ace9 /util.h
parent9576b683a04f8a0e691933f580aa431f460c56e3 (diff)
Imported Upstream version 2.1.1
Diffstat (limited to 'util.h')
-rw-r--r--util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.h b/util.h
index a0a688d..6e9fdd1 100644
--- a/util.h
+++ b/util.h
@@ -86,6 +86,9 @@ extern void UTI_IPHostToNetwork(IPAddr *src, IPAddr *dest);
extern void UTI_IPNetworkToHost(IPAddr *src, IPAddr *dest);
extern int UTI_CompareIPs(IPAddr *a, IPAddr *b, IPAddr *mask);
+extern void UTI_SockaddrToIPAndPort(struct sockaddr *sa, IPAddr *ip, unsigned short *port);
+extern int UTI_IPAndPortToSockaddr(IPAddr *ip, unsigned short port, struct sockaddr *sa);
+
extern char *UTI_TimeToLogForm(time_t t);
/* Adjust time following a frequency/offset change */
@@ -101,6 +104,12 @@ extern void UTI_TimevalToInt64(struct timeval *src, NTP_int64 *dest, uint32_t fu
extern void UTI_Int64ToTimeval(NTP_int64 *src, struct timeval *dest);
+/* Check if time + offset is sane */
+extern int UTI_IsTimeOffsetSane(struct timeval *tv, double offset);
+
+/* Get 2 raised to power of a signed integer */
+extern double UTI_Log2ToDouble(int l);
+
extern void UTI_TimevalNetworkToHost(Timeval *src, struct timeval *dest);
extern void UTI_TimevalHostToNetwork(struct timeval *src, Timeval *dest);