/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2018 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2019 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
MaxOnlineTime uint
}
-func (ctx *Ctx) CallNode(node *Node, addrs []string, nice uint8, xxOnly TRxTx, rxRate, txRate int, onlineDeadline, maxOnlineTime uint) (isGood bool) {
+func (ctx *Ctx) CallNode(
+ node *Node,
+ addrs []string,
+ nice uint8,
+ xxOnly TRxTx,
+ rxRate, txRate int,
+ onlineDeadline, maxOnlineTime uint,
+ listOnly bool,
+ onlyPkts map[[32]byte]bool,
+) (isGood bool) {
for _, addr := range addrs {
sds := SDS{"node": node.Id, "addr": addr}
ctx.LogD("call", sds, "dialing")
continue
}
ctx.LogD("call", sds, "connected")
- state, err := ctx.StartI(
- conn,
- node.Id,
- nice,
- xxOnly,
- rxRate,
- txRate,
- onlineDeadline,
- maxOnlineTime,
- )
- if err == nil {
+ state := SPState{
+ Ctx: ctx,
+ Node: node,
+ Nice: nice,
+ onlineDeadline: onlineDeadline,
+ maxOnlineTime: maxOnlineTime,
+ xxOnly: xxOnly,
+ rxRate: rxRate,
+ txRate: txRate,
+ listOnly: listOnly,
+ onlyPkts: onlyPkts,
+ }
+ if err = state.StartI(conn); err == nil {
ctx.LogI("call-start", sds, "connected")
state.Wait()
ctx.LogI("call-finish", SDS{