-typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls,
- const struct
- GNUNET_PeerIdentity * peer);
-
-
-/**
- * Functions with this signature are called whenever a message is
- * received or transmitted.
- *
- * @param cls closure
- * @param peer the other peer involved (sender or receiver, NULL
- * for loopback messages where we are both sender and receiver)
- * @param message the actual message
- * @param latency reported latency of the connection with 'other'
- * @param distance reported distance (DV) to 'other'
- * @return GNUNET_OK to keep the connection open,
- * GNUNET_SYSERR to close it (signal serious error)
- */
-typedef int
- (*GNUNET_CORE_MessageCallback) (void *cls,
- const struct GNUNET_PeerIdentity * other,
- const struct GNUNET_MessageHeader *
- message,
- struct GNUNET_TIME_Relative latency,
- uint32_t distance);
-
-
-/**
- * Message handler. Each struct specifies how to handle on particular
- * type of message received.
- */
-struct GNUNET_CORE_MessageHandler
-{
- /**
- * Function to call for messages of "type".
- */
- GNUNET_CORE_MessageCallback callback;
-
- /**
- * Type of the message this handler covers.
- */
- uint16_t type;
-
- /**
- * Expected size of messages of this type. Use 0 for variable-size.
- * If non-zero, messages of the given type will be discarded if they
- * do not have the right size.
- */
- uint16_t expected_size;
-
-};