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

Pan: application-override rule conversion #6651

Merged
merged 36 commits into from Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9059f66
add tests
sfraint Feb 11, 2021
25004e6
convert SR per zone pair
sfraint Feb 11, 2021
40cf42c
Merge branch 'master' into pan-sr-zone-pair
sfraint Feb 12, 2021
2be4bb2
initial app-override parsing
sfraint Feb 12, 2021
fc2cb8a
add application-override VS class
sfraint Feb 12, 2021
eb02c98
Merge branch 'master' into pan-app-override
sfraint Feb 12, 2021
6ba8256
Merge branch 'pan-app-override-vs' into pan-app-override
sfraint Feb 12, 2021
c149678
add app-override rules to rulebase
sfraint Feb 12, 2021
73f735b
Merge branch 'pan-app-override-vs' into pan-app-override
sfraint Feb 12, 2021
b8f3281
parsing and extraction
sfraint Feb 13, 2021
f3f2f77
Merge branch 'master' into pan-app-override
sfraint Feb 13, 2021
58d44bc
trailing newline
sfraint Feb 13, 2021
9c424bf
Merge branch 'master' into pan-sr-conversion
sfraint Feb 13, 2021
e38ef75
Merge branch 'pan-sr-conversion' into pan-sr-zone-pair
sfraint Feb 13, 2021
5602a19
rename test config
sfraint Feb 16, 2021
1f0b288
propagate zones, test skeleton
sfraint Feb 16, 2021
507c6c8
merge pan-app-override
sfraint Feb 16, 2021
b784ead
save work
sfraint Feb 16, 2021
cf6550c
merge master
sfraint Feb 16, 2021
84667fc
save work
sfraint Feb 19, 2021
f6d58ad
cleanup, add validation
sfraint Feb 19, 2021
05a238d
merge master
sfraint Feb 19, 2021
0e4024f
comment
sfraint Feb 19, 2021
4ecf021
cleanup, comments
sfraint Feb 19, 2021
47ef105
comments
sfraint Feb 19, 2021
468570e
better test
sfraint Feb 19, 2021
f114da9
fix test
sfraint Feb 19, 2021
ae405bf
fix merge issue
sfraint Feb 19, 2021
68d3ad8
merge pan-sr-zone-pair
sfraint Feb 19, 2021
5ce8d9b
rely on validation
sfraint Feb 19, 2021
14d0dad
fix tests
sfraint Feb 20, 2021
b147b02
merge master
sfraint Feb 20, 2021
e6d609d
pmd
sfraint Feb 20, 2021
26a581a
comments and cleanup
sfraint Feb 20, 2021
4877ced
review comments
sfraint Feb 22, 2021
5a539d9
backout unneeded test config change
sfraint Feb 23, 2021
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 @@ -11,6 +11,7 @@
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNullableByDefault;
import org.batfish.datamodel.IntegerSpace;
import org.batfish.datamodel.IpProtocol;
import org.batfish.datamodel.SubRange;

/** PAN datamodel component containing application-override rule configuration */
Expand All @@ -20,7 +21,8 @@ public final class ApplicationOverrideRule implements Serializable {
// Possible protocols for traffic to match an application-override rule
public enum Protocol {
TCP,
UDP
UDP,
UNSPECIFIED
}

// Name of the rule
Expand All @@ -45,7 +47,7 @@ public enum Protocol {
private boolean _negateDestination;

// Traffic characteristics to match
@Nullable private Protocol _protocol;
@Nonnull private Protocol _protocol;
@Nonnull private IntegerSpace _port;

@Nonnull private final Set<String> _tags;
Expand All @@ -61,6 +63,7 @@ public ApplicationOverrideRule(@Nonnull String name) {
_tags = new HashSet<>(1);
_name = name;
_port = IntegerSpace.EMPTY;
_protocol = Protocol.UNSPECIFIED;
}

@Nonnull
Expand Down Expand Up @@ -110,12 +113,25 @@ public boolean getNegateDestination() {
return _negateDestination;
}

@Nullable
@Nonnull
public Protocol getProtocol() {
return _protocol;
}

@Nullable
public IpProtocol getIpProtocol() {
switch (_protocol) {
case TCP:
return IpProtocol.TCP;
case UDP:
return IpProtocol.UDP;
case UNSPECIFIED:
default:
return null;
}
}

@Nonnull
public IntegerSpace getPort() {
return _port;
}
Expand Down Expand Up @@ -145,7 +161,7 @@ public void setNegateDestination(boolean negateDestination) {
_negateDestination = negateDestination;
}

public void setProtocol(Protocol protocol) {
public void setProtocol(@Nonnull Protocol protocol) {
_protocol = protocol;
}

Expand Down