use of org.batfish.datamodel.SnmpHost in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterSs_host.
@Override
public void enterSs_host(Ss_hostContext ctx) {
String hostname;
if (ctx.ip4 != null) {
hostname = ctx.ip4.getText();
} else if (ctx.ip6 != null) {
hostname = ctx.ip6.getText();
} else if (ctx.host != null) {
hostname = ctx.host.getText();
} else {
throw new BatfishException("Invalid host");
}
Map<String, SnmpHost> hosts = _configuration.getSnmpServer().getHosts();
SnmpHost host = hosts.computeIfAbsent(hostname, SnmpHost::new);
_currentSnmpHost = host;
}
use of org.batfish.datamodel.SnmpHost in project batfish by batfish.
the class ConfigurationBuilder method exitSnmptg_targets.
@Override
public void exitSnmptg_targets(Snmptg_targetsContext ctx) {
Ip ip = new Ip(ctx.target.getText());
String name = ip.toString();
_currentSnmpServer.getHosts().computeIfAbsent(name, k -> new SnmpHost(ip.toString()));
}
Aggregations