@@ -22,7 +22,7 @@ import (
22
22
"golang.org/x/net/publicsuffix"
23
23
)
24
24
25
- func NewOutput (ctx context.Context , g * netmap.Graph , e * enum.Enumeration , filter * stringset.Set ) []string {
25
+ func NewOutput (ctx context.Context , g * netmap.Graph , e * enum.Enumeration , filter * stringset.Set , since time. Time ) []string {
26
26
var output []string
27
27
28
28
// Make sure a filter has been created
@@ -32,26 +32,27 @@ func NewOutput(ctx context.Context, g *netmap.Graph, e *enum.Enumeration, filter
32
32
}
33
33
34
34
var assets []* types.Asset
35
- qtime := e .Config .CollectionStartTime .UTC ()
36
35
for _ , atype := range []oam.AssetType {oam .FQDN , oam .IPAddress , oam .Netblock , oam .ASN , oam .RIROrg } {
37
- if a , err := g .DB .FindByType (atype , qtime ); err == nil {
36
+ if a , err := g .DB .FindByType (atype , since . UTC () ); err == nil {
38
37
assets = append (assets , a ... )
39
38
}
40
39
}
41
40
41
+ arrow := white ("-->" )
42
+ start := e .Config .CollectionStartTime .UTC ()
42
43
for _ , from := range assets {
43
- fromstr := extractAssetName (from , qtime )
44
+ fromstr := extractAssetName (from )
44
45
45
- if rels , err := g .DB .OutgoingRelations (from , qtime ); err == nil {
46
+ if rels , err := g .DB .OutgoingRelations (from , start ); err == nil {
46
47
for _ , rel := range rels {
47
48
lineid := from .ID + rel .ID + rel .ToAsset .ID
48
49
if filter .Has (lineid ) {
49
50
continue
50
51
}
51
- if to , err := g .DB .FindById (rel .ToAsset .ID , qtime ); err == nil {
52
- tostr := extractAssetName (to , qtime )
52
+ if to , err := g .DB .FindById (rel .ToAsset .ID , start ); err == nil {
53
+ tostr := extractAssetName (to )
53
54
54
- output = append (output , fmt .Sprintf ("%s %s %s %s %s" , fromstr , "-->" , magenta (rel .Type ), "-->" , tostr ))
55
+ output = append (output , fmt .Sprintf ("%s %s %s %s %s" , fromstr , arrow , magenta (rel .Type ), arrow , tostr ))
55
56
filter .Insert (lineid )
56
57
}
57
58
}
@@ -61,7 +62,7 @@ func NewOutput(ctx context.Context, g *netmap.Graph, e *enum.Enumeration, filter
61
62
return output
62
63
}
63
64
64
- func extractAssetName (a * types.Asset , since time. Time ) string {
65
+ func extractAssetName (a * types.Asset ) string {
65
66
var result string
66
67
67
68
switch a .Asset .AssetType () {
0 commit comments