Showpaths: Add expiration timestamp
@@ -33,6 +33,7 @@ var (
timeout = flag.Duration("timeout", 2*time.Second, "SCIOND connection timeout")
maxPaths = flag.Int("maxpaths", 10, "Maximum number of paths")
sciondFromIA = flag.Bool("sciondFromIA", false, "SCIOND socket path from IA address:ISD-AS")
+ expiration = flag.Bool("expiration", false, "Show path expiration timestamps")
)
var (
@@ -58,7 +59,12 @@ func main() {
fmt.Println("Available paths to", dstIA)
i := 0
for _, path := range reply.Entries {
+ if *expiration {
+ fmt.Printf("[%2d] %s Expires: %s (%s)\n", i, path.Path.String(), path.Path.Expiry(),
+ time.Until(path.Path.Expiry()).Truncate(time.Second))
+ } else {
fmt.Printf("[%2d] %s\n", i, path.Path.String())
+ }
i++
}
}
