#!/bin/sh -e
-cd "$(realpath -- $(dirname "$0"))"/../src
+cd "$(realpath -- $(dirname "$0"))"/src
+mkdir -p ../bin
GO=${GO:-go}
. ../config
[ -d vendor ] && vendor="-mod=vendor" || :
GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSendmailPath=$SENDMAIL"
GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultSpoolPath=$SPOOLPATH"
GO_LDFLAGS="$GO_LDFLAGS -X $mod.DefaultLogPath=$LOGPATH"
-for cmd in `cat ../bin/cmd.list` ; do
- $GO build $vendor -o ../bin/$cmd $GO_CFLAGS -ldflags "$GO_LDFLAGS" ./cmd/$cmd
-done
+$GO build $vendor -o ../bin/nncp $GO_CFLAGS -ldflags "$GO_LDFLAGS" ./cmd/nncp
$GO build $vendor -o ../bin/hjson-cli $GO_CFLAGS github.com/hjson/hjson-go/v4/hjson-cli
+cd ../bin
+for cmd in `cat ../cmd.list` ; do
+ ln -fs nncp $cmd
+done
$ xz -d <nncp-@value{VERSION}.tar.xz | tar xf -
$ cd nncp-@value{VERSION}
[optionally edit config]
-$ bin/build
+$ ./build
@end example
@pindex info
usage at all:
@example
-$ GO_CFLAGS="-tags nofsnotify" bin/build
+$ GO_CFLAGS="-tags nofsnotify" ./build
@end example
@vindex noyggdrasil
@node Новости
@section Новости
+@node Релиз 8.12.0
+@subsection Релиз 8.12.0
+@itemize
+
+@item
+Объединить все исполняемые файлы в одну @command{nncp} команду.
+Вам стоит добавить символические ссылки всех @command{nncp-*} команд на неё.
+
+@end itemize
+
@node Релиз 8.11.0
@subsection Релиз 8.11.0
@itemize
See also this page @ref{Новости, in russian}.
+@node Release 8_12_0
+@section Release 8.12.0
+@itemize
+
+@item
+Combine all executables in single @command{nncp}.
+You should symlink all @command{nncp-*} commands to it.
+
+@end itemize
+
@node Release 8_11_0
@section Release 8.11.0
@itemize
. ./config
mkdir -p "$BINDIR"
-for cmd in `cat bin/cmd.list` ; do
- cp -f bin/$cmd "$BINDIR"
- chmod 755 "$BINDIR"/$cmd
+cp -f bin/nncp "$BINDIR"
+chmod 755 "$BINDIR"/nncp
+for cmd in `cat cmd.list` ; do
+ ln -fs nncp "$BINDIR"/$cmd
done
mkdir -p "$INFODIR"
cd "$root"
./install
. ./config
-for cmd in `cat bin/cmd.list` ; do
- strip "$BINDIR"/$cmd
-done
+strip "$BINDIR"/nncp
find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +
find . -type f -name "*.sh" -exec chmod +x {} +
-chmod +x bin/build install install-strip uninstall
+chmod +x build install install-strip uninstall
cd ..
detpax nncp-"$release" | xz -9v >nncp-"$release".tar.xz
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageACK() {
fmt.Fprint(os.Stderr, "nncp-ack -- send packet receipt acknowledgement\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] -all\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Usage: %s [options] -node NODE[,...]\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainACK() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq),
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageACK
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
}
if *doAll {
if len(nodes) != 0 {
- usage()
+ usageACK()
os.Exit(1)
}
for _, node := range ctx.Neigh {
nodes = append(nodes, node)
}
} else if len(nodes) == 0 {
- usage()
+ usageACK()
os.Exit(1)
}
if *pktRaw != "" {
if len(nodes) != 1 {
- usage()
+ usageACK()
os.Exit(1)
}
nncp.ViaOverride(*viaOverride, ctx, nodes[0])
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageBundle() {
fmt.Fprint(os.Stderr, "nncp-bundle -- Create/digest stream of NNCP encrypted packets\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] -tx [-delete] NODE [NODE ...] >...\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] -rx -delete [-dryrun] [NODE ...] <...\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainBundle() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(255), "Minimal required niceness")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageBundle
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCall() {
fmt.Fprint(os.Stderr, "nncp-call -- call TCP daemon\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE[:ADDR] [FORCEADDR]\n", os.Args[0])
fmt.Fprintln(os.Stderr, "Options:")
flag.PrintDefaults()
}
-func main() {
+func mainCall() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
ucspi = flag.Bool("ucspi", false, "Is it started as UCSPI-TCP client")
"Generate ACK packets")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCall
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() < 1 {
- usage()
+ usageCall()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCaller() {
fmt.Fprint(os.Stderr, "nncp-caller -- croned NNCP TCP daemon caller\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] [NODE ...]\n", os.Args[0])
fmt.Fprintln(os.Stderr, "Options:")
flag.PrintDefaults()
}
-func main() {
+func mainCaller() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
spoolPath = flag.String("spool", "", "Override path to spool")
"Generate ACK packets")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCaller
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCfgDir() {
fmt.Fprint(os.Stderr, "nncp-cfgdir -- Convert configuration file to the directory layout.\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] [-cfg ...] -dump /path/to/dir\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] -load /path/to/dir >cfg.hjson\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainCfgDir() {
var (
doDump = flag.Bool("dump", false, "Dump configuration file to the directory")
doLoad = flag.Bool("load", false, "Load directory to create configuration file")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCfgDir
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
}
if (!*doDump && !*doLoad) || flag.NArg() != 1 {
- usage()
+ usageCfgDir()
os.Exit(1)
}
"golang.org/x/term"
)
-func usage() {
+func usageCfgEnc() {
fmt.Fprint(os.Stderr, "nncp-cfgenc -- encrypt/decrypt configuration file\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] cfg.hjson >cfg.hjson.eblob\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] -d cfg.hjson.eblob >cfg.hjson\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainCfgEnc() {
var (
decrypt = flag.Bool("d", false, "Decrypt the file")
dump = flag.Bool("dump", false, "Print human-readable eblob information")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCfgEnc
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
}
if flag.NArg() != 1 {
- usage()
+ usageCfgEnc()
os.Exit(1)
}
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCfgMin() {
fmt.Fprint(os.Stderr, "nncp-cfgmin -- print stripped configuration\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainCfgMin() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCfgMin
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCfgNew() {
fmt.Fprintln(os.Stderr, "nncp-cfgnew -- generate new configuration and keys\nOptions:")
flag.PrintDefaults()
}
-func main() {
+func mainCfgNew() {
var (
areaName = flag.String("area", "", "Generate area's keypairs")
yggdrasil = flag.Bool("yggdrasil", false, "Generate Yggdrasil keypair")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCfgNew
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCheck() {
fmt.Fprint(os.Stderr, "nncp-check -- verify Rx/Tx packets checksum\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [-nock] [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainCheck() {
var (
nock = flag.Bool("nock", false, "Process .nock files")
cycle = flag.Uint("cycle", 0, "Repeat check after N seconds in infinite loop")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCheck
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageCronExpr() {
fmt.Fprint(os.Stderr, "nncp-cronexpr -- cron expression checker\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [-num XXX] CRON-EXPRESSION\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainCronExpr() {
var (
num = flag.Uint("num", 10, "Number of future entries to print")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageCronExpr
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"golang.org/x/net/netutil"
)
-func usage() {
+func usageDaemon() {
fmt.Fprint(os.Stderr, "nncp-daemon -- TCP daemon\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
return nil
}
-func main() {
+func mainDaemon() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(255), "Minimal required niceness")
"Generate ACK packets")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageDaemon
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageExec() {
fmt.Fprint(os.Stderr, "nncp-exec -- send execution command\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE HANDLE [ARG0 ARG1 ...]\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] %s:AREA HANDLE [ARG0 ARG1 ...]\nOptions:\n",
flag.PrintDefaults()
}
-func main() {
+func mainExec() {
var (
noCompress = flag.Bool("nocompress", false, "Do not compress input data")
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageExec
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() < 2 {
- usage()
+ usageExec()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageFile() {
fmt.Fprint(os.Stderr, "nncp-file -- send file\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] SRC NODE:[DST]\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] SRC %s:AREA:[DST]\nOptions:\n",
`)
}
-func main() {
+func mainFile() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile),
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageFile
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() != 2 {
- usage()
+ usageFile()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
splitted := strings.Split(flag.Arg(1), ":")
if len(splitted) < 2 {
- usage()
+ usageFile()
os.Exit(1)
}
var areaId *nncp.AreaId
var node *nncp.Node
if splitted[0] == nncp.AreaDir {
if len(splitted) < 3 {
- usage()
+ usageFile()
os.Exit(1)
}
areaId = ctx.AreaName2Id[splitted[1]]
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageFreq() {
fmt.Fprint(os.Stderr, "nncp-freq -- send file request\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE:SRC [DST]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainFreq() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq),
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageFreq
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() == 0 {
- usage()
+ usageFreq()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
splitted := strings.SplitN(flag.Arg(0), ":", 2)
if len(splitted) != 2 {
- usage()
+ usageFreq()
os.Exit(1)
}
node, err := ctx.FindNode(splitted[0])
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageHash() {
fmt.Fprint(os.Stderr, "nncp-hash -- calculate MTH hash of the file\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [-file ...] [-seek X] [-debug] [-progress] [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainHash() {
var (
fn = flag.String("file", "", "Read the file instead of stdin")
seek = flag.Uint64("seek", 0, "Seek the file, hash, rewind, hash remaining")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageHash
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/recfile/v3"
)
-func usage() {
+func usageLog() {
fmt.Fprint(os.Stderr, "nncp-log -- read logs\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainLog() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
logPath = flag.String("log", "", "Override path to logfile")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageLog
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
--- /dev/null
+package main
+
+import (
+ "flag"
+ "fmt"
+ "os"
+ "path"
+
+ "go.cypherpunks.su/nncp/v8"
+)
+
+const (
+ CmdNameACK = "nncp-ack"
+ CmdNameBundle = "nncp-bundle"
+ CmdNameCall = "nncp-call"
+ CmdNameCaller = "nncp-caller"
+ CmdNameCfgDir = "nncp-cfgdir"
+ CmdNameCfgEnc = "nncp-cfgenc"
+ CmdNameCfgMin = "nncp-cfgmin"
+ CmdNameCfgNew = "nncp-cfgnew"
+ CmdNameCheck = "nncp-check"
+ CmdNameCronExpr = "nncp-cronexpr"
+ CmdNameDaemon = "nncp-daemon"
+ CmdNameExec = "nncp-exec"
+ CmdNameFile = "nncp-file"
+ CmdNameFreq = "nncp-freq"
+ CmdNameHash = "nncp-hash"
+ CmdNameLog = "nncp-log"
+ CmdNameMain = "nncp-main"
+ CmdNamePkt = "nncp-pkt"
+ CmdNameReass = "nncp-reass"
+ CmdNameRm = "nncp-rm"
+ CmdNameStat = "nncp-stat"
+ CmdNameToss = "nncp-toss"
+ CmdNameTrns = "nncp-trns"
+ CmdNameXfer = "nncp-xfer"
+)
+
+func main() {
+ cmdName := path.Base(os.Args[0])
+ switch cmdName {
+ case CmdNameACK:
+ mainACK()
+ case CmdNameBundle:
+ mainBundle()
+ case CmdNameCall:
+ mainCall()
+ case CmdNameCaller:
+ mainCaller()
+ case CmdNameCfgDir:
+ mainCfgDir()
+ case CmdNameCfgEnc:
+ mainCfgEnc()
+ case CmdNameCfgMin:
+ mainCfgMin()
+ case CmdNameCfgNew:
+ mainCfgNew()
+ case CmdNameCheck:
+ mainCheck()
+ case CmdNameCronExpr:
+ mainCronExpr()
+ case CmdNameDaemon:
+ mainDaemon()
+ case CmdNameExec:
+ mainExec()
+ case CmdNameFile:
+ mainFile()
+ case CmdNameFreq:
+ mainFreq()
+ case CmdNameHash:
+ mainHash()
+ case CmdNameLog:
+ mainLog()
+ case CmdNamePkt:
+ mainPkt()
+ case CmdNameReass:
+ mainReass()
+ case CmdNameRm:
+ mainRm()
+ case CmdNameStat:
+ mainStat()
+ case CmdNameToss:
+ mainToss()
+ case CmdNameTrns:
+ mainTrns()
+ case CmdNameXfer:
+ mainXfer()
+ default:
+ version := flag.Bool("version", false, "Print version information")
+ warranty := flag.Bool("warranty", false, "Print warranty information")
+ flag.Parse()
+ if *warranty {
+ fmt.Println(nncp.Warranty)
+ return
+ }
+ if *version {
+ fmt.Println(nncp.VersionGet())
+ return
+ }
+ }
+}
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usagePkt() {
fmt.Fprint(os.Stderr, "nncp-pkt -- parse raw packet\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
}
-func main() {
+func mainPkt() {
var (
overheads = flag.Bool("overheads", false, "Print packet overheads")
dump = flag.Bool("dump", false, "Write decrypted/parsed payload to stdout")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usagePkt
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageReass() {
fmt.Fprint(os.Stderr, "nncp-reass -- reassemble chunked files\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] [FILE.nncp.meta]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
`)
}
-func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bool {
+func reassProcess(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bool {
fd, err := os.Open(path)
if err != nil {
log.Fatalln("Can not open file:", err)
return metaPaths
}
-func main() {
+func mainReass() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
allNodes = flag.Bool("all", false, "Process all found chunked files for all nodes")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageReass
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
}
if !(*allNodes || nodeOnly != nil || flag.NArg() > 0) {
- usage()
+ usageReass()
os.Exit(1)
}
if flag.NArg() > 0 && (*allNodes || nodeOnly != nil) {
- usage()
+ usageReass()
os.Exit(1)
}
if *allNodes && nodeOnly != nil {
- usage()
+ usageReass()
os.Exit(1)
}
ctx.Umask()
if flag.NArg() > 0 {
- if process(ctx, flag.Arg(0), *keep, *dryRun, *stdout, *dumpMeta) {
+ if reassProcess(ctx, flag.Arg(0), *keep, *dryRun, *stdout, *dumpMeta) {
return
}
os.Exit(1)
if _, seen := seenMetaPaths[metaPath]; seen {
continue
}
- if !process(ctx, metaPath, *keep, *dryRun, false, false) {
+ if !reassProcess(ctx, metaPath, *keep, *dryRun, false, false) {
hasErrors = true
}
seenMetaPaths[metaPath] = struct{}{}
log.Fatalln("Specified -node does not allow incoming")
}
for _, metaPath := range findMetas(ctx, *nodeOnly.Incoming) {
- if !process(ctx, metaPath, *keep, *dryRun, false, false) {
+ if !reassProcess(ctx, metaPath, *keep, *dryRun, false, false) {
hasErrors = true
}
}
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageRm() {
fmt.Fprint(os.Stderr, "nncp-rm -- remove packet\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] [-older X] -tmp\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] -lock\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainRm() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
doTmp = flag.Bool("tmp", false, "Remove temporary files")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageRm
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
var nodeId *nncp.NodeId
if *nodeRaw == "" {
if !*doAll {
- usage()
+ usageRm()
os.Exit(1)
}
} else {
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageStat() {
fmt.Fprint(os.Stderr, "nncp-stat -- show queued Rx/Tx stats\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] [-pkt] [-node NODE]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
)
}
-func main() {
+func mainStat() {
var (
showPkt = flag.Bool("pkt", false, "Show packets listing")
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageStat
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageToss() {
fmt.Fprint(os.Stderr, "nncp-toss -- process inbound packets\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainToss() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
nodeRaw = flag.String("node", "", "Process only that node")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageToss
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageTrns() {
fmt.Fprint(os.Stderr, "nncp-trns -- transit existing encrypted packet\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] -via NODEx[,...] NODE:PKT\n", os.Args[0])
fmt.Fprintf(os.Stderr, " (to transit SPOOL/NODE/tx/PKT)\n")
flag.PrintDefaults()
}
-func main() {
+func mainTrns() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile),
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageTrns
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() != 1 {
- usage()
+ usageTrns()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
"go.cypherpunks.su/nncp/v8"
)
-func usage() {
+func usageXfer() {
fmt.Fprint(os.Stderr, "nncp-xfer -- copy inbound and outbounds packets\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s [options] DIR\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
-func main() {
+func mainXfer() {
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
nodeRaw = flag.String("node", "", "Process only that node")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
log.SetFlags(log.Lshortfile)
- flag.Usage = usage
+ flag.Usage = usageXfer
flag.Parse()
if *warranty {
fmt.Println(nncp.Warranty)
return
}
if flag.NArg() != 1 {
- usage()
+ usageXfer()
os.Exit(1)
}
nice, err := nncp.NicenessParse(*niceRaw)
)
var (
- Version string = "8.11.0"
+ Version string = "8.12.0"
Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
)
root="$(realpath -- $(dirname "$0"))"
. "$root"/config
cd "$BINDIR"
-rm -f `cat "$root"/bin/cmd.list`
+xargs rm -f <"$root"/cmd.list
+rm -f nncp
rm -f "$INFODIR"/nncp.info
rm -fr "$DOCDIR"