Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a08b87b2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "adb: extract syncmsg structs." into rvc-dev am: 0ea3e2ae am: ace1d877

Change-Id: I214b1b0fdbb997584f97f04c6a25f6d4d5526ac7
parents 84b6fadb ace1d877
Loading
Loading
Loading
Loading
+62 −50
Original line number Diff line number Diff line
@@ -41,14 +41,14 @@ struct SyncRequest {
    // Followed by 'path_length' bytes of path (not NUL-terminated).
} __attribute__((packed));

union syncmsg {
    struct __attribute__((packed)) {
struct __attribute__((packed)) sync_stat_v1 {
    uint32_t id;
    uint32_t mode;
    uint32_t size;
    uint32_t mtime;
    } stat_v1;
    struct __attribute__((packed)) {
};

struct __attribute__((packed)) sync_stat_v2 {
    uint32_t id;
    uint32_t error;
    uint64_t dev;
@@ -61,15 +61,17 @@ union syncmsg {
    int64_t atime;
    int64_t mtime;
    int64_t ctime;
    } stat_v2;
    struct __attribute__((packed)) {
};

struct __attribute__((packed)) sync_dent_v1 {
    uint32_t id;
    uint32_t mode;
    uint32_t size;
    uint32_t mtime;
    uint32_t namelen;
    } dent_v1; // followed by `namelen` bytes of the name.
    struct __attribute__((packed)) {
};  // followed by `namelen` bytes of the name.

struct __attribute__((packed)) sync_dent_v2 {
    uint32_t id;
    uint32_t error;
    uint64_t dev;
@@ -83,15 +85,25 @@ union syncmsg {
    int64_t mtime;
    int64_t ctime;
    uint32_t namelen;
    } dent_v2; // followed by `namelen` bytes of the name.
    struct __attribute__((packed)) {
};  // followed by `namelen` bytes of the name.

struct __attribute__((packed)) sync_data {
    uint32_t id;
    uint32_t size;
    } data; // followed by `size` bytes of data.
    struct __attribute__((packed)) {
};  // followed by `size` bytes of data.

struct __attribute__((packed)) sync_status {
    uint32_t id;
    uint32_t msglen;
    } status; // followed by `msglen` bytes of error message, if id == ID_FAIL.
};  // followed by `msglen` bytes of error message, if id == ID_FAIL.

union syncmsg {
    sync_stat_v1 stat_v1;
    sync_stat_v2 stat_v2;
    sync_dent_v1 dent_v1;
    sync_dent_v2 dent_v2;
    sync_data data;
    sync_status status;
};

#define SYNC_DATA_MAX (64 * 1024)