Skip to content

Commit

Permalink
feat: Aggregate lists and limit max len to DFZ standard
Browse files Browse the repository at this point in the history
  • Loading branch information
JouanDeag committed Aug 16, 2024
1 parent e96906c commit b321b9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
go-irr:
image: ghcr.io/jouandeag/go-irr:main
image: ghcr.io/jouandeag/go-irr:latest
ports:
- '8080:8080'
environment:
Expand Down
13 changes: 12 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,18 @@ func getPrefixList(addressFamily string, routerOs string, asnOrAsSet string, isA
asnOrAsSet = strings.ReplaceAll(asnOrAsSet, "_", ":")
}

cmd := exec.Command("bgpq4", "-"+addressFamily, "-"+routerOs, asnOrAsSet)
aggregate := "-3"

if routerOs != "J" {
aggregate = "-A"
}

maxLen := "-m 24"
if addressFamily == "6" {
maxLen = "-m 48"
}

cmd := exec.Command("bgpq4", aggregate, maxLen, "-"+addressFamily, "-"+routerOs, asnOrAsSet)

var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
Expand Down

0 comments on commit b321b9f

Please sign in to comment.