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
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
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
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])
fmt.Fprintf(os.Stderr, " %s [options] -rx [-check] [-dryrun] [NODE ...] < ...\n", os.Args[0])
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])
fmt.Fprintf(os.Stderr, " %s [options] -rx [-check] [-dryrun] [NODE ...] < ...\n", os.Args[0])
doRx = flag.Bool("rx", false, "Receive packets")
doTx = flag.Bool("tx", false, "Transfer packets")
doDelete = flag.Bool("delete", false, "Delete transferred packets")
doCheck = flag.Bool("check", false, "Check integrity while receiving")
doRx = flag.Bool("rx", false, "Receive packets")
doTx = flag.Bool("tx", false, "Transfer packets")
doDelete = flag.Bool("delete", false, "Delete transferred packets")
doCheck = flag.Bool("check", false, "Check integrity while receiving")
spoolPath = flag.String("spool", "", "Override path to spool")
logPath = flag.String("log", "", "Override path to logfile")
quiet = flag.Bool("quiet", false, "Print only errors")
spoolPath = flag.String("spool", "", "Override path to spool")
logPath = flag.String("log", "", "Override path to logfile")
quiet = flag.Bool("quiet", false, "Print only errors")
+ Format: tar.FormatUSTAR,
+ Name: nncp.NNCPBundlePrefix,
+ Mode: 0700,
+ Typeflag: tar.TypeDir,
+ }); err != nil {
+ log.Fatalln("Error writing tar header:", err)
+ }
+ if err = tarWr.WriteHeader(&tar.Header{
+ Format: tar.FormatPAX,
+ if entry.Typeflag != tar.TypeDir {
+ ctx.LogD("nncp-bundle", sds, "Expected NNCP/")
+ continue
+ }
+ entry, err = tarR.Next()
+ if err != nil {
+ if err != io.EOF {
+ ctx.LogD(
+ "nncp-bundle",
+ nncp.SdsAdd(sds, nncp.SDS{"err": err}),
+ "error reading tar",
+ )
+ }
+ continue
+ }
sds["pkt"] = entry.Name
if entry.Size < nncp.PktEncOverhead {
ctx.LogD("nncp-bundle", sds, "Too small packet")
sds["pkt"] = entry.Name
if entry.Size < nncp.PktEncOverhead {
ctx.LogD("nncp-bundle", sds, "Too small packet")
if err = bufTmp.Flush(); err != nil {
log.Fatalln("Error during flushing:", err)
}
if err = bufTmp.Flush(); err != nil {
log.Fatalln("Error during flushing:", err)
}
tmp.Close()
if err = os.MkdirAll(selfPath, os.FileMode(0700)); err != nil {
log.Fatalln("Error during mkdir:", err)
tmp.Close()
if err = os.MkdirAll(selfPath, os.FileMode(0700)); err != nil {
log.Fatalln("Error during mkdir:", err)