use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_packet_length.
@Override
public void exitFftf_packet_length(Fftf_packet_lengthContext ctx) {
List<SubRange> range = toRange(ctx.range());
FwFrom from = new FwFromPacketLength(range, false);
_currentFwTerm.getFroms().add(from);
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_source_port.
@Override
public void exitFftf_source_port(Fftf_source_portContext ctx) {
if (ctx.port() != null) {
int port = getPortNumber(ctx.port());
SubRange subrange = new SubRange(port, port);
FwFrom from = new FwFromSourcePort(subrange);
_currentFwTerm.getFroms().add(from);
} else if (ctx.range() != null) {
for (SubrangeContext subrangeContext : ctx.range().range_list) {
SubRange subrange = toSubRange(subrangeContext);
FwFrom from = new FwFromSourcePort(subrange);
_currentFwTerm.getFroms().add(from);
}
}
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_first_fragment.
@Override
public void exitFftf_first_fragment(Fftf_first_fragmentContext ctx) {
SubRange subRange = new SubRange(0, 0);
FwFrom from = new FwFromFragmentOffset(subRange, false);
_currentFwTerm.getFroms().add(from);
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_icmp_code.
@Override
public void exitFftf_icmp_code(Fftf_icmp_codeContext ctx) {
if (_currentFirewallFamily == Family.INET6) {
// TODO: support icmpv6
return;
}
SubRange icmpCodeRange;
if (ctx.subrange() != null) {
icmpCodeRange = toSubRange(ctx.subrange());
} else if (ctx.icmp_code() != null) {
int icmpCode = toIcmpCode(ctx.icmp_code());
icmpCodeRange = new SubRange(icmpCode, icmpCode);
} else {
throw new BatfishException("Invalid icmp-code");
}
FwFrom from = new FwFromIcmpCode(icmpCodeRange);
_currentFwTerm.getFroms().add(from);
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_destination_prefix_list.
@Override
public void exitFftf_destination_prefix_list(Fftf_destination_prefix_listContext ctx) {
String name = ctx.name.getText();
// temporary
if (_currentFilter.getFamily() != Family.INET) {
_configuration.getIgnoredPrefixLists().add(name);
}
FwFrom from;
if (ctx.EXCEPT() != null) {
from = new FwFromDestinationPrefixListExcept(name);
} else {
from = new FwFromDestinationPrefixList(name);
}
_currentFwTerm.getFroms().add(from);
}
Aggregations