mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Update message types to be in line with implementation, add state machines
@@ -9,16 +9,48 @@ The client uses a separate group for each pair of contacts. The [group descripto
|
||||
|
||||
### Message types
|
||||
|
||||
The sharing protocol uses three message types. It should be noted that all communication happens solely between the introduction facilitator and the contacts she introduced. The contacts themselves only start making direct connections when the protocol completes successfully. The introduction facilitator forwards the messages received from one contact to the other while observing to use the correct introduction ID with each contact.
|
||||
The sharing protocol uses five message types. It should be noted that all communication happens solely between the sharer and the contacts she invites.
|
||||
|
||||
**1: INVITATION** - This is send by the sharer to one of her contacts. The content is a BDF list.
|
||||
1: **INVITATION** - This is send by the sharer to one of her contacts. The content is a BDF list.
|
||||
* (int) The type of the message, here 1
|
||||
* (raw) SessionId chosen by the sharer
|
||||
* (string) name of the forum
|
||||
* (raw) salt to uniquely identify this forum
|
||||
* (string) optional invitation message
|
||||
|
||||
**2: RESPONSE** - This should be sent by contacts that received a sharing invitation. The response is either positive or negative. The content is a BDF list with these elements:
|
||||
* (bool) Whether the invitation was accepted or not.
|
||||
2: **ACCEPT RESPONSE** - This should be sent by contacts that received a sharing invitation. The content is a BDF list with these elements:
|
||||
* (int) The type of the message, here 2
|
||||
* (raw) SessionId must match the SessionId of an unanswered invitation.
|
||||
|
||||
**3: ABORT** - This should be send by a contact that encountered an error, so that it can not complete the protocol. The content is a BDF list with two elements:
|
||||
* (int) The type of the message, here **3**
|
||||
* (raw) The session ID
|
||||
3: **DECLINE RESPONSE** - This should be sent by contacts that received a sharing invitation and do not want to add the forum. The content is a BDF list with these elements:
|
||||
* (int) The type of the message, here 3
|
||||
* (raw) SessionId must match the SessionId of an unanswered invitation.
|
||||
|
||||
4: **LEAVE** - This should be send by a contact that is unsubscribing from the forum. The content is a BDF list with two elements:
|
||||
* (int) The type of the message, here 4
|
||||
* (raw) SessionId must match the SessionId of a previous (un)answered invitation.
|
||||
|
||||
5: **ABORT** - This should be send by a contact that encountered an error, so that it can not complete the protocol. The content is a BDF list with two elements:
|
||||
* (int) The type of the message, here 5
|
||||
* (raw) SessionId must match the SessionId of an unanswered invitation.
|
||||
|
||||
A successful run of the protocol would look like this:
|
||||
|
||||

|
||||
|
||||
**Sharer**
|
||||
|
||||

|
||||
|
||||
[sharer-state-machine.odg](/uploads/24354e5ef7779d36ed7a815eccb8f35e/sharer-state-machine.odg)
|
||||
|
||||
**Invitee**
|
||||
|
||||

|
||||
|
||||
[invitee-state-machine.odg](/uploads/2099baeb7948980819022fda5f402aed/invitee-state-machine.odg)
|
||||
|
||||
Arrows that have no label stand for 'all other actions'.
|
||||
|
||||
### Validity policy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user