use of org.batfish.representation.cisco.BgpNetwork in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitNetwork_bgp_tail.
@Override
public void exitNetwork_bgp_tail(Network_bgp_tailContext ctx) {
Prefix prefix;
if (ctx.prefix != null) {
prefix = Prefix.parse(ctx.prefix.getText());
} else {
Ip address = toIp(ctx.ip);
Ip mask = (ctx.mask != null) ? toIp(ctx.mask) : address.getClassMask();
int prefixLength = mask.numSubnetBits();
prefix = new Prefix(address, prefixLength);
}
String map = null;
Integer mapLine = null;
if (ctx.mapname != null) {
map = ctx.mapname.getText();
mapLine = ctx.mapname.getStart().getLine();
}
BgpNetwork bgpNetwork = new BgpNetwork(prefix, map, mapLine);
BgpProcess proc = currentVrf().getBgpProcess();
proc.getIpNetworks().put(prefix, bgpNetwork);
}
Aggregations