If set, then apply @ref{OptMinSize, -minsize} option during file
transmission.
+@anchor{CfgVia}
@item via
An array of node identifiers that will be used as a relay to that node.
For example @verb{|[foo,bar]|} means that packet can reach current node
1-255 values are allowed.
@item -node
Process only single specified node.
+@item -via
+ Override @ref{CfgVia, via} configuration option for destination node.
+ Specified nodes must be separated with comma: @verb{|NODE1,NODE2|}.
@item -spool
Override path to spool directory. May be specified by
@env{NNCPSPOOL} environment variable.
@node Новости
@section Новости
+@node Релиз 2.1
+@subsection Релиз 2.1
+@itemize
+@item
+Возможность переопределить @option{via} опцию конфигурации для целевого
+узла через @option{-via} опцию командной строки для следующих команд:
+@command{nncp-file}, @command{nncp-freq}, @command{nncp-mail}.
+@end itemize
+
@node Релиз 2.0
@subsection Релиз 2.0
@itemize
See also this page @ref{Новости, on russian}.
+@node Release 2.1
+@section Release 2.1
+@itemize
+@item
+Ability to override @option{via} configuration option for destination
+node via @option{-via} command line option for following commands:
+@command{nncp-file}, @command{nncp-freq}, @command{nncp-mail}.
+@end itemize
+
@node Release 2.0
@section Release 2.0
@itemize
func main() {
var (
- cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
- niceRaw = flag.Int("nice", nncp.DefaultNiceFile, "Outbound packet niceness")
- minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
- chunkSize = flag.Uint64("chunked", 0, "Split file on specified size chunks, in KiB")
- spoolPath = flag.String("spool", "", "Override path to spool")
- logPath = flag.String("log", "", "Override path to logfile")
- quiet = flag.Bool("quiet", false, "Print only errors")
- debug = flag.Bool("debug", false, "Print debug messages")
- version = flag.Bool("version", false, "Print version information")
- warranty = flag.Bool("warranty", false, "Print warranty information")
+ cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+ niceRaw = flag.Int("nice", nncp.DefaultNiceFile, "Outbound packet niceness")
+ minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
+ chunkSize = flag.Uint64("chunked", 0, "Split file on specified size chunks, in KiB")
+ viaOverride = flag.String("via", "", "Override Via path to destination node")
+ spoolPath = flag.String("spool", "", "Override path to spool")
+ logPath = flag.String("log", "", "Override path to logfile")
+ quiet = flag.Bool("quiet", false, "Print only errors")
+ debug = flag.Bool("debug", false, "Print debug messages")
+ version = flag.Bool("version", false, "Print version information")
+ warranty = flag.Bool("warranty", false, "Print warranty information")
)
flag.Usage = usage
flag.Parse()
log.Fatalln("Invalid NODE specified:", err)
}
+ if *viaOverride != "" {
+ vias := make([]*nncp.NodeId, 0, strings.Count(*viaOverride, ",")+1)
+ for _, via := range strings.Split(*viaOverride, ",") {
+ foundNodeId, err := ctx.FindNode(via)
+ if err != nil {
+ log.Fatalln("Invalid Via node specified:", err)
+ }
+ vias = append(vias, foundNodeId.Id)
+ }
+ node.Via = vias
+ }
+
if *chunkSize == 0 {
err = ctx.TxFile(
node,
func main() {
var (
- cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
- niceRaw = flag.Int("nice", nncp.DefaultNiceFreq, "Outbound packet niceness")
- minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
- spoolPath = flag.String("spool", "", "Override path to spool")
- logPath = flag.String("log", "", "Override path to logfile")
- quiet = flag.Bool("quiet", false, "Print only errors")
- debug = flag.Bool("debug", false, "Print debug messages")
- version = flag.Bool("version", false, "Print version information")
- warranty = flag.Bool("warranty", false, "Print warranty information")
+ cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+ niceRaw = flag.Int("nice", nncp.DefaultNiceFreq, "Outbound packet niceness")
+ minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
+ viaOverride = flag.String("via", "", "Override Via path to destination node")
+ spoolPath = flag.String("spool", "", "Override path to spool")
+ logPath = flag.String("log", "", "Override path to logfile")
+ quiet = flag.Bool("quiet", false, "Print only errors")
+ debug = flag.Bool("debug", false, "Print debug messages")
+ version = flag.Bool("version", false, "Print version information")
+ warranty = flag.Bool("warranty", false, "Print warranty information")
)
flag.Usage = usage
flag.Parse()
log.Fatalln("Invalid NODE specified:", err)
}
+ if *viaOverride != "" {
+ vias := make([]*nncp.NodeId, 0, strings.Count(*viaOverride, ",")+1)
+ for _, via := range strings.Split(*viaOverride, ",") {
+ foundNodeId, err := ctx.FindNode(via)
+ if err != nil {
+ log.Fatalln("Invalid Via node specified:", err)
+ }
+ vias = append(vias, foundNodeId.Id)
+ }
+ node.Via = vias
+ }
+
var dst string
if flag.NArg() == 2 {
dst = flag.Arg(1)
func main() {
var (
- cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
- niceRaw = flag.Int("nice", nncp.DefaultNiceMail, "Outbound packet niceness")
- minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
- spoolPath = flag.String("spool", "", "Override path to spool")
- logPath = flag.String("log", "", "Override path to logfile")
- quiet = flag.Bool("quiet", false, "Print only errors")
- debug = flag.Bool("debug", false, "Print debug messages")
- version = flag.Bool("version", false, "Print version information")
- warranty = flag.Bool("warranty", false, "Print warranty information")
+ cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+ niceRaw = flag.Int("nice", nncp.DefaultNiceMail, "Outbound packet niceness")
+ minSize = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
+ viaOverride = flag.String("via", "", "Override Via path to destination node")
+ spoolPath = flag.String("spool", "", "Override path to spool")
+ logPath = flag.String("log", "", "Override path to logfile")
+ quiet = flag.Bool("quiet", false, "Print only errors")
+ debug = flag.Bool("debug", false, "Print debug messages")
+ version = flag.Bool("version", false, "Print version information")
+ warranty = flag.Bool("warranty", false, "Print warranty information")
)
flag.Usage = usage
flag.Parse()
log.Fatalln("Invalid NODE specified:", err)
}
+ if *viaOverride != "" {
+ vias := make([]*nncp.NodeId, 0, strings.Count(*viaOverride, ",")+1)
+ for _, via := range strings.Split(*viaOverride, ",") {
+ foundNodeId, err := ctx.FindNode(via)
+ if err != nil {
+ log.Fatalln("Invalid Via node specified:", err)
+ }
+ vias = append(vias, foundNodeId.Id)
+ }
+ node.Via = vias
+ }
+
body, err := ioutil.ReadAll(bufio.NewReader(os.Stdin))
if err != nil {
log.Fatalln("Can not read mail body from stdin:", err)