[-pkts PKT,PKT,...]
[-rxrate INT]
[-txrate INT]
+ [-autotoss*]
NODE[:ADDR] [FORCEADDR]
@end example
@command{nncp-call} again, remote node will receive completion
notification.
+@option{-autotoss} options runs tosser on node's spool after call
+is finished. All @option{-autotoss-*} options is the same as in
+@ref{nncp-toss} command.
+
@node nncp-caller
@section nncp-caller
@section nncp-daemon
@example
-$ nncp-daemon [options] [-maxconn INT] [-bind ADDR] [-inetd]
+$ nncp-daemon [options] [-maxconn INT] [-bind ADDR] [-inetd] [-autotoss*]
@end example
Start listening TCP daemon, wait for incoming connections and run
uucp stream tcp6 nowait nncpuser /usr/local/bin/nncp-daemon nncp-daemon -quiet -inetd
@end verbatim
+@option{-autotoss} options runs tosser on node's spool after call
+is finished. All @option{-autotoss-*} options is the same as in
+@ref{nncp-toss} command.
+
@node nncp-exec
@section nncp-exec
@option{-nocompress} опции. Несжатые пакеты не совместимы с предыдущими
версиями NNCP.
+@item
+У команд @command{nncp-call}, @command{nncp-caller} и @command{nncp-daemon}
+появились @option{-autotoss*} опции для запуска tosser после завершения звонка.
+
@item
Обновлены зависимые библиотеки.
options now. Uncompressed packets are not compatible with previous NNCP
versions.
+@item
+@command{nncp-call}, @command{nncp-caller} and @command{nncp-daemon} commands
+have @option{-autotoss*} options for running tosser after call is ended.
+
@item
Updated dependencies.
onlineDeadlineSec = flag.Uint("onlinedeadline", 0, "Override onlinedeadline option")
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")
+ 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")
+ autotossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
)
flag.Usage = usage
flag.Parse()
}
ctx.Umask()
- if !ctx.CallNode(
+ badCode := !ctx.CallNode(
node,
addrs,
nice,
maxOnlineTime,
*listOnly,
onlyPkts,
- ) {
+ )
+ if *autotoss {
+ badCode = ctx.Toss(
+ node.Id,
+ nice,
+ false,
+ *autotossDoSeen,
+ *autotossNoFile,
+ *autotossNoFreq,
+ *autotossNoExec,
+ *autotossNoTrns,
+ ) || badCode
+ }
+ if badCode {
os.Exit(1)
}
}
debug = flag.Bool("debug", false, "Print debug messages")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
+
+ autotoss = flag.Bool("autotoss", false, "Toss after call is finished")
+ 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")
+ autotossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
)
flag.Usage = usage
flag.Parse()
false,
nil,
)
+ if *autotoss {
+ ctx.Toss(
+ node.Id,
+ call.Nice,
+ false,
+ *autotossDoSeen,
+ *autotossNoFile,
+ *autotossNoFreq,
+ *autotossNoExec,
+ *autotossNoTrns,
+ )
+ }
+
node.Lock()
node.Busy = false
node.Unlock()
return c.w.Close()
}
-func performSP(ctx *nncp.Ctx, conn nncp.ConnDeadlined, nice uint8) {
+func performSP(ctx *nncp.Ctx, conn nncp.ConnDeadlined, nice uint8) *nncp.SPState {
state := nncp.SPState{
Ctx: ctx,
Nice: nice,
}
ctx.LogE("call-start", nncp.SDS{"node": nodeId}, err, "")
}
+ return &state
}
func main() {
debug = flag.Bool("debug", false, "Print debug messages")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
+
+ autotoss = flag.Bool("autotoss", false, "Toss after call is finished")
+ 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")
+ autotossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
)
flag.Usage = usage
flag.Parse()
}
ctx.LogD("daemon", nncp.SDS{"addr": conn.RemoteAddr()}, "accepted")
go func(conn net.Conn) {
- performSP(ctx, conn, nice)
+ state := performSP(ctx, conn, nice)
conn.Close() // #nosec G104
+ if *autotoss && state.Node != nil {
+ ctx.Toss(
+ state.Node.Id,
+ nice,
+ false,
+ *autotossDoSeen,
+ *autotossNoFile,
+ *autotossNoFreq,
+ *autotossNoExec,
+ *autotossNoTrns,
+ )
+ }
}(conn)
}
}
dryRun = flag.Bool("dryrun", false, "Do not actually write any tossed data")
doSeen = flag.Bool("seen", false, "Create .seen files")
cycle = flag.Uint("cycle", 0, "Repeat tossing after N seconds in infinite loop")
- noFile = flag.Bool("nofile", false, "Do not process packets with type: file")
- noFreq = flag.Bool("nofreq", false, "Do not process packets with type: freq")
- noExec = flag.Bool("noexec", false, "Do not process packets with type: exec")
- noTrns = flag.Bool("notrns", false, "Do not process packets with type: transitional")
+ noFile = flag.Bool("nofile", false, "Do not process \"file\" packets")
+ noFreq = flag.Bool("nofreq", false, "Do not process \"freq\" packets")
+ noExec = flag.Bool("noexec", false, "Do not process \"exec\" packets")
+ noTrns = flag.Bool("notrns", false, "Do not process \"transitional\" packets")
spoolPath = flag.String("spool", "", "Override path to spool")
logPath = flag.String("log", "", "Override path to logfile")
quiet = flag.Bool("quiet", false, "Print only errors")