#include "gnunet_util_lib.h"
#ifdef __cplusplus
-extern "C"
-{
-#if 0 /* keep Emacsens' auto-indent happy */
+extern "C" {
+#if 0 /* keep Emacsens' auto-indent happy */
}
#endif
#endif
*/
#define GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY "transport-peer-hello"
+/**
+ * Key used to store sender's monotonic time from backchannel
+ * messages.
+ */
+#define GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME \
+ "transport-backchannel-monotonic-time"
/**
* Options for storing values in PEERSTORE
* @param cls closure
* @param success #GNUNET_OK or #GNUNET_SYSERR
*/
-typedef void
-(*GNUNET_PEERSTORE_Continuation)(void *cls,
- int success);
+typedef void (*GNUNET_PEERSTORE_Continuation) (void *cls, int success);
/**
* @param record peerstore record information
* @param emsg error message, or NULL if no errors
*/
-typedef void
-(*GNUNET_PEERSTORE_Processor) (void *cls,
- const struct GNUNET_PEERSTORE_Record *record,
- const char *emsg);
+typedef void (*GNUNET_PEERSTORE_Processor) (
+ void *cls,
+ const struct GNUNET_PEERSTORE_Record *record,
+ const char *emsg);
/**
* @param sync_first send any pending STORE requests before disconnecting
*/
void
-GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h,
- int sync_first);
+GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first);
/**
GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext *wc);
-#if 0 /* keep Emacsens' auto-indent happy */
+#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
#ifdef __cplusplus
#endif
-/** @} */ /* end of group */
+/** @} */ /* end of group */
* - proper use/initialization of timestamps in messages exchanged
* during DV learning
* - persistence of monotonic time obtained from other peers
- * in PEERSTORE (by message type)
+ * in PEERSTORE (by message type) -- done for backchannel, needed elsewhere?
* - change transport-core API to provide proper flow control in both
* directions, allow multiple messages per peer simultaneously (tag
* confirmations with unique message ID), and replace quota-out with
b->task = NULL;
}
mtbe = GNUNET_TIME_absolute_hton (b->monotonic_time);
- b->sc = GNUNET_PEERSTORE_store (peerstore,
- "transport",
- &b->pid,
- "transport-backchannel-monotonic-time",
- &mtbe,
- sizeof (mtbe),
- GNUNET_TIME_UNIT_FOREVER_ABS,
- GNUNET_PEERSTORE_STOREOPTION_REPLACE,
- &backtalker_monotime_store_cb,
- b);
+ b->sc =
+ GNUNET_PEERSTORE_store (peerstore,
+ "transport",
+ &b->pid,
+ GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME,
+ &mtbe,
+ sizeof (mtbe),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ GNUNET_PEERSTORE_STOREOPTION_REPLACE,
+ &backtalker_monotime_store_cb,
+ b);
}
b->timeout =
GNUNET_TIME_relative_to_absolute (BACKCHANNEL_INACTIVITY_TIMEOUT);
b->task = GNUNET_SCHEDULER_add_at (b->timeout, &backtalker_timeout_cb, b);
- b->get = GNUNET_PEERSTORE_iterate (peerstore,
- "transport",
- &b->pid,
- "transport-backchannel-monotonic-time",
- &backtalker_monotime_cb,
- b);
+ b->get =
+ GNUNET_PEERSTORE_iterate (peerstore,
+ "transport",
+ &b->pid,
+ GNUNET_PEERSTORE_TRANSPORT_BACKCHANNEL_MONOTIME,
+ &backtalker_monotime_cb,
+ b);
}
}