Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
0oM4R committed Sep 12, 2023
1 parent 5cdca62 commit 7f13a46
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions v2go2tgrid/tfgrid/znet.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ pub mut:
// unique nr for each network chosen, this identified private networks as connected to a container or vm or ...
// corresponds to the 2nd number of a class B ipv4 address
// is a class C of a chosen class B

// IPV4 subnet for this network resource
// this must be a valid subnet of the entire network ip range.
// for example 10.1.1.0/24
subnet string
subnet string
// IP range of the network, must be an IPv4 /16
// for example a 10.1.0.0/16
ip_range string
ip_range string
// wireguard private key, curve25519
// TODO: is this in libsodium
wireguard_private_key string //TODO: what is format
// TODO: is this in libsodium
wireguard_private_key string // TODO: what is format
//>1024?
wireguard_listen_port u16
peers []Peer
Expand All @@ -41,25 +40,20 @@ pub fn (mut n Znet) challenge() string {
// is a remote wireguard client which can connect to this node
pub struct Peer {
pub mut:

subnet string // IPV4 subnet of the network resource of the peer


wireguard_public_key string // WGPublicKey of the peer (driven from its private key)

//is ipv4 or ipv6 address from a wireguard client who connects
//this should be the node's subnet and the wireguard routing ip that should start with `100.64`
//then the 2nd and 3rd part of the node's subnet
//e.g. ["10.20.2.0/24", "100.64.20.2/32"]
allowed_ips []string
wireguard_public_key string // WGPublicKey of the peer (driven from its private key)
// is ipv4 or ipv6 address from a wireguard client who connects
// this should be the node's subnet and the wireguard routing ip that should start with `100.64`
// then the 2nd and 3rd part of the node's subnet
// e.g. ["10.20.2.0/24", "100.64.20.2/32"]
allowed_ips []string
// Entrypoint of the peer; ipv4 or ipv6,
// can be empty, one of the 2 need to be filled in though
//e.g. [2a10:b600:0:9:225:90ff:fe82:7130]:7777
endpoint string
// e.g. [2a10:b600:0:9:225:90ff:fe82:7130]:7777
endpoint string
}



pub fn (mut p Peer) challenge() string {
mut out := ''
out += p.wireguard_public_key
Expand Down

0 comments on commit 7f13a46

Please sign in to comment.