Add functions to get current timestamp

This commit is contained in:
Matthias Schiffer 2013-03-18 22:02:28 +01:00
parent 976cea11de
commit f567646b68
2 changed files with 8 additions and 0 deletions

View file

@ -45,6 +45,8 @@ typedef struct gmrf_addr {
uint8_t d[GMRF_ADDR_LEN];
} gmrf_addr_t;
typedef uint64_t gmrf_time_t;
static const gmrf_addr_t gmrf_addr_unspec = {};
@ -53,6 +55,7 @@ static inline bool gmrf_addr_equal(const gmrf_addr_t *addr1, const gmrf_addr_t *
return (memcmp(addr1->d, addr2->d, GMRF_ADDR_LEN) == 0);
}
gmrf_time_t gmrf_now(gmrf_t *gmrf);
void gmrf_logf(gmrf_t *gmrf, int priority, const char *format, ...);
gmrf_addr_t gmrf_iface_get_addr(gmrf_t *gmrf, gmrf_iface_t *iface);

View file

@ -31,6 +31,11 @@
#include <stdlib.h>
gmrf_time_t gmrf_now(gmrf_t *gmrf) {
return gmrf->mmss->now;
}
static void init_nodes(gmrf_t *nodes) {
gmrf_t *node;
for (node = nodes; node; node = node->next) {