aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_psyc_service.h
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2013-08-15 11:53:19 +0000
committerGabor X Toth <*@tg-x.net>2013-08-15 11:53:19 +0000
commitd922f8c58c93c7635330efed052e9ef516d10c5f (patch)
tree91b426ddfd1bf140eb5ed32aff1d1004c1d8a68b /src/include/gnunet_psyc_service.h
parent28b1f21aa3b4accd60282d5be5029b5eb6774e8c (diff)
downloadgnunet-d922f8c58c93c7635330efed052e9ef516d10c5f.tar.gz
gnunet-d922f8c58c93c7635330efed052e9ef516d10c5f.zip
moved policies from multicast to psyc layer
Diffstat (limited to 'src/include/gnunet_psyc_service.h')
-rw-r--r--src/include/gnunet_psyc_service.h68
1 files changed, 65 insertions, 3 deletions
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h
index 273aa26f4..37b960c6b 100644
--- a/src/include/gnunet_psyc_service.h
+++ b/src/include/gnunet_psyc_service.h
@@ -96,6 +96,68 @@ extern "C"
96#define GNUNET_PSYC_VERSION 0x00000000 96#define GNUNET_PSYC_VERSION 0x00000000
97 97
98 98
99/**
100 * Policy flags for a channel.
101 */
102enum GNUNET_PSYC_ChannelFlags
103{
104 /**
105 * Admission must be confirmed by the master.
106 */
107 GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL = 1 << 0,
108
109 /**
110 * Past messages are only available to slaves who were admitted at the time
111 * they were sent to the channel.
112 */
113 GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY = 1 << 1,
114};
115
116/**
117 * PSYC channel policies.
118 */
119enum GNUNET_PSYC_Policy
120{
121 /**
122 * Anyone can join the channel, without announcing his presence;
123 * all messages are always public and can be distributed freely.
124 * Joins may be announced, but this is not required.
125 */
126 GNUNET_PSYC_CHANNEL_ANONYMOUS = 0,
127
128 /**
129 * The master must approve membership to the channel, messages must only be
130 * distributed to current channel slaves. This includes the channel
131 * state as well as transient messages.
132 */
133 GNUNET_PSYC_CHANNEL_PRIVATE
134 = GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL
135 | GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY,
136
137#if IDEAS_FOR_FUTURE
138 /**
139 * Anyone can freely join the channel (no approval required);
140 * however, messages must only be distributed to current channel
141 * slaves, so the master must still acknowledge that the slave
142 * joined before transient messages are delivered. As approval is
143 * guaranteed, the presistent channel state can be synchronized freely
144 * immediately, prior to master confirmation.
145 */
146 GNUNET_PSYC_CHANNEL_OPEN
147 = GNUNET_PSYC_CHANNEL_RESTRICTED_HISTORY,
148
149 /**
150 * The master must approve joins to the channel, but past messages can be
151 * freely distributed to slaves.
152 */
153 GNUNET_PSYC_CHANNEL_CLOSED
154 = GNUNET_PSYC_CHANNEL_ADMISSION_CONTROL,
155,
156#endif
157
158};
159
160
99enum GNUNET_PSYC_MessageFlags 161enum GNUNET_PSYC_MessageFlags
100{ 162{
101 /** 163 /**
@@ -246,8 +308,8 @@ struct GNUNET_PSYC_Master;
246 * a file with the private key(s) when setting up their own channels 308 * a file with the private key(s) when setting up their own channels
247 * FIXME: we'll likely want to use NOT the p521 curve here, but a cheaper 309 * FIXME: we'll likely want to use NOT the p521 curve here, but a cheaper
248 * one in the future. 310 * one in the future.
249 * @param policy Group policy specifying join and history restrictions. 311 * @param policy Channel policy specifying join and history restrictions.
250 * Used to automate group management decisions. 312 * Used to automate join decisions.
251 * @param method Function to invoke on messages received from slaves. 313 * @param method Function to invoke on messages received from slaves.
252 * @param join_cb Function to invoke when a peer wants to join. 314 * @param join_cb Function to invoke when a peer wants to join.
253 * @param cls Closure for @a method and @a join_cb. 315 * @param cls Closure for @a method and @a join_cb.
@@ -256,7 +318,7 @@ struct GNUNET_PSYC_Master;
256struct GNUNET_PSYC_Master * 318struct GNUNET_PSYC_Master *
257GNUNET_PSYC_master_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 319GNUNET_PSYC_master_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
258 const struct GNUNET_CRYPTO_EccPrivateKey *channel_key, 320 const struct GNUNET_CRYPTO_EccPrivateKey *channel_key,
259 enum GNUNET_MULTICAST_GroupPolicy policy, 321 enum GNUNET_PSYC_Policy policy,
260 GNUNET_PSYC_Method method, 322 GNUNET_PSYC_Method method,
261 GNUNET_PSYC_JoinCallback join_cb, 323 GNUNET_PSYC_JoinCallback join_cb,
262 void *cls); 324 void *cls);