You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Magic_RB b6a7f31fbd Merge pull request 'simplified config reading' (#3) from ThyW/netstar:fix into master 2 weeks ago
.idea General cleanup 6 months ago
benches Worker rework and some crypto stuff 1 month ago
crypto I swear, I'll start making proper commits soon 2 weeks ago
images I swear, I'll start making proper commits soon 2 weeks ago
netstar-error I swear, I'll start making proper commits soon 2 weeks ago
simulator Add simulator 5 months ago
spec Delete spec.tex 2 weeks ago
src simplified config reading 2 weeks ago
.gitignore General cleanup 6 months ago
Cargo.toml I swear, I'll start making proper commits soon 2 weeks ago
LICENSE Initial commit 1 year ago
README.org I swear, I'll start making proper commits soon 2 weeks ago
build.rs All hail borsh 10 months ago
config.toml I swear, I'll start making proper commits soon 2 weeks ago
config2.toml I swear, I'll start making proper commits soon 2 weeks ago
rustfmt.toml Implement basic handshake behaviour 4 months ago
test.sh I swear, I'll start making proper commits soon 2 weeks ago

README.org

netstar

TODO Transparent REST

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)

TODO How to handle keepalives and handshakes

Should a handshake be sent automatically? Is it dangerous? Should the user be able to manually send one? Decide and implement.

Peer API

  • 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

Description

Outdated!

/Magic_RB/netstar/src/branch/master/images/graph.png

f1

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>
    

f2

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)>
    

f3

Used to get and return BytesMut to hopeful avoid allocations whenever possible.

  • GetBytesMut

    struct GetBytesMut {} -> EResult<BytesMut>
    
  • ReturnBytesMut

      struct ReturnBytesMut(BytesMut)
    

f4

Just passes the received or to be sent packets from/to the NetworkGateway to/from the CentralProcessor.

  (Packet, SockAddr) -> Result<(), ()>

f5

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>>

f6

Maps an id hash to a public key, if it exists.

  struct MapIdHash {
      idhash: IdHash
  } -> EResult<PublicKey>