]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/node.go
Fix invalid -rx/-tx arguments processing
[nncp.git] / src / cypherpunks.ru / nncp / node.go
index 5edd5ead8554817565792bcb22a7c690d8560e85..1ea490309ff45b2146d3e6b22b0317d6b222508e 100644 (file)
@@ -21,8 +21,10 @@ package nncp
 import (
        "crypto/rand"
        "errors"
+       "sync"
 
        "github.com/flynn/noise"
+       "github.com/gorhill/cronexpr"
        "golang.org/x/crypto/blake2b"
        "golang.org/x/crypto/ed25519"
        "golang.org/x/crypto/nacl/box"
@@ -43,9 +45,16 @@ type Node struct {
        Sendmail       []string
        Incoming       *string
        Freq           *string
+       FreqChunked    int64
+       FreqMinSize    int64
        Via            []*NodeId
        Addrs          map[string]string
-       OnlineDeadline int
+       OnlineDeadline uint
+       MaxOnlineTime  uint
+       Calls          []*Call
+
+       Busy bool
+       sync.Mutex
 }
 
 type NodeOur struct {
@@ -58,6 +67,15 @@ type NodeOur struct {
        NoisePrv *[32]byte
 }
 
+type Call struct {
+       Cron           *cronexpr.Expression
+       Nice           uint8
+       Xx             TRxTx
+       Addr           *string
+       OnlineDeadline uint
+       MaxOnlineTime  uint
+}
+
 func NewNodeGenerate() (*NodeOur, error) {
        exchPub, exchPrv, err := box.GenerateKey(rand.Reader)
        if err != nil {