diff --git a/sharing/proto/wire_format.proto b/sharing/proto/wire_format.proto index 5a166991..2d35c6a7 100644 --- a/sharing/proto/wire_format.proto +++ b/sharing/proto/wire_format.proto @@ -183,7 +183,7 @@ message Frame { optional V1Frame v1 = 2; } -// NEXT_ID=8 +// NEXT_ID=9 message V1Frame { enum FrameType { UNKNOWN_FRAME_TYPE = 0; @@ -196,6 +196,7 @@ message V1Frame { CANCEL = 6; // No longer used. PROGRESS_UPDATE = 7; + FILE_SYNC = 8; } optional FrameType type = 1; @@ -207,6 +208,7 @@ message V1Frame { optional PairedKeyResultFrame paired_key_result = 5; optional CertificateInfoFrame certificate_info = 6 [deprecated = true]; optional ProgressUpdateFrame progress_update = 7 [deprecated = true]; + optional SyncFrame file_sync = 8; } // An introduction packet sent by the sending side. Contains a list of files @@ -241,6 +243,43 @@ message ProgressUpdateFrame { optional bool start_transfer = 2; } +// A packet for file sync messages. +// NEXT_ID=3 +message SyncFrame { + oneof content { + SyncHandshake handshake = 1; + SyncConfig config = 2; + } +} + +// A packet for file sync handshake messages. +// NEXT_ID=1 +message SyncHandshake {} + +// A packet for file sync config messages. +// NEXT_ID=2 +message SyncConfig { + repeated SyncFolder folders = 1; +} + +// A packet for file sync folder messages. +// NEXT_ID=5 +message SyncFolder { + // An identifier of the folder for the pair of source and target devices to + // uniquely identify it among all folders that are being synced. + optional string id = 1; + // Human readable name of the folder. + optional string label = 2; + // A randomly generated id when the index is created. Regenerate when the + // index is reset. + optional int32 index_id = 3; + // The maximum sequence number of the folder. Each number represents an update + // to a file in the folder. Sequence numbers are only valid within the scope + // of a valid index_id. If an index is reset, all sequence numbers need to be + // regenerated, including max_sequence. + optional int64 max_sequence = 4; +} + // A response packet sent by the receiving side. Accepts or rejects the list of // files. // NEXT_ID=4