diff options
author | Gabor X Toth <*@tg-x.net> | 2013-08-15 11:53:19 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2013-08-15 11:53:19 +0000 |
commit | d922f8c58c93c7635330efed052e9ef516d10c5f (patch) | |
tree | 91b426ddfd1bf140eb5ed32aff1d1004c1d8a68b /src/include/gnunet_multicast_service.h | |
parent | 28b1f21aa3b4accd60282d5be5029b5eb6774e8c (diff) | |
download | gnunet-d922f8c58c93c7635330efed052e9ef516d10c5f.tar.gz gnunet-d922f8c58c93c7635330efed052e9ef516d10c5f.zip |
moved policies from multicast to psyc layer
Diffstat (limited to 'src/include/gnunet_multicast_service.h')
-rw-r--r-- | src/include/gnunet_multicast_service.h | 75 |
1 files changed, 5 insertions, 70 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index 23d871a39..09d5cc4f2 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h | |||
@@ -55,66 +55,6 @@ struct GNUNET_MULTICAST_Member; | |||
55 | */ | 55 | */ |
56 | struct GNUNET_MULTICAST_Origin; | 56 | struct GNUNET_MULTICAST_Origin; |
57 | 57 | ||
58 | /** | ||
59 | * Policy flags for the group. | ||
60 | */ | ||
61 | enum GNUNET_MULTICAST_GroupFlags | ||
62 | { | ||
63 | /** | ||
64 | * Admission must be confirmed by the origin. | ||
65 | */ | ||
66 | GNUNET_MULTICAST_GROUP_ADMISSION_CONTROL = 1 << 0, | ||
67 | |||
68 | /** | ||
69 | * Past messages are only available to peers who were a member at the time | ||
70 | * they were sent to the group. | ||
71 | */ | ||
72 | GNUNET_MULTICAST_GROUP_RESTRICTED_HISTORY = 1 << 1, | ||
73 | }; | ||
74 | |||
75 | /** | ||
76 | * Group membership policies. | ||
77 | */ | ||
78 | enum GNUNET_MULTICAST_GroupPolicy | ||
79 | { | ||
80 | /** | ||
81 | * Anyone can join the group, without announcing his presence; | ||
82 | * all messages are always public and can be distributed freely. | ||
83 | * Joins may be announced, but this is not required. | ||
84 | */ | ||
85 | GNUNET_MULTICAST_GROUP_ANONYMOUS = 0, | ||
86 | |||
87 | /** | ||
88 | * Origin must approve membership to the group, messages must only be | ||
89 | * distributed to current group members. This includes the group | ||
90 | * state as well as transient messages. | ||
91 | */ | ||
92 | GNUNET_MULTICAST_GROUP_PRIVATE | ||
93 | = GNUNET_MULTICAST_GROUP_ADMISSION_CONTROL | ||
94 | | GNUNET_MULTICAST_GROUP_RESTRICTED_HISTORY, | ||
95 | |||
96 | #if IDEAS_FOR_FUTURE | ||
97 | /** | ||
98 | * Anyone can freely join the group (no approval required); | ||
99 | * however, messages must only be distributed to current group | ||
100 | * members, so the origin must still acknowledge that the member | ||
101 | * joined before transient messages are delivered. As approval is | ||
102 | * guaranteed, the presistent group state can be synchronized freely | ||
103 | * immediately, prior to origin confirmation. | ||
104 | */ | ||
105 | GNUNET_MULTICAST_GROUP_OPEN | ||
106 | = GNUNET_MULTICAST_GROUP_RESTRICTED_HISTORY, | ||
107 | |||
108 | /** | ||
109 | * Origin must approve membership to the group, but past messages can be | ||
110 | * freely distributed to members. | ||
111 | */ | ||
112 | GNUNET_MULTICAST_GROUP_CLOSED | ||
113 | = GNUNET_MULTICAST_GROUP_ADMISSION_CONTROL, | ||
114 | , | ||
115 | #endif | ||
116 | |||
117 | }; | ||
118 | 58 | ||
119 | enum GNUNET_MULTICAST_MessageFlags | 59 | enum GNUNET_MULTICAST_MessageFlags |
120 | { | 60 | { |
@@ -544,21 +484,17 @@ GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh, | |||
544 | * Will advertise the origin in the P2P overlay network under the respective | 484 | * Will advertise the origin in the P2P overlay network under the respective |
545 | * public key so that other peer can find this peer to join it. Peers that | 485 | * public key so that other peer can find this peer to join it. Peers that |
546 | * issue GNUNET_MULTICAST_member_join() can then transmit a join request to | 486 | * issue GNUNET_MULTICAST_member_join() can then transmit a join request to |
547 | * either an existing group member (if the @a policy is permissive) or to | 487 | * either an existing group member or to the origin. If the joining is |
548 | * the origin. If the joining is approved, the member is cleared for @e replay | 488 | * approved, the member is cleared for @e replay and will begin to receive |
549 | * and will begin to receive messages transmitted to the group. If joining is | 489 | * messages transmitted to the group. If joining is disapproved, the failed |
550 | * disapproved, the failed candidate will be given a response. Members in the | 490 | * candidate will be given a response. Members in the group can send messages |
551 | * group can send messages to the origin (one at a time). | 491 | * to the origin (one at a time). |
552 | * | 492 | * |
553 | * @param cfg Configuration to use. | 493 | * @param cfg Configuration to use. |
554 | * @param priv_key ECC key that will be used to sign messages for this | 494 | * @param priv_key ECC key that will be used to sign messages for this |
555 | * multicast session; public key is used to identify the multicast group; | 495 | * multicast session; public key is used to identify the multicast group; |
556 | * FIXME: we'll likely want to use NOT the p521 curve here, but a cheaper | 496 | * FIXME: we'll likely want to use NOT the p521 curve here, but a cheaper |
557 | * one in the future. | 497 | * one in the future. |
558 | * @param policy Group policy specifying join and history restrictions. | ||
559 | * FIXME: needed? Ít would be enough to have this on the PSYC layer, as | ||
560 | * access control to enforce the policy is done by the membership test | ||
561 | * and join request callbacks of the API. | ||
562 | * @param last_fragment_id Last fragment ID to continue counting fragments from | 498 | * @param last_fragment_id Last fragment ID to continue counting fragments from |
563 | * when restarting the origin. 0 for a new group. | 499 | * when restarting the origin. 0 for a new group. |
564 | * @param join_cb Function called to approve / disapprove joining of a peer. | 500 | * @param join_cb Function called to approve / disapprove joining of a peer. |
@@ -574,7 +510,6 @@ GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh, | |||
574 | struct GNUNET_MULTICAST_Origin * | 510 | struct GNUNET_MULTICAST_Origin * |
575 | GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 511 | GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
576 | const struct GNUNET_CRYPTO_EccPrivateKey *priv_key, | 512 | const struct GNUNET_CRYPTO_EccPrivateKey *priv_key, |
577 | enum GNUNET_MULTICAST_GroupPolicy policy, | ||
578 | uint64_t last_fragment_id, | 513 | uint64_t last_fragment_id, |
579 | GNUNET_MULTICAST_JoinCallback join_cb, | 514 | GNUNET_MULTICAST_JoinCallback join_cb, |
580 | GNUNET_MULITCAST_MembershipTestCallback test_cb, | 515 | GNUNET_MULITCAST_MembershipTestCallback test_cb, |