New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arista: implement peer-filters #5940
Conversation
Fist pass at implementing BGP peer-filters for dynamic neighbors.
Codecov Report
@@ Coverage Diff @@
## master #5940 +/- ##
=========================================
Coverage 72.10% 72.11%
- Complexity 34149 34167 +18
=========================================
Files 2807 2809 +2
Lines 140390 140450 +60
Branches 16862 16878 +16
=========================================
+ Hits 101235 101283 +48
- Misses 31253 31260 +7
- Partials 7902 7907 +5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 14 of 14 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @progwriter)
projects/batfish/src/main/antlr4/org/batfish/grammar/arista/AristaParser.g4, line 2746 at r1 (raw file):
seq = DEC MATCH | MATCH
I would write this as (seq = DEC)? MATCH
but i'm not sure if this matters in practice - ANTLR4 might optimize away the redundancy anyway. [@arifogel]
projects/batfish/src/main/java/org/batfish/grammar/arista/AristaControlPlaneExtractor.java, line 4066 at r1 (raw file):
AristaBgpPeerFilterLine.Action.valueOf(ctx.action.getText().toUpperCase());
nit: Not in love with using String based conversion with enum.valueOf when we just have things like (ctx.ACCEPT() != null)...
projects/batfish/src/main/java/org/batfish/representation/arista/AristaConversions.java, line 328 at r1 (raw file):
LongSpace.EMPTY;
Confirming: no remoteAs and no peer filter means accept nothing?
projects/batfish/src/main/java/org/batfish/representation/arista/eos/AristaBgpPeerFilter.java, line 59 at r1 (raw file):
}); /* TODO: fix inclusion semantics
does building from the last line forward work? that is, building the current "stuff allowed after this line" set every time and using intersect/difference/union operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @progwriter)
projects/batfish/src/main/antlr4/org/batfish/grammar/arista/AristaParser.g4, line 2737 at r1 (raw file):
PEER_FILTER name = variable
can we pushMode(M_word)
whenever we see PEER_FILTER
? That pattern we adopted in NX-OS makes things like names that are 1.2.3.4
cause fewer problems in general :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 of 15 files reviewed, all discussions resolved (waiting on @dhalperi)
projects/batfish/src/main/antlr4/org/batfish/grammar/arista/AristaParser.g4, line 2737 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
PEER_FILTER name = variable
can we
pushMode(M_word)
whenever we seePEER_FILTER
? That pattern we adopted in NX-OS makes things like names that are1.2.3.4
cause fewer problems in general :).
done
projects/batfish/src/main/antlr4/org/batfish/grammar/arista/AristaParser.g4, line 2746 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
seq = DEC MATCH | MATCH
I would write this as (seq = DEC)? MATCH
but i'm not sure if this matters in practice - ANTLR4 might optimize away the redundancy anyway. [@arifogel]
done. wasn't sure if having first token be optional in a rule is a hit w/ adaptive prediction.
projects/batfish/src/main/java/org/batfish/grammar/arista/AristaControlPlaneExtractor.java, line 4066 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
AristaBgpPeerFilterLine.Action.valueOf(ctx.action.getText().toUpperCase());
nit: Not in love with using String based conversion with enum.valueOf when we just have things like (ctx.ACCEPT() != null)...
done
projects/batfish/src/main/java/org/batfish/representation/arista/AristaConversions.java, line 328 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
LongSpace.EMPTY;
Confirming: no remoteAs and no peer filter means accept nothing?
correct, i.e., it's not a valid peer
projects/batfish/src/main/java/org/batfish/representation/arista/eos/AristaBgpPeerFilter.java, line 59 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
does building from the last line forward work? that is, building the current "stuff allowed after this line" set every time and using intersect/difference/union operators.
done, good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Fist pass at implementing BGP peer-filters for dynamic neighbors.