Skip to content
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

Allow interface names in more distribute-list places #6345

Merged
merged 4 commits into from Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -361,7 +361,6 @@ rec_null
| BFD
| DEFAULT_INFORMATION
| DISTANCE
| DISTRIBUTE_LIST
| HELLO_INTERVAL
| MAXIMUM_PATHS
| (METRIC MAXIMUM_HOPS)
Expand Down Expand Up @@ -394,7 +393,7 @@ redl_gateway
IN
| OUT
)
NEWLINE
(iname = interface_name_unstructured)? NEWLINE
;

redl_prefix
Expand All @@ -405,7 +404,7 @@ redl_prefix
IN
| OUT
)
NEWLINE
(iname = interface_name_unstructured)? NEWLINE
;

redl_route_map
Expand All @@ -415,7 +414,7 @@ redl_route_map
IN
| OUT
)
NEWLINE
(iname = interface_name_unstructured)? NEWLINE
;

ren_address_family
Expand Down
Expand Up @@ -7749,6 +7749,15 @@ public void exitRedl_prefix(Redl_prefixContext ctx) {
ctx.IN() == null ? EIGRP_DISTRIBUTE_LIST_GATEWAY_OUT : EIGRP_DISTRIBUTE_LIST_GATEWAY_IN,
ctx.gwname.getStart().getLine());
}
if (ctx.iname != null) {
_configuration.referenceStructure(
INTERFACE,
getCanonicalInterfaceName(ctx.iname.getText()),
ctx.IN() == null
? EIGRP_DISTRIBUTE_LIST_PREFIX_LIST_OUT
: EIGRP_DISTRIBUTE_LIST_PREFIX_LIST_IN,
ctx.iname.getStart().getLine());
}
}

@Override
Expand All @@ -7763,6 +7772,13 @@ public void exitRedl_gateway(Redl_gatewayContext ctx) {
ctx.name.getText(),
ctx.IN() == null ? EIGRP_DISTRIBUTE_LIST_GATEWAY_OUT : EIGRP_DISTRIBUTE_LIST_GATEWAY_IN,
ctx.name.getStart().getLine());
if (ctx.iname != null) {
_configuration.referenceStructure(
INTERFACE,
getCanonicalInterfaceName(ctx.iname.getText()),
ctx.IN() == null ? EIGRP_DISTRIBUTE_LIST_GATEWAY_OUT : EIGRP_DISTRIBUTE_LIST_GATEWAY_IN,
ctx.iname.getStart().getLine());
}
}

@Override
Expand All @@ -7777,6 +7793,15 @@ public void exitRedl_route_map(Redl_route_mapContext ctx) {
ctx.name.getText(),
ctx.IN() == null ? EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_OUT : EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_IN,
ctx.name.getStart().getLine());
if (ctx.iname != null) {
_configuration.referenceStructure(
INTERFACE,
getCanonicalInterfaceName(ctx.iname.getText()),
ctx.IN() == null
? EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_OUT
: EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_IN,
ctx.iname.getStart().getLine());
}
}

@Override
Expand Down
Expand Up @@ -3411,6 +3411,12 @@ public List<Configuration> toVendorIndependentConfigurations() {
CiscoStructureUsage.EIGRP_AF_INTERFACE,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_ACCESS_LIST_IN,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_ACCESS_LIST_OUT,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_GATEWAY_IN,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_GATEWAY_OUT,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_PREFIX_LIST_IN,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_PREFIX_LIST_OUT,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_IN,
CiscoStructureUsage.EIGRP_DISTRIBUTE_LIST_ROUTE_MAP_OUT,
CiscoStructureUsage.EIGRP_PASSIVE_INTERFACE,
CiscoStructureUsage.FAILOVER_LAN_INTERFACE,
CiscoStructureUsage.FAILOVER_LINK_INTERFACE,
Expand Down
Expand Up @@ -2797,15 +2797,15 @@ public void testIosEigrpDistributeListRefsAndWarnings() throws IOException {
batfish.loadConvertConfigurationAnswerElementOrReparse(batfish.getSnapshot());
assertThat(ccae, hasNumReferrers(filename, IPV4_ACCESS_LIST_STANDARD, "1", 2));
assertThat(ccae, hasNumReferrers(filename, IPV4_ACCESS_LIST_STANDARD, "2", 2));
assertThat(ccae, hasNumReferrers(filename, INTERFACE, "GigabitEthernet0/0", 3));
assertThat(ccae, hasNumReferrers(filename, INTERFACE, "GigabitEthernet0/0", 9));

assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_IN", 2));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_OUT", 2));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_GW_IN", 2));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_GW_OUT", 2));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_IN", 3));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_OUT", 3));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_GW_IN", 3));
assertThat(ccae, hasNumReferrers(filename, PREFIX_LIST, "PL_GW_OUT", 3));

assertThat(ccae, hasNumReferrers(filename, ROUTE_MAP, "RM_IN", 1));
assertThat(ccae, hasNumReferrers(filename, ROUTE_MAP, "RM_OUT", 1));
assertThat(ccae, hasNumReferrers(filename, ROUTE_MAP, "RM_IN", 2));
assertThat(ccae, hasNumReferrers(filename, ROUTE_MAP, "RM_OUT", 2));

ParseVendorConfigurationAnswerElement pvcae =
batfish.loadParseVendorConfigurationAnswerElement(batfish.getSnapshot());
Expand Down
Expand Up @@ -27,11 +27,17 @@ ip prefix-list PL_GW_OUT permit 0.0.0.0/0 le 32
router eigrp 2
distribute-list prefix PL_IN in
distribute-list prefix PL_IN gateway PL_GW_IN in
distribute-list prefix PL_IN in GigabitEthernet0/0

distribute-list gateway PL_GW_IN in
distribute-list gateway PL_GW_IN in GigabitEthernet0/0

distribute-list prefix PL_OUT out
distribute-list prefix PL_OUT gateway PL_GW_OUT out
distribute-list prefix PL_OUT out GigabitEthernet0/0

distribute-list gateway PL_GW_OUT out
distribute-list gateway PL_GW_OUT out GigabitEthernet0/0
!
!
route-map RM_IN permit 10
Expand All @@ -40,6 +46,8 @@ route-map RM_OUT permit 10
!
router eigrp 3
distribute-list route-map RM_IN in
distribute-list route-map RM_IN in GigabitEthernet0/0

distribute-list route-map RM_OUT out
distribute-list route-map RM_OUT out GigabitEthernet0/0
!