+ * Policy flags for a channel.
+ */
+enum GNUNET_PSYC_ChannelFlags
+{
+ /**
+ * Admission must be confirmed by the master.
+ */
+ GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL = 1 << 0,
+
+ /**
+ * Past messages are only available to slaves who were admitted at the time
+ * they were sent to the channel.
+ */
+ GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY = 1 << 1,
+};
+
+/**
+ * PSYC channel policies.
+ */
+enum GNUNET_PSYC_Policy
+{
+ /**
+ * Anyone can join the channel, without announcing his presence;
+ * all messages are always public and can be distributed freely.
+ * Joins may be announced, but this is not required.
+ */
+ GNUNET_PSYC_CHANNEL_ANONYMOUS = 0,
+
+ /**
+ * The master must approve membership to the channel, messages must only be
+ * distributed to current channel slaves. This includes the channel
+ * state as well as transient messages.
+ */
+ GNUNET_PSYC_CHANNEL_PRIVATE
+ = GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL
+ | GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY,
+
+#if IDEAS_FOR_FUTURE
+ /**
+ * Anyone can freely join the channel (no approval required);
+ * however, messages must only be distributed to current channel
+ * slaves, so the master must still acknowledge that the slave
+ * joined before transient messages are delivered. As approval is
+ * guaranteed, the presistent channel state can be synchronized freely
+ * immediately, prior to master confirmation.
+ */
+ GNUNET_PSYC_CHANNEL_OPEN
+ = GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY,
+
+ /**
+ * The master must approve joins to the channel, but past messages can be
+ * freely distributed to slaves.
+ */
+ GNUNET_PSYC_CHANNEL_CLOSED
+ = GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL,
+,
+#endif
+
+};
+
+
+enum GNUNET_PSYC_MessageFlags
+{
+ /**
+ * First fragment of a message.
+ */
+ GNUNET_PSYC_MESSAGE_FIRST_FRAGMENT = 1 << 0,
+
+ /**
+ * Last fragment of a message.
+ */
+ GNUNET_PSYC_MESSAGE_LAST_FRAGMENT = 1 << 1,
+
+ /**
+ * OR'ed flags if message is not fragmented.
+ */
+ GNUNET_PSYC_MESSAGE_NOT_FRAGMENTED
+ = GNUNET_PSYC_MESSAGE_FIRST_FRAGMENT
+ | GNUNET_PSYC_MESSAGE_LAST_FRAGMENT,
+
+ /**
+ * Historic message, retrieved from PSYCstore.
+ */
+ GNUNET_PSYC_MESSAGE_HISTORIC = 1 << 30
+};
+
+
+/**
+ * M
+ */
+struct GNUNET_PSYC_MessageMethod
+{
+ /**
+ * Type: GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD
+ */
+ struct GNUNET_MessageHeader header;
+
+ uint32_t reserved GNUNET_PACKED;
+
+ /**
+ * Number of modifiers in the message.
+ */
+ uint32_t mod_count GNUNET_PACKED;
+
+ /**
+ * OR'ed GNUNET_PSYC_MasterTransmitFlags
+ */
+ uint32_t flags GNUNET_PACKED;
+
+ /**
+ * Sending slave's public key.
+ * NULL if the message is from the master, or when transmitting a message.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey slave_key;
+
+ /* Followed by NUL-terminated method name. */
+};
+
+
+struct GNUNET_PSYC_MessageModifier
+{
+ /**
+ * Type: GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Size of value.
+ */
+ uint32_t value_size GNUNET_PACKED;
+
+ /**
+ * Size of name, including NUL terminator.
+ */
+ uint16_t name_size GNUNET_PACKED;
+
+ /**
+ * enum GNUNET_ENV_Operator
+ */
+ uint8_t oper;
+
+ /* Followed by NUL-terminated name, then the value. */
+};
+
+
+enum GNUNET_PSYC_DataStatus
+{
+ /**
+ * To be continued.
+ */
+ GNUNET_PSYC_DATA_CONT = 0,
+
+ /**
+ * Reached the end of message.
+ */
+ GNUNET_PSYC_DATA_END = 1,
+
+ /**
+ * Cancelled before the end.
+ */
+ GNUNET_PSYC_DATA_CANCEL = 2
+};
+
+
+struct GNUNET_PSYC_MessageData
+{
+ /**
+ * Type: GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * enum GNUNET_PSYC_DataStatus
+ */
+ uint8_t status;
+};
+
+/**
+ * Handle that identifies a join request.