-
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.
FortiOS: service conversion update (#6721)
- Loading branch information
Showing
4 changed files
with
64 additions
and
38 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
27 changes: 27 additions & 0 deletions
27
...batfish/src/main/java/org/batfish/representation/fortios/FortiosTraceElementCreators.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,27 @@ | ||
package org.batfish.representation.fortios; | ||
|
||
import org.batfish.datamodel.TraceElement; | ||
import org.batfish.vendor.VendorStructureId; | ||
|
||
/** Collection of methods to create {@link TraceElement trace elements} for FortiOS ACL lines. */ | ||
public final class FortiosTraceElementCreators { | ||
|
||
private FortiosTraceElementCreators() {} | ||
|
||
/** Creates {@link TraceElement} for specified {@link Service}. */ | ||
static TraceElement matchServiceTraceElement(Service service, String filename) { | ||
TraceElement.Builder te = | ||
TraceElement.builder() | ||
.add("Matched service ") | ||
.add( | ||
service.getName(), | ||
new VendorStructureId( | ||
filename, | ||
FortiosStructureType.SERVICE_CUSTOM.getDescription(), | ||
service.getName())); | ||
if (service.getComment() != null) { | ||
te.add(String.format("(%s)", service.getComment())); | ||
} | ||
return te.build(); | ||
} | ||
} |
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