-
Notifications
You must be signed in to change notification settings - Fork 229
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
Custom isp names #5280
Custom isp names #5280
Conversation
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: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @haverma and @ratulm)
a discussion (no related file):
How does this work when two different border interfaces point at the same AS?
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: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @dhalperi and @haverma)
a discussion (no related file):
Previously, dhalperi (Dan Halperin) wrote…
How does this work when two different border interfaces point at the same AS?
The behavior on that front has not changed. The ISP name information is indexed on ASN and is not border interface specific. If two border interfaces point to the same AS, one node will be generated for them, and users can now control the name of that node.
But perhaps I misunderstood your concern?
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: 0 of 13 files reviewed, all discussions resolved (waiting on @haverma)
a discussion (no related file):
Previously, ratulm wrote…
The behavior on that front has not changed. The ISP name information is indexed on ASN and is not border interface specific. If two border interfaces point to the same AS, one node will be generated for them, and users can now control the name of that node.
But perhaps I misunderstood your concern?
No, I'm just dumb.
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.
refs need to be updated
Reviewed 13 of 13 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ratulm)
projects/batfish-common-protocol/src/main/java/org/batfish/common/util/IspModelingUtils.java, line 216 at r1 (raw file):
info.getAsn() > asn
why not info.getAsn() != asn
? >
seems incorrect.
nit: also to make it a bit simpler and avoid generating this warning twice for every conflicting pair AB (once for AB and once for BA), we can have something like this:
Map<String, Set<Long>> namesToAsns =
asnToIspInfos.values().stream()
.collect(
Collectors.groupingBy(
IspInfo::getName, Collectors.mapping(IspInfo::getAsn, Collectors.toSet())));
namesToAsns.forEach(
(key, value) -> {
if (value.size() > 1) {
conflicts.add(String.format("ISPs %s have the same name: %s", value, key));
}
});
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: complete! all files reviewed, all discussions resolved
projects/batfish-common-protocol/src/main/java/org/batfish/common/util/IspModelingUtils.java, line 216 at r1 (raw file):
Previously, haverma (Harsh Verma) wrote…
info.getAsn() > asn
why not
info.getAsn() != asn
?>
seems incorrect.nit: also to make it a bit simpler and avoid generating this warning twice for every conflicting pair AB (once for AB and once for BA), we can have something like this:
Map<String, Set<Long>> namesToAsns = asnToIspInfos.values().stream() .collect( Collectors.groupingBy( IspInfo::getName, Collectors.mapping(IspInfo::getAsn, Collectors.toSet()))); namesToAsns.forEach( (key, value) -> { if (value.size() > 1) { conflicts.add(String.format("ISPs %s have the same name: %s", value, key)); } });
ok, now I get it, >
is used to avoid listing errors twice for a pair.
Codecov Report
@@ Coverage Diff @@
## master #5280 +/- ##
=========================================
Coverage ? 73.39%
Complexity ? 31944
=========================================
Files ? 2624
Lines ? 128846
Branches ? 15486
=========================================
Hits ? 94561
Misses ? 26804
Partials ? 7481
|
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 5 of 5 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Allows users to define custom ISP names.
Example: