0.1.11 • Published 5 years ago

cfsnet-protocol-buffers v0.1.11

Weekly downloads
4
License
LGPL-3.0
Repository
github
Last release
5 years ago

cfsnet-protocol-buffers

Build Status

Protocol buffers for CFSNET

Table of Contents

Status

Stable

Dependencies

Installation

$ npm install
$ make all

Usage

  • TODO

Messages

AccessFile

Implements AccessFile(path, [mode]) operation. Send this message to check the access of a file.

FieldTypeDescription
pathstringfilepath
modeFileModeOne of the FileMode enum values

Boolean

Protobuf message wrapping Bool.

FieldTypeDescription
valueboolboolean

Buffer

Protobuf message wrapping generic byte buffer.

FieldTypeDescription
valuebytesTODO
lengthuint64Size of value

Close

Implements Open(fd) operation. Send this message to open a file and get a file descriptor.

FieldTypeDescription
fileDescriptorunit32TODO

DownloadDirectory

Implements DownloadDirectory(path) operation. Send this message to download a directory.

FieldTypeDescription
pathstringFilepath of directory to download

DownloadFile

Implements DownloadFile(path) operation. Send this message to download a file.

FieldTypeDescription
pathstringFilepath of file to download

Drive

TODO

FieldTypeDescription
idbytesTODO
keybytesTODO
secretKeybytesTODO

Handshake

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.

FieldTypeDescription
noncebytesOne time use nonce value; should be SHA256 hash of output from a pseudo random number generator
keybytesBLAKE2b hash of the concatenation of "CFSNET1" and nonce
ackboolindicates the handshake was acknowledged by receiver

KeyPair

TODO

FieldTypeDescription
seedbytesTODO
publicKeybytesTODO
secretKeybytesTODO

List

TODO

FieldTypeDescription
valuesrepeated bytesTODO
lengthuint64TODO

ListDirectory

Implements ListDirectory(path) operation. Send this message to list a directory.

FieldTypeDescription
pathstringFilepath of directory to list

MakeDirectory

Implements MakeDirectory(path) operation. Send this message to make a directory. Parent directory should already exist.

FieldTypeDescription
pathstringFilepath of where to create directory

MakeDirectoryPath

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.

FieldTypeDescription
pathstringFilepath of where to create directory

Number

TODO

FieldTypeDescription
valuedoubleTODO

Open

Implements Open(path) operation. Send this message to open a file and get a file descriptor.

FieldTypeDescription
pathstringFilepath to file to open
flagsstringTODO

Read

Implements Read(fd, start, end) operation. Send this message to read a range from an open file descriptor.

FieldTypeDescription
fileDescriptoruint32TODO
startuint32Offset to start reading from
enduint32Offset to stop reading from

ReadFile

Implements ReadFile(path, [start], [end]) operation. Send this message to read a range from an open file descriptor.

FieldTypeDescription
pathstringPath to file to read
startuint32Offset to start reading from
enduint32Offset to stop reading from

RemoveDirectory

Implements RemoveDirectory(path) operation. Send this message to remove a directory. The directory should already exist and be empty.

FieldTypeDescription
pathstringFilepath of directory to remove

RemoveDirectoryPath

Implements RemoveDirectoryPath(path) operation. Send this message to remove a directory. The directory does not have to exist or be empty.

FieldTypeDescription
pathstringFilepath of where to create directory

Request

Represents a request payload for an operation on a CFSNet drive instance.

FieldTypeDescription
noncebytesNumber used once
driveDriveDrive
operationOperationOperation
bufferbytesTODO

Resolve

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 (~).

FieldTypeDescription
pathstringFilepath to resolve

Response

Represents a response payload for an operation on a CFSNet drive instance.

FieldTypeDescription
noncebytesmatches Request.nonce
driveDriveDrive
operationOperationOperation
requestRequestRequest
errorCodeErrorCodeErrorCode
bufferbytesTODO

Stat

TODO

FieldTypeDescription
uiduint32TODO
giduint32TODO
modeuint32TODO
sizeuint64TODO
atimeuint64TODO
ctimeuint64TODO
mtimeuint64TODO
blocksuint64TODO

StatFile

Implements StatFile(path) operation.

FieldTypeDescription
pathstringTODO

String

TODO

FieldTypeDescription
valuestringTODO

TouchFile

Implements TouchFile(path) operation.

FieldTypeDescription
pathstringFilepath to touch

UnlinkFile

Implements UnlinkFile(path) operation.

FieldTypeDescription
pathstringFilepath to unlink

WriteFile

Implements WriteFile(path, buffer, [start], [end]) operation.

FieldTypeDescription
pathstringTODO
bufferbytesTODO
startuint32TODO
enduint32TODO

Enums

FileMode

File mode constants for determining file access.

ConstantValueDescription
F_OK0TODO
X_OK1File is executable
W_OK2File is writable
R_OK4File is readable

ErrorCode

Error codes that indicate client or remote errors.

ConstantValueDescription
NoError0TODO
BadRequestError400TODO
AccessDeniedError403TODO
NotFoundError404TODO
NotSupportedError405TODO
NotOpenedError410TODO
InternalError500TODO
NotImplementedError501TODO

Operation

TODO

ConstantValueDescription
NoOperation0TODO
ResolveOperation1TODO
KeyPairOperation2TODO
OpenOperation10TODO
CloseOperation11TODO
ReadOperation12TODO
WriteOperation13TODO
ReadFileOperation20TODO
WriteFileOperation21TODO
StatFileOperation22TODO
UnlinkFileOperation23TODO
AccessFileOperation24TODO
TouchFileOperation25TODO
DownloadFileOperation26TODO
DownloadDirectoryOperation30TODO
MakeDirectoryOperation31TODO
MakeDirectoryPathOperation32TODO
RemoveDirectoryOperation33TODO
RemoveDirectoryPathOperation34TODO
ListDirectoryOperation35TODO

Contributing

Releases follow Semantic Versioning

See Also

License

LGPL-3.0