diff --git a/mesh/agent.c b/mesh/agent.c
index 2f9697a..a1413c0 100644
--- a/mesh/agent.c
+++ b/mesh/agent.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "mesh/mesh.h"
diff --git a/mesh/appkey.c b/mesh/appkey.c
index f31d819..b03ddae 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
#include <config.h>
#endif
+#include <time.h>
+
#define _GNU_SOURCE
#include <ell/ell.h>
diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
index f64566d..e5d5a86 100644
--- a/mesh/cfgmod-server.c
+++ b/mesh/cfgmod-server.c
#endif
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/crypto.c b/mesh/crypto.c
index b712a26..b7607bb 100644
--- a/mesh/crypto.c
+++ b/mesh/crypto.c
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/socket.h>
+#include <time.h>
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/dbus.c b/mesh/dbus.c
index a7abdc4..c43d655 100644
--- a/mesh/dbus.c
+++ b/mesh/dbus.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/friend.c b/mesh/friend.c
index 5b73da6..6aacf63 100644
--- a/mesh/friend.c
+++ b/mesh/friend.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/keyring.c b/mesh/keyring.c
index 1e1de3e..cb091e1 100644
--- a/mesh/keyring.c
+++ b/mesh/keyring.c
#include <errno.h>
#include <limits.h>
#include <stdio.h>
+#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
diff --git a/mesh/main.c b/mesh/main.c
index 145bcfa..5b8af4b 100644
--- a/mesh/main.c
+++ b/mesh/main.c
#include <unistd.h>
#include <ctype.h>
#include <signal.h>
+#include <time.h>
#include <sys/prctl.h>
#include <sys/stat.h>
diff --git a/mesh/manager.c b/mesh/manager.c
index 0c98721..63551b4 100644
--- a/mesh/manager.c
+++ b/mesh/manager.c
#include <config.h>
#endif
+#include <time.h>
+
#define _GNU_SOURCE
#include <ell/ell.h>
diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index 5372130..86e7d87 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <sys/time.h>
diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 13a863b..3da0a8c 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
#include <errno.h>
#include <string.h>
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "monitor/bt.h"
diff --git a/mesh/mesh-io-mgmt.c b/mesh/mesh-io-mgmt.c
index 5f0eb20..d185f5c 100644
--- a/mesh/mesh-io-mgmt.c
+++ b/mesh/mesh-io-mgmt.c
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "monitor/bt.h"
diff --git a/mesh/mesh-io-unit.c b/mesh/mesh-io-unit.c
index a9fa533..4fd72bf 100644
--- a/mesh/mesh-io-unit.c
+++ b/mesh/mesh-io-unit.c
#include <sys/un.h>
#include <unistd.h>
#include <stdio.h>
+#include <time.h>
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c
index b953bf4..99c7c20 100644
--- a/mesh/mesh-io.c
+++ b/mesh/mesh-io.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "lib/bluetooth.h"
diff --git a/mesh/mesh-mgmt.c b/mesh/mesh-mgmt.c
index fd21a16..87036d1 100644
--- a/mesh/mesh-mgmt.c
+++ b/mesh/mesh-mgmt.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "lib/bluetooth.h"
diff --git a/mesh/mesh.c b/mesh/mesh.c
index 91cf251..50059ad 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
#include <config.h>
#endif
+#include <time.h>
+
#define _GNU_SOURCE
#include <ell/ell.h>
diff --git a/mesh/model.c b/mesh/model.c
index 4ccafa1..01b2167 100644
--- a/mesh/model.c
+++ b/mesh/model.c
#endif
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/net-keys.c b/mesh/net-keys.c
index 57a9df0..42d498c 100644
--- a/mesh/net-keys.c
+++ b/mesh/net-keys.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/net.c b/mesh/net.c
index 05ca483..cc862da 100644
--- a/mesh/net.c
+++ b/mesh/net.c
#define _GNU_SOURCE
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
diff --git a/mesh/node.c b/mesh/node.c
index 93537c5..a858147 100644
--- a/mesh/node.c
+++ b/mesh/node.c
#include <limits.h>
#include <stdio.h>
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 7a1dd87..0b1fd7d 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
index fd9d4cd..241345b 100644
--- a/mesh/prov-acceptor.c
+++ b/mesh/prov-acceptor.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "src/shared/ecc.h"
diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
index e353d23..dc19d1e 100644
--- a/mesh/prov-initiator.c
+++ b/mesh/prov-initiator.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "src/shared/ecc.h"
diff --git a/mesh/prvbeac-server.c b/mesh/prvbeac-server.c
index dd0e4cb..f318852 100644
--- a/mesh/prvbeac-server.c
+++ b/mesh/prvbeac-server.c
#endif
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "mesh/mesh-defs.h"
diff --git a/mesh/remprv-server.c b/mesh/remprv-server.c
index 927dbab..53c764f 100644
--- a/mesh/remprv-server.c
+++ b/mesh/remprv-server.c
#endif
#include <sys/time.h>
+#include <time.h>
#include <ell/ell.h>
#include "src/shared/ad.h"
diff --git a/mesh/rpl.c b/mesh/rpl.c
index 69533bf..8de4a8d 100644
--- a/mesh/rpl.c
+++ b/mesh/rpl.c
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
+#include <time.h>
#include <sys/stat.h>
diff --git a/src/shared/btp.c b/src/shared/btp.c
index e54eb83..04ccae9 100644
--- a/src/shared/btp.c
+++ b/src/shared/btp.c
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <time.h>
#include <unistd.h>
#include <ell/ell.h>
diff --git a/src/shared/io-ell.c b/src/shared/io-ell.c
index dee9a95..35dc38e 100644
--- a/src/shared/io-ell.c
+++ b/src/shared/io-ell.c
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
+#include <time.h>
#include <ell/ell.h>
diff --git a/src/shared/mainloop-ell.c b/src/shared/mainloop-ell.c
index 5cc0311..1aec7fa 100644
--- a/src/shared/mainloop-ell.c
+++ b/src/shared/mainloop-ell.c
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
+#include <time.h>
#include <ell/ell.h>
diff --git a/src/shared/timeout-ell.c b/src/shared/timeout-ell.c
index 0262869..7867c75 100644
--- a/src/shared/timeout-ell.c
+++ b/src/shared/timeout-ell.c
*
*/
+#include <time.h>
+
#include <ell/ell.h>
#include "timeout.h"
diff --git a/tools/mesh/cfgcli.c b/tools/mesh/cfgcli.c
index 1a404af..fb6fa66 100644
--- a/tools/mesh/cfgcli.c
+++ b/tools/mesh/cfgcli.c
#include <stdio.h>
#include <stdbool.h>
+#include <time.h>
#include <ell/ell.h>
diff --git a/tools/mesh/keys.c b/tools/mesh/keys.c
index 134c1a1..d1d2ffe 100644
--- a/tools/mesh/keys.c
+++ b/tools/mesh/keys.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "src/shared/shell.h"
diff --git a/tools/mesh/remote.c b/tools/mesh/remote.c
index b917ae9..2d40008 100644
--- a/tools/mesh/remote.c
+++ b/tools/mesh/remote.c
#include <config.h>
#endif
+#include <time.h>
+
#include <ell/ell.h>
#include "src/shared/shell.h"
diff --git a/tools/mesh/util.c b/tools/mesh/util.c
index 6e81bf5..c110101 100644
--- a/tools/mesh/util.c
+++ b/tools/mesh/util.c
#endif
#include <stdio.h>
+#include <time.h>
#include <ell/ell.h>