-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cisco/IOS: implement set tag (#6468)
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
projects/batfish/src/main/java/org/batfish/representation/cisco/RouteMapSetTagLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.batfish.representation.cisco; | ||
|
||
import java.util.List; | ||
import org.batfish.common.Warnings; | ||
import org.batfish.datamodel.Configuration; | ||
import org.batfish.datamodel.routing_policy.expr.LiteralLong; | ||
import org.batfish.datamodel.routing_policy.statement.SetTag; | ||
import org.batfish.datamodel.routing_policy.statement.Statement; | ||
|
||
/** Represents a {@code `set tag n`} line in a route-map. */ | ||
public class RouteMapSetTagLine extends RouteMapSetLine { | ||
|
||
private final long _tag; | ||
|
||
public RouteMapSetTagLine(long tag) { | ||
_tag = tag; | ||
} | ||
|
||
@Override | ||
public void applyTo( | ||
List<Statement> statements, CiscoConfiguration cc, Configuration c, Warnings w) { | ||
statements.add(new SetTag(new LiteralLong(_tag))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ts/batfish/src/test/resources/org/batfish/grammar/cisco/testconfigs/ios-route-map-set-tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
! | ||
hostname ios-route-map-set-tag | ||
! | ||
route-map SET_TAG permit 10 | ||
set tag 20 | ||
! |