core: Add allocated tag expiry, mctp_set_now_op()

Allocated tags expire after 6 seconds, requiring a time source.
The default will use clock_gettime(), though implementations can set
MCTP_DEFAULT_CLOCK_GETTIME=0 and use mctp_set_now_op() for custom
behavior.

Change-Id: Iaacf500bcd458c987f4b79c698bac9ae5ad5a73e
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/libmctp.h b/libmctp.h
index 1075f7a..f78132b 100644
--- a/libmctp.h
+++ b/libmctp.h
@@ -224,6 +224,15 @@
 #define MCTP_LOG_INFO	 6
 #define MCTP_LOG_DEBUG	 7
 
+/* Environment-specific time functionality */
+/* The `now` callback returns a timestamp in milliseconds.
+ * Timestamps should be monotonically increasing, and can have an arbitrary
+ * origin. (As long as returned timestamps aren't too close to UINT64_MAX, not
+ * a problem forany reasonable implementation). */
+void mctp_set_now_op(struct mctp *mctp, uint64_t (*now)(void *), void *ctx);
+/* Returns a timestamp in milliseconds */
+uint64_t mctp_now(struct mctp *mctp);
+
 #ifdef __cplusplus
 }
 #endif