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 3525df77f9 Minor doc changes 3 months ago
.idea General cleanup 10 months ago
benches Worker rework and some crypto stuff 5 months ago
crypto I swear, I'll start making proper commits soon 4 months ago
images I swear, I'll start making proper commits soon 4 months ago
netstar-error I swear, I'll start making proper commits soon 4 months ago
simulator Add simulator 9 months ago
spec Minor doc changes 3 months ago
src simplified config reading 4 months ago
.gitignore General cleanup 10 months ago
Cargo.toml Some doc changes and tun-tokio 3 months ago
LICENSE Initial commit 1 year ago
README.org Minor doc changes 3 months ago
build.rs All hail borsh 1 year ago
config.toml I swear, I'll start making proper commits soon 4 months ago
config2.toml I swear, I'll start making proper commits soon 4 months ago
rustfmt.toml Implement basic handshake behaviour 8 months ago
test.sh I swear, I'll start making proper commits soon 4 months 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>

f7

Attempts to perform a handshake with the given peer.

  struct AttemptHandshake {
public_key: PublicKey
  } -> EResult<()>