Extend protobuf to include syncing related messages.

PiperOrigin-RevId: 874107544
This commit is contained in:
hai007
2026-02-23 09:19:17 -08:00
committed by Copybara-Service
parent bfd0ce1ab4
commit 7034015127
+40 -1
View File
@@ -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