Search in sources :

Example 1 with DynamicIpBgpPeerGroup

use of org.batfish.representation.cisco.DynamicIpBgpPeerGroup in project batfish by batfish.

the class CiscoControlPlaneExtractor method exitBgp_listen_range_rb_stanza.

@Override
public void exitBgp_listen_range_rb_stanza(Bgp_listen_range_rb_stanzaContext ctx) {
    String name = ctx.name.getText();
    int line = ctx.name.getStart().getLine();
    BgpProcess proc = currentVrf().getBgpProcess();
    if (ctx.IP_PREFIX() != null) {
        Prefix prefix = Prefix.parse(ctx.IP_PREFIX().getText());
        DynamicIpBgpPeerGroup pg = proc.addDynamicIpPeerGroup(prefix);
        pg.setGroupName(name);
        pg.setGroupNameLine(line);
        if (ctx.as != null) {
            int remoteAs = toInteger(ctx.as);
            pg.setRemoteAs(remoteAs);
        }
    } else if (ctx.IPV6_PREFIX() != null) {
        Prefix6 prefix6 = new Prefix6(ctx.IPV6_PREFIX().getText());
        DynamicIpv6BgpPeerGroup pg = proc.addDynamicIpv6PeerGroup(prefix6);
        pg.setGroupName(name);
        pg.setGroupNameLine(line);
        if (ctx.as != null) {
            int remoteAs = toInteger(ctx.as);
            pg.setRemoteAs(remoteAs);
        }
    }
}
Also used : DynamicIpv6BgpPeerGroup(org.batfish.representation.cisco.DynamicIpv6BgpPeerGroup) BgpProcess(org.batfish.representation.cisco.BgpProcess) Prefix(org.batfish.datamodel.Prefix) DynamicIpBgpPeerGroup(org.batfish.representation.cisco.DynamicIpBgpPeerGroup) Prefix6(org.batfish.datamodel.Prefix6)

Aggregations

Prefix (org.batfish.datamodel.Prefix)1 Prefix6 (org.batfish.datamodel.Prefix6)1 BgpProcess (org.batfish.representation.cisco.BgpProcess)1 DynamicIpBgpPeerGroup (org.batfish.representation.cisco.DynamicIpBgpPeerGroup)1 DynamicIpv6BgpPeerGroup (org.batfish.representation.cisco.DynamicIpv6BgpPeerGroup)1