CFSNET Protocol Buffers
Protocol buffers for CFSNET
Stable
$ npm install
$ make all
Implements AccessFile(path, [mode])
operation. Send this message to check the access of a file.
Field | Type | Description |
---|---|---|
path | string | filepath |
mode | FileMode | One of the FileMode enum values |
Protobuf message wrapping Bool
.
Field | Type | Description |
---|---|---|
value | bool | boolean |
Protobuf message wrapping generic byte buffer.
Field | Type | Description |
---|---|---|
value | bytes | TODO |
length | uint64 | Size of value |
Implements Open(fd)
operation. Send this message to open a file and get a file descriptor.
Field | Type | Description |
---|---|---|
fileDescriptor | unit32 | TODO |
Implements DownloadDirectory(path)
operation. Send this message to download a directory.
Field | Type | Description |
---|---|---|
path | string | Filepath of directory to download |
Implements DownloadFile(path)
operation. Send this message to download a file.
Field | Type | Description |
---|---|---|
path | string | Filepath of file to download |
TODO
Field | Type | Description |
---|---|---|
id | bytes | TODO |
key | bytes | TODO |
secretKey | bytes | TODO |
A Handshake
message is used between client (Alice) and server (Bob) to capture a handshake prior to a request message exchange. This should be the first payload sent in request to initiate a connection handshake.
Field | Type | Description |
---|---|---|
nonce | bytes | One time use nonce value; should be SHA256 hash of output from a pseudo random number generator |
key | bytes | BLAKE2b hash of the concatenation of “CFSNET1” and nonce |
ack | bool | indicates the handshake was acknowledged by receiver |
TODO
Field | Type | Description |
---|---|---|
seed | bytes | TODO |
publicKey | bytes | TODO |
secretKey | bytes | TODO |
TODO
Field | Type | Description |
---|---|---|
values | repeated bytes | TODO |
length | uint64 | TODO |
Implements ListDirectory(path)
operation. Send this message to list a directory.
Field | Type | Description |
---|---|---|
path | string | Filepath of directory to list |
Implements MakeDirectory(path)
operation. Send this message to make a directory. Parent directory should already exist.
Field | Type | Description |
---|---|---|
path | string | Filepath of where to create directory |
Implements MakeDirectory(path)
operation. Send this message to make a directory. Parent directories will be made if they do not already exist in the path.
Field | Type | Description |
---|---|---|
path | string | Filepath of where to create directory |
TODO
Field | Type | Description |
---|---|---|
value | double | TODO |
Implements Open(path)
operation. Send this message to open a file and get a file descriptor.
Field | Type | Description |
---|---|---|
path | string | Filepath to file to open |
flags | string | TODO |
Implements Read(fd, start, end)
operation. Send this message to read a range from an open file descriptor.
Field | Type | Description |
---|---|---|
fileDescriptor | uint32 | TODO |
start | uint32 | Offset to start reading from |
end | uint32 | Offset to stop reading from |
Implements ReadFile(path, [start], [end])
operation. Send this message to read a range from an open file descriptor.
Field | Type | Description |
---|---|---|
path | string | Path to file to read |
start | uint32 | Offset to start reading from |
end | uint32 | Offset to stop reading from |
Implements RemoveDirectory(path)
operation. Send this message to remove a directory. The directory should already exist and be empty.
Field | Type | Description |
---|---|---|
path | string | Filepath of directory to remove |
Implements RemoveDirectoryPath(path)
operation. Send this message to remove a directory. The directory does not have to exist or be empty.
Field | Type | Description |
---|---|---|
path | string | Filepath of where to create directory |
Represents a request payload for an operation on a CFSNet drive instance.
Field | Type | Description |
---|---|---|
nonce | bytes | Number used once |
drive | Drive | Drive |
operation | Operation | Operation |
buffer | bytes | TODO |
Implements Resolve(path)
operation. Send this message to resolve a given file path to a fully qualified file name by resolving relative paths (./
) and special tokens (~
).
Field | Type | Description |
---|---|---|
path | string | Filepath to resolve |
Represents a response payload for an operation on a CFSNet drive instance.
Field | Type | Description |
---|---|---|
nonce | bytes | matches Request.nonce |
drive | Drive | Drive |
operation | Operation | Operation |
request | Request | Request |
errorCode | ErrorCode | ErrorCode |
buffer | bytes | TODO |
TODO
Field | Type | Description |
---|---|---|
uid | uint32 | TODO |
gid | uint32 | TODO |
mode | uint32 | TODO |
size | uint64 | TODO |
atime | uint64 | TODO |
ctime | uint64 | TODO |
mtime | uint64 | TODO |
blocks | uint64 | TODO |
Implements StatFile(path)
operation.
Field | Type | Description |
---|---|---|
path | string | TODO |
TODO
Field | Type | Description |
---|---|---|
value | string | TODO |
Implements TouchFile(path)
operation.
Field | Type | Description |
---|---|---|
path | string | Filepath to touch |
Implements UnlinkFile(path)
operation.
Field | Type | Description |
---|---|---|
path | string | Filepath to unlink |
Implements WriteFile(path, buffer, [start], [end])
operation.
Field | Type | Description |
---|---|---|
path | string | TODO |
buffer | bytes | TODO |
start | uint32 | TODO |
end | uint32 | TODO |
File mode constants for determining file access.
Constant | Value | Description |
---|---|---|
F_OK | 0 | TODO |
X_OK | 1 | File is executable |
W_OK | 2 | File is writable |
R_OK | 4 | File is readable |
Error codes that indicate client or remote errors.
Constant | Value | Description |
---|---|---|
NoError | 0 | TODO |
BadRequestError | 400 | TODO |
AccessDeniedError | 403 | TODO |
NotFoundError | 404 | TODO |
NotSupportedError | 405 | TODO |
NotOpenedError | 410 | TODO |
InternalError | 500 | TODO |
NotImplementedError | 501 | TODO |
TODO
Constant | Value | Description |
---|---|---|
NoOperation | 0 | TODO |
ResolveOperation | 1 | TODO |
KeyPairOperation | 2 | TODO |
OpenOperation | 10 | TODO |
CloseOperation | 11 | TODO |
ReadOperation | 12 | TODO |
WriteOperation | 13 | TODO |
ReadFileOperation | 20 | TODO |
WriteFileOperation | 21 | TODO |
StatFileOperation | 22 | TODO |
UnlinkFileOperation | 23 | TODO |
AccessFileOperation | 24 | TODO |
TouchFileOperation | 25 | TODO |
DownloadFileOperation | 26 | TODO |
DownloadDirectoryOperation | 30 | TODO |
MakeDirectoryOperation | 31 | TODO |
MakeDirectoryPathOperation | 32 | TODO |
RemoveDirectoryOperation | 33 | TODO |
RemoveDirectoryPathOperation | 34 | TODO |
ListDirectoryOperation | 35 | TODO |
Releases follow Semantic Versioning
LGPL-3.0