|
2 weeks ago | |
---|---|---|
.idea | 6 months ago | |
benches | 1 month ago | |
crypto | 2 weeks ago | |
images | 2 weeks ago | |
netstar-error | 2 weeks ago | |
simulator | 5 months ago | |
spec | 2 weeks ago | |
src | 2 weeks ago | |
.gitignore | 6 months ago | |
Cargo.toml | 2 weeks ago | |
LICENSE | 1 year ago | |
README.org | 2 weeks ago | |
build.rs | 10 months ago | |
config.toml | 2 weeks ago | |
config2.toml | 2 weeks ago | |
rustfmt.toml | 4 months ago | |
test.sh | 2 weeks ago |
We need a way, probably a lot of traits, to make sure that when netstar communicates over HTTP with it self, the data is exactly the same on both sides. That is before the adaptation for HTTP transmition. We must not loose Error or Ok information, but we can drop Internal Errors, (we need a catch all External Error for Internal Errors)
Should a handshake be sent automatically? Is it dangerous? Should the user be able to manually send one? Decide and implement.
get by public key GET /peer?publickey=<publickey>
connection state
endpoint
if connected
shared secret
add POST /peer?publickey=<publickey>
optionally endpoint
shared secret
set PUT /peer?publickey=<publickey>
endpoint
shared secret
del DELETE /peer?publickey=<publickey>
public key
list -> public keys GET /peers
Outdated!
Performs cryptographic operations on a packet, the data in the Packet
structure will be decrypted/encrypted
based on the message type, returns modified Packet
Encrypt
struct Encrypt { packet: Packet, xaed: XChaCha20Poly1305 } -> EResult<Packet>
Decrypt
struct Decrypt { packet: Packet, xaed: XChaCha20Poly1305 } -> EResult<Packet>
Transfers the cryptographic operation down to the workers, which actually perform the work. The additional buffer is
needed for the operation and is fetched from the Central Store
. The workers themselves can't do it, since they're
SyncActors
.
Encrypt
struct Encrypt { packet: Packet, xaed: XChaCha20Poly1305, buffer: BytesMut } -> EResult<(Packet, BytesMut)>
Decrypt
struct Decrypt { packet: Packet, xaed: XChaCha20Poly1305, buffer: BytesMut } -> EResult<(Packet, BytesMut)>
Used to get and return BytesMut
to hopeful avoid allocations whenever possible.
GetBytesMut
struct GetBytesMut {} -> EResult<BytesMut>
ReturnBytesMut
struct ReturnBytesMut(BytesMut)
Just passes the received or to be sent packets from/to the NetworkGateway to/from the CentralProcessor.
(Packet, SockAddr) -> Result<(), ()>
Calls the provided closure with a mutable reference to the Peer with the provided public key, provided it exists.
struct EditPeer<R: 'static, F: Fn(&mut Peer) -> R> { public_key: PublicKey, fun: F, } -> EResult<R>
Calls the provided closure with an immutable reference to the Peer with the provided public key, provided it exists.
struct GetPeer<R: 'static, F: Fn(&Peer) -> R> { public_key: PublicKey, fun: F, } -> EResult<R>
Add a new peer, with the provided parameters, fails if a peer with the same public key already exists.
struct AddPeer { public_key: PublicKey, endpoint: Option<SocketAddr>, shared_secret: SharedSecret } -> EResult<()>
Deletes a peer with the provided public key, fails if the peer doesn't exist.
struct DeletePeer { public_key: PublicKey } -> EResult<()>
Lists all peers.
struct ListPeers() -> EResult<Vec<Peer>>
Maps an id hash to a public key, if it exists.
struct MapIdHash { idhash: IdHash } -> EResult<PublicKey>