- state, err := ctx.StartI(conn, node.Id, nice, &xxOnly)
- if err == nil {
- ctx.LogI("call-start", nncp.SDS{"node": state.NodeId}, "connected")
- state.Wait()
- ctx.LogI("call-finish", nncp.SDS{
- "node": state.NodeId,
- "duration": strconv.FormatInt(int64(state.Duration.Seconds()), 10),
- "rxbytes": strconv.FormatInt(state.RxBytes, 10),
- "txbytes": strconv.FormatInt(state.TxBytes, 10),
- "rxspeed": strconv.FormatInt(state.RxSpeed, 10),
- "txspeed": strconv.FormatInt(state.TxSpeed, 10),
- }, "")
+
+ var addrs []string
+ if flag.NArg() == 2 {
+ addrs = append(addrs, flag.Arg(1))
+ } else if len(splitted) == 2 {
+ addr, known := ctx.Neigh[*node.Id].Addrs[splitted[1]]
+ if !known {
+ log.Fatalln("Unknown ADDR specified")
+ }
+ addrs = append(addrs, addr)