From f9660680079b0706ff686eee5a1409dc02d08b43 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 27 Aug 2019 21:01:59 +0200 Subject: add more details, fix table formatting --- ae-protocol.md | 92 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/ae-protocol.md b/ae-protocol.md index 91bd860..176ef9d 100644 --- a/ae-protocol.md +++ b/ae-protocol.md @@ -1,38 +1,50 @@ -Message types -============== - - Msg ID | Sending side | Description - --------|--------------|---------------------------------- - 00 | Ami/PC | Ask for next block - 01 | Ami/PC | Transfer cancelled - 02 | Ami/PC | Initialisation / Init response - 03 | Ami/? | Multipart header - 04 | Amiga | EOF (no payload) - 05 | Amiga | Next data block +Overview +======== - 08 | Amiga | File already exists (when trying to write with 0x66) - 09 | Amiga | Size ? (response to 0x6c) - 0a | Amiga | Close response - 0b | Amiga | Format response? +The AE protocol works by exchanging messages between the Amiga and the Client (e.g. an IBM PC). - 64 | PC | List directory - 65 | PC | File read - 66 | PC | File/folder write - 67 | PC | File/folder delete (recursively) - 68 | PC | File rename (name changes) (works on drives, too?) - 69 | PC | File move (path changes) - 6a | PC | File copy - 6b | PC | Set attributes and comment - 6c | PC | Request size on disk (?) - 6d | PC | Close file - 6e | PC | Format disk (needs Kickstart 2.0 or newer) - 6f | PC | New folder +Each message consists of a header and optionally payload data. Both parts carry CRC32 checksums +to ensure data integrity. +Message header +-------------- +| Bytes | Content | +| -------------- | ---------------------------- | +| TODO | | - -Request details -================ +Message types +============= + +| Msg | ID | Sending side | Description | +| ---- | ----------------- | ------------ | --------------------------------------------------------- | +| 0x00 | MSG_NEXT_PART | Amiga/Client | Ask for next block | +| 0x01 | | Amiga/Client | Transfer cancelled | +| 0x02 | MSG_INIT | Amiga/Client | Initialisation / Init response | +| 0x03 | MSG_MPARTH | Amiga/? | Multipart header | +| 0x04 | MSG_EOF | Amiga | EOF (no payload) | +| 0x05 | MSG_BLOCK | Amiga | Next data block | +| | | | | +| 0x08 | MSG_EXISTS | Amiga | File already exists (when trying to write with 0x66) | +| 0x09 | | Amiga | Size ? (response to 0x6c) | +| 0x0a | MSG_ACK_CLOSE | Amiga | Close response | +| 0x0b | | Amiga | Format response? | +| | | | | +| 0x64 | | Client | List directory | +| 0x65 | MSG_FILE_SEND | Client | File read | +| 0x66 | MSG_FILE_RECV | Client | File/folder write | +| 0x67 | | Client | File/folder delete (recursively) | +| 0x68 | | Client | File rename (name changes) (works on drives, too?) | +| 0x69 | | Client | File move (path changes) | +| 0x6a | | Client | File copy | +| 0x6b | | Client | Set attributes and comment | +| 0x6c | | Client | Request size on disk (?) | +| 0x6d | MSG_FILE_CLOSE | Client | Close file | +| 0x6e | | Client | Format disk (needs Kickstart 2.0 or newer) | +| 0x6f | | Client | New folder | + +Message details +=============== 64 - List a directory ---------------------- @@ -46,10 +58,24 @@ Request details ### TODO ### -66 - Write a file ------------------- +0x66 MSG_FILE_RECV - Write a file (PC -> Amiga) +----------------------------------------------- -### TODO ### +Payload: + +| Bytes | Content | +| -------------- | ---------------------------- | +| 4 | header size | +| 4 | file size | +| 4 | FIXME ?? | +| 4 | Attributes FIXME: encoding ? | +| 4 | date (hours since 1/1/78) | +| 4 | time (mins since midnight) | +| 4 | ctime | +| 1 | file type FIXME: encoding? | +| header_size-29 | file name | + +Expected response: 0x00 MSG_NEXT_PART if file does not exist (yet), 0x08 MSG_EXISTS otherwise 67 - Delete file/folder -- cgit v1.2.3 From 3963c2a8f1c3fa79b396c2bdb6119caf23ed11b7 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 27 Aug 2019 21:23:42 +0200 Subject: protocol header, response --- ae-protocol.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ae-protocol.md b/ae-protocol.md index 176ef9d..152e06c 100644 --- a/ae-protocol.md +++ b/ae-protocol.md @@ -11,7 +11,22 @@ Message header | Bytes | Content | | -------------- | ---------------------------- | -| TODO | | +| 2 | Msg (see below) | +| 2 | Payload length | +| 4 | Sequence | +| 4 | CRC32 | + +Payload (if any) +---------------- + +| Bytes | Content | +| -------------- | ---------------------------- | +| n | Payload | +| 4 | CRC32 | + +Each message is acknowledged by the receiving side by a 4-Byte "PkOk" response if the checksum matches. + +FIXME: Reply if checksum doesn''t match? Re-sync/recovery? Message types ============= @@ -58,8 +73,8 @@ Message details ### TODO ### -0x66 MSG_FILE_RECV - Write a file (PC -> Amiga) ------------------------------------------------ +0x66 MSG_FILE_RECV - Write a file (Client -> Amiga) +--------------------------------------------------- Payload: -- cgit v1.2.3 From 2538b9b0c5781c9b02e67e40bee64b05a98cdcd1 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 1 Sep 2019 23:47:58 +0200 Subject: specify re-sync protocol --- ae-protocol.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ae-protocol.md b/ae-protocol.md index 152e06c..800e06a 100644 --- a/ae-protocol.md +++ b/ae-protocol.md @@ -24,9 +24,10 @@ Payload (if any) | n | Payload | | 4 | CRC32 | -Each message is acknowledged by the receiving side by a 4-Byte "PkOk" response if the checksum matches. +Each message is acknowledged by the receiving side by a 4-Byte "PkOk" response if the checksum matches, "PkRs" otherwise. -FIXME: Reply if checksum doesn''t match? Re-sync/recovery? +Recovery from checksum errors: on "PkRs" non-ack, the sending side re-sends the whole message until "PkOk" is received. +FIXME: is this correct? Message types ============= -- cgit v1.2.3 From 598e4c111c3393624f79a5936d35976b494d429f Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 8 Sep 2019 22:32:37 +0200 Subject: more package payload details added --- ae-protocol.md | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 7 deletions(-) diff --git a/ae-protocol.md b/ae-protocol.md index 800e06a..93c0931 100644 --- a/ae-protocol.md +++ b/ae-protocol.md @@ -46,7 +46,7 @@ Message types | 0x0a | MSG_ACK_CLOSE | Amiga | Close response | | 0x0b | | Amiga | Format response? | | | | | | -| 0x64 | | Client | List directory | +| 0x64 | MSG_DIR | Client | List directory | | 0x65 | MSG_FILE_SEND | Client | File read | | 0x66 | MSG_FILE_RECV | Client | File/folder write | | 0x67 | | Client | File/folder delete (recursively) | @@ -62,16 +62,92 @@ Message types Message details =============== -64 - List a directory ----------------------- +0x00 MSG_NEXT_PART - Ask for next block +--------------------------------------- -### TODO ### +Payload: none +Expected repsonse: MSG_BLOCK or MSG_EOF -65 - Read a file ------------------ -### TODO ### +0x03 MSG_MPARTH - Multipart header +---------------------------------- + +Payload: + +| Bytes | Content | +| -------------- | ---------------------------- | +| 4 | length | + +Expected response: 0x00 MSG_NEXT_PART + +0x04 MSG_EOF +------------ + +Payload: none + +0x05 MSG_BLOCK - Next data block +-------------------------------- + +Payload: + +| Bytes | Content | +| -------------- | ---------------------------- | +| 4 | length n | +| n | data | + +Expected response: 0x00 MSG_NEXT_PART + +0x64 MSG_DIR - List a directory (Client -> Amiga) +------------------------------------------------- + +Payload: + +| Bytes | Content | +| -------------- | ---------------------------- | +| n | path | +| 1 | 0 | +| 1 | 1 FIXME ?? | + +Expected response: 0x03 MSG_MPARTH if path exists, MSG_EOF otherwise + +Multipart data will be polled in chunks using MSG_NEXT_PART. This data is structured as follows: + +| Bytes | Content | +| -------------- | ---------------------------- | +| 4 | number of entries | +| n | dir entries | + +Each dir entry is structured as follows: + +| Bytes | Content | +| -------------- | ---------------------------- | +| 4 | len (29+n+m) | +| 4 | size | +| 4 | used | +| 2 | type (0: file, 0x8000: dir) | +| 2 | attributes | +| | S: 0x40 | +| | P: 0x20 | +| | A: 0x10 | +| | R: 0x08 | +| | W: 0x04 | +| | E: 0x02 | +| | D: 0x01 | +| 4 | date | +| 4 | time | +| 4 | ctime | +| 1 | type2 FIXME: ??? | +| n | name\0 | +| m | comment\0 | + + +0x65 MSG_FILE_SEND - Read a file +-------------------------------- + +Payload: filename\0 + +Expected response: 0x08 MSG_EXISTS if file cannot be opened, 0x03 MSG_MPARTH otherwise 0x66 MSG_FILE_RECV - Write a file (Client -> Amiga) -- cgit v1.2.3 From 651597b369876ec288ee57921ab88698b47c2552 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 8 Sep 2019 22:42:49 +0200 Subject: bugfixes, details added --- ae-protocol.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ae-protocol.md b/ae-protocol.md index 93c0931..86f73bc 100644 --- a/ae-protocol.md +++ b/ae-protocol.md @@ -86,6 +86,8 @@ Expected response: 0x00 MSG_NEXT_PART Payload: none +Expected response: 0x6d MSG_FILE_CLOSE + 0x05 MSG_BLOCK - Next data block -------------------------------- @@ -93,7 +95,7 @@ Payload: | Bytes | Content | | -------------- | ---------------------------- | -| 4 | length n | +| 4 | offset | | n | data | Expected response: 0x00 MSG_NEXT_PART @@ -160,7 +162,14 @@ Payload: | 4 | header size | | 4 | file size | | 4 | FIXME ?? | -| 4 | Attributes FIXME: encoding ? | +| 4 | attributes | +| | S: 0x40 | +| | P: 0x20 | +| | A: 0x10 | +| | R: 0x08 | +| | W: 0x04 | +| | E: 0x02 | +| | D: 0x01 | | 4 | date (hours since 1/1/78) | | 4 | time (mins since midnight) | | 4 | ctime | -- cgit v1.2.3