use of org.batfish.datamodel.vendor_family.cisco.Logging in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterLogging_address.
@Override
public void enterLogging_address(Logging_addressContext ctx) {
if (_no) {
return;
}
Logging logging = _configuration.getCf().getLogging();
String hostname = ctx.hostname.getText();
LoggingHost host = new LoggingHost(hostname);
logging.getHosts().put(hostname, host);
}
use of org.batfish.datamodel.vendor_family.cisco.Logging in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitLogging_trap.
@Override
public void exitLogging_trap(Logging_trapContext ctx) {
if (_no) {
return;
}
Integer severityNum = null;
String severity = null;
if (ctx.logging_severity() != null) {
severityNum = toLoggingSeverityNum(ctx.logging_severity());
severity = toLoggingSeverity(ctx.logging_severity());
}
Logging logging = _configuration.getCf().getLogging();
LoggingType trap = logging.getTrap();
if (trap == null) {
trap = new LoggingType();
logging.setTrap(trap);
}
trap.setSeverity(severity);
trap.setSeverityNum(severityNum);
}
use of org.batfish.datamodel.vendor_family.cisco.Logging in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitLogging_buffered.
@Override
public void exitLogging_buffered(Logging_bufferedContext ctx) {
if (_no) {
return;
}
Integer size = null;
Integer severityNum = null;
String severity = null;
if (ctx.size != null) {
// something was parsed as buffer size but it could be logging severity
// as well
// it is buffer size if the value is greater than min buffer size
// otherwise, it is logging severity
int sizeRawNum = toInteger(ctx.size);
if (sizeRawNum > Logging.MAX_LOGGING_SEVERITY) {
size = sizeRawNum;
} else {
if (ctx.logging_severity() != null) {
// if we have explicity severity as well; we've messed up
throw new BatfishException("Ambiguous parsing of logging buffered");
}
severityNum = sizeRawNum;
severity = toLoggingSeverity(severityNum);
}
} else if (ctx.logging_severity() != null) {
severityNum = toLoggingSeverityNum(ctx.logging_severity());
severity = toLoggingSeverity(ctx.logging_severity());
}
Logging logging = _configuration.getCf().getLogging();
Buffered buffered = logging.getBuffered();
if (buffered == null) {
buffered = new Buffered();
logging.setBuffered(buffered);
}
buffered.setSeverity(severity);
buffered.setSeverityNum(severityNum);
buffered.setSize(size);
}
use of org.batfish.datamodel.vendor_family.cisco.Logging in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitLogging_server.
@Override
public void exitLogging_server(Logging_serverContext ctx) {
if (_no) {
return;
}
Logging logging = _configuration.getCf().getLogging();
String hostname = ctx.hostname.getText();
LoggingHost host = new LoggingHost(hostname);
logging.getHosts().put(hostname, host);
}
use of org.batfish.datamodel.vendor_family.cisco.Logging in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterCisco_configuration.
@Override
public void enterCisco_configuration(Cisco_configurationContext ctx) {
_configuration = new CiscoConfiguration(_unimplementedFeatures);
_configuration.setVendor(_format);
_currentVrf = Configuration.DEFAULT_VRF_NAME;
if (_format == ConfigurationFormat.CISCO_IOS) {
Logging logging = new Logging();
logging.setOn(true);
_configuration.getCf().setLogging(logging);
}
}
Aggregations