]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-call/main.go
Raise copyright years
[nncp.git] / src / cmd / nncp-call / main.go
index 09c3e18414d56ee94647a2f306ee87d4692823f3..077a907fdcd45761de28ac2bcf1629415bcb954f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ import (
        "strings"
        "time"
 
-       "go.cypherpunks.ru/nncp/v7"
+       "go.cypherpunks.ru/nncp/v8"
 )
 
 func usage() {
@@ -40,6 +40,7 @@ func usage() {
 func main() {
        var (
                cfgPath     = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               ucspi       = flag.Bool("ucspi", false, "Is it started as UCSPI-TCP client")
                niceRaw     = flag.String("nice", nncp.NicenessFmt(255), "Minimal required niceness")
                rxOnly      = flag.Bool("rx", false, "Only receive packets")
                txOnly      = flag.Bool("tx", false, "Only transmit packets")
@@ -61,7 +62,7 @@ func main() {
                maxOnlineTimeSec  = flag.Uint("maxonlinetime", 0, "Override maxonlinetime option")
 
                autoToss       = flag.Bool("autotoss", false, "Toss after call is finished")
-               autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create .seen files during tossing")
+               autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create seen/ files during tossing")
                autoTossNoFile = flag.Bool("autotoss-nofile", false, "Do not process \"file\" packets during tossing")
                autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing")
                autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
@@ -133,7 +134,9 @@ func main() {
        }
 
        var addrs []string
-       if flag.NArg() == 2 {
+       if *ucspi {
+               addrs = append(addrs, nncp.UCSPITCPClient)
+       } else if flag.NArg() == 2 {
                addrs = append(addrs, flag.Arg(1))
        } else if len(splitted) == 2 {
                addr, known := ctx.Neigh[*node.Id].Addrs[splitted[1]]