use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_source_address.
@Override
public void exitFftf_source_address(Fftf_source_addressContext ctx) {
if (ctx.IP_ADDRESS() != null || ctx.IP_PREFIX() != null) {
Prefix prefix;
if (ctx.IP_PREFIX() != null) {
prefix = Prefix.parse(ctx.IP_PREFIX().getText());
} else {
prefix = new Prefix(new Ip(ctx.IP_ADDRESS().getText()), Prefix.MAX_PREFIX_LENGTH);
}
FwFrom from;
if (ctx.EXCEPT() != null) {
from = new FwFromSourceAddressExcept(prefix);
} else {
from = new FwFromSourceAddress(prefix);
}
_currentFwTerm.getFroms().add(from);
}
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_fragment_offset_except.
@Override
public void exitFftf_fragment_offset_except(Fftf_fragment_offset_exceptContext ctx) {
SubRange subRange = toSubRange(ctx.subrange());
FwFrom from = new FwFromFragmentOffset(subRange, true);
_currentFwTerm.getFroms().add(from);
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_tcp_flags.
@Override
public void exitFftf_tcp_flags(Fftf_tcp_flagsContext ctx) {
List<TcpFlags> tcpFlags = toTcpFlags(ctx.tcp_flags());
FwFrom from = new FwFromTcpFlags(tcpFlags);
_currentFwTerm.getFroms().add(from);
}
use of org.batfish.representation.juniper.FwFrom in project batfish by batfish.
the class ConfigurationBuilder method exitFftf_source_prefix_list.
@Override
public void exitFftf_source_prefix_list(Fftf_source_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 FwFromSourcePrefixListExcept(name);
} else {
from = new FwFromSourcePrefixList(name);
}
_currentFwTerm.getFroms().add(from);
}
Aggregations