-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
juniper parse and partially convert condition (#6658)
- parse, convert policy-statement from condition - parse, partially convert policy-options condition if-route-exists - TODO: VI design and implementation for checking route existence in RP - just return false for if-route-exists for now
- Loading branch information
Showing
14 changed files
with
311 additions
and
5 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
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 |
---|---|---|
|
@@ -188,6 +188,8 @@ ip_option | |
| TIMESTAMP | ||
; | ||
|
||
ip_prefix: IP_PREFIX; | ||
|
||
ip_protocol | ||
: | ||
AH | ||
|
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
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
32 changes: 32 additions & 0 deletions
32
projects/batfish/src/main/java/org/batfish/representation/juniper/Condition.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,32 @@ | ||
package org.batfish.representation.juniper; | ||
|
||
import java.io.Serializable; | ||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
import javax.annotation.ParametersAreNonnullByDefault; | ||
|
||
@ParametersAreNonnullByDefault | ||
public final class Condition implements Serializable { | ||
|
||
public Condition(String name) { | ||
_name = name; | ||
} | ||
|
||
public @Nonnull IfRouteExists getOrCreateIfRouteExists() { | ||
if (_ifRouteExists == null) { | ||
_ifRouteExists = new IfRouteExists(); | ||
} | ||
return _ifRouteExists; | ||
} | ||
|
||
public @Nullable IfRouteExists getIfRouteExists() { | ||
return _ifRouteExists; | ||
} | ||
|
||
public @Nonnull String getName() { | ||
return _name; | ||
} | ||
|
||
private final @Nonnull String _name; | ||
private @Nullable IfRouteExists _ifRouteExists; | ||
} |
32 changes: 32 additions & 0 deletions
32
projects/batfish/src/main/java/org/batfish/representation/juniper/IfRouteExists.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,32 @@ | ||
package org.batfish.representation.juniper; | ||
|
||
import java.io.Serializable; | ||
import javax.annotation.Nullable; | ||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import org.batfish.datamodel.Prefix; | ||
|
||
/** Subcondition checking existence of a route in a table */ | ||
@ParametersAreNonnullByDefault | ||
public final class IfRouteExists implements Serializable { | ||
|
||
@Nullable | ||
public Prefix getPrefix() { | ||
return _prefix; | ||
} | ||
|
||
public void setPrefix(@Nullable Prefix prefix) { | ||
_prefix = prefix; | ||
} | ||
|
||
@Nullable | ||
public String getTable() { | ||
return _table; | ||
} | ||
|
||
public void setTable(@Nullable String table) { | ||
_table = table; | ||
} | ||
|
||
private @Nullable Prefix _prefix; | ||
private @Nullable String _table; | ||
} |
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
Oops, something went wrong.