-
Notifications
You must be signed in to change notification settings - Fork 228
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
Cisco IPSec tunnels #684
Cisco IPSec tunnels #684
Conversation
Quite a few changes here. They mostly look good. There are some style issues to address and some questions I'd like answered. Reviewed 21 of 21 files at r1. projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 247 at r1 (raw file):
Please inline the definition of projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 280 at r1 (raw file):
We don't need to do anything with this? Is it a lot of effort to support ikev2? projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 325 at r1 (raw file):
Please inline the definition of projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 333 at r1 (raw file):
Please inline the definition of projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 635 at r1 (raw file):
Please inline the definition of projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1145 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1153 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1161 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1198 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1216 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1226 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1236 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1247 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1263 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1271 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1279 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1287 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1295 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1303 at r1 (raw file):
For style consistency, change to exit rule. Enter rules are used only when context is needed by child nodes. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6302 at r1 (raw file):
Use 'throw convError(...)' projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6378 at r1 (raw file):
Use 'throw convError(...)' projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6452 at r1 (raw file):
Use 'throw convError(...)' projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6464 at r1 (raw file):
Use 'throw convError(...)' projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6474 at r1 (raw file):
Use 'throw convError(...)' projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3743 at r1 (raw file):
You need to mark usage here if the structure is not undefined. That is, unless you already marked it somewhere else. projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3765 at r1 (raw file):
You need to mark usage here if the structure is not undefined. That is, unless you already marked it somewhere else. projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3945 at r1 (raw file):
You need to mark usage here if the structure is not undefined. That is, unless you already marked it somewhere else. projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoStructureUsage.java, line 48 at r1 (raw file):
Should be more descriptive. What's important here is not just the type of the structure being referenced, but the nature of the reference itself, i.e. where in the configuration the reference occurs. The same goes for the below additions. tests/basic/init-example-aws.ref, line 18 at r1 (raw file):
What is the purpose of this unused list? Comments from Reviewable |
ad89a05
to
bf6bfaa
Compare
FYI r2 is just a rebase Reviewed 8 of 8 files at r2. Comments from Reviewable |
Done from my end. @dhalperi please take a look. Reviewed 40 of 40 files at r3. Comments from Reviewable |
- return external interface instead of tunnel interface for source ip matching - use identity instead of default hash/equality for IpsecVpn when finding remote ipsec vpn candidates - add cisco ipsec tests - disable ipsec vpns that have incompatibilities - refactor pre-shared-key compatibility check and fix related NPE
2e1d1e5
to
0c9aeef
Compare
Had to resolve conflict in CiscoGrammarTest so I made another revision. Reviewed 3 of 3 files at r4. Comments from Reviewable |
Reviewed 4 of 21 files at r1, 3 of 8 files at r2, 38 of 40 files at r3, 3 of 3 files at r4. projects/batfish-common-protocol/src/main/java/org/batfish/common/util/DefinedStructure.java, line 3 at r4 (raw file):
What's the relationship between Why is this refactoring of reference tracking in this PR at all? This is easily separable from the existing VPN work. projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/IpsecVpn.java, line 101 at r4 (raw file):
can just use I guess that the PSK itself could be null, in which case just drop the projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 247 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 325 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 333 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 635 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_interface.g4, line 1017 at r4 (raw file):
do you not normally do some projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1145 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1153 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1161 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1198 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1216 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1226 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1236 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1247 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1263 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1271 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1279 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1287 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1295 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1303 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? I'm going to stop commenting ont hese, they're all unresolved comments authored by you anyway. projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6302 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/main/Batfish.java, line 2117 at r4 (raw file):
I think there's a shorter-hand for this. Sets::newIdentityHashSet ? projects/batfish/src/main/java/org/batfish/main/Batfish.java, line 2117 at r4 (raw file):
Also wondering about the motivation for the type change? projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3743 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3765 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
still needed? projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 685 at r4 (raw file):
projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 1099 at r4 (raw file):
seems like you could simplify this code a fair bit by converting
projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 1101 at r4 (raw file):
this code down here does not handle projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 4050 at r4 (raw file):
inline all these? in fact, it might be much cleaner to "mark/warn ; mark/warn; mark/warn;" instead of "mark all;warn all;" like the function is right now. Comments from Reviewable |
high level: this PR does not move the needle in the right direction w.r.t. java unit tests or documentation. Review status: all files reviewed at latest revision, 38 unresolved discussions. Comments from Reviewable |
Review status: 18 of 48 files reviewed at latest revision, 35 unresolved discussions. projects/batfish-common-protocol/src/main/java/org/batfish/common/util/DefinedStructure.java, line 3 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
Hmm initially I thought there was a reason to separate out this interface. But if all inherit both, I will just make it an abstract class as you said. Refactoring of reference tracking could arguably be separated. The purpose of this PR is to add Cisco structures and logic for VPNs. Part of that is reference tracking for the new structures. In order to do that cleanly, I preferred to do the refactoring now rather than implement it verbosely and defer a clean implementation to a refactoring PR. projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/IpsecVpn.java, line 101 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
Right good call. projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_interface.g4, line 1017 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
Just a style thing in this case. More generally, it protects against future changing of generated But yeah, I'll just change it to match. projects/batfish/src/main/java/org/batfish/main/Batfish.java, line 2117 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
No, because it does not use the projects/batfish/src/main/java/org/batfish/main/Batfish.java, line 2117 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3743 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
No. This location turned out to be unsuitable. Instead I added unconditional marking in projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3765 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
No. This location turned out to be unsuitable. Instead I added unconditional marking in projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 3945 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
This location turned out to be unsuitable. Instead I added unconditional marking in projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 4050 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
I inlined the warns with a single map. The marks look like crap when inlined, so I skipped for now. I don't feel comfortable re-ordering right now because not all marking happens in this function -- the result would be confusing. projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoStructureUsage.java, line 48 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
I did this. Comments from Reviewable |
Fixed a bunch of unaddressed stuff. I believe it is ready. Please re-review. Review status: 18 of 48 files reviewed at latest revision, 20 unresolved discussions, some commit checks failed. projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 247 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 325 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 333 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/antlr4/org/batfish/grammar/cisco/Cisco_crypto.g4, line 635 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1145 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1153 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1161 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1198 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1216 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1226 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1236 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1247 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1263 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1271 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1279 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1287 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1295 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 1303 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6302 at r1 (raw file): Previously, dhalperi (Dan Halperin) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6378 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6452 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6464 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
done projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 6474 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
done projects/batfish/src/main/java/org/batfish/representation/cisco/CiscoConfiguration.java, line 1099 at r4 (raw file): Previously, dhalperi (Dan Halperin) wrote…
|
You need to resolve the comments that you fixed before it can be merged. Reviewed 30 of 30 files at r5. Comments from Reviewable |
Reviewed 2 of 2 files at r6. Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. tests/basic/init-example-aws.ref, line 18 at r1 (raw file): Previously, arifogel (Ari Fogel) wrote…
Ignoring for now. Comments from Reviewable |
First step of #667
From the config file below:
We extract into
CiscoConfiguration
the following concepts:Keyring
,IsakmpPolicy
,IsakmpProfile
,IpsecTransformSet
,IpsecProfile
, andTunnel
information for interfaces.We then map these concepts to those in
Configuration
:-
IkeProposals
are derived fromIsakmpPolicy
IkePolicy
is derived fromIsakmpProfile
andKeyring
IkeGateway
is derived fromIsakmpProfile
andTunnel
using address-based matchingIpsecProposal
is derived fromIpsecTransformSet
IpsecPolicy
is derived fromIpsecProfile
IpsecVpn
is derived fromTunnel
using address-based matchingThis change is