Github user abhinandanprateek commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1371#discussion_r62837384
  
    --- Diff: server/src/com/cloud/network/router/CommandSetupHelper.java ---
    @@ -1048,4 +1052,33 @@ protected String getGuestDhcpRange(final NicProfile 
guestNic, final Network gues
             }
             return dhcpRange;
         }
    +
    +    // this command goes as part of the VPC start command
    +    public void createQuaggaConfigCommand(final VirtualRouter router, 
final Long vpcId, final Commands cmds) throws BadCIDRException {
    +        final Vpc vpc = _vpcDao.findById(vpcId);
    +        final DataCenterVO dc = _dcDao.findById(vpc.getZoneId());
    +        _dcDao.loadDetails(dc);
    +        final OSPFZoneConfig qzc = new OSPFZoneConfig();
    +        qzc.setValues(dc.getDetails());
    +        // vpc is dynamic if control comes here
    +        ArrayList<CIDR> tier_cidr = new ArrayList<CIDR>();
    +        // get all dynamic tiers cidr for this vpc
    +        final List<NetworkVO> vpc_tiers = _networkDao.listByVpc(vpcId);
    +        for (NetworkVO tier : vpc_tiers) {
    +            // network tier supports dynamic routing
    +            if 
(_networkModel.areServicesSupportedByNetworkOffering(tier.getNetworkOfferingId(),
 Service.VPCDynamicRouting)) {
    +                tier_cidr.add(CIDRFactory.getCIDR(tier.getCidr()));
    +            }
    +        }
    +        final String publicIp = router.getPublicIpAddress();
    +        //String routerIp, String routerName, String vpnCidr, String[] 
tierCidrs
    +        final QuaggaConfigCommand cmd = new QuaggaConfigCommand(publicIp, 
router.getInstanceName(), vpc.getCidr(), tier_cidr.toArray(new 
CIDR[tier_cidr.size()]), qzc);
    +        cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, 
_routerControlHelper.getRouterControlIp(router.getId()));
    +        cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, 
router.getInstanceName());
    +        final DataCenterVO dcVo = 
_dcDao.findById(router.getDataCenterId());
    +        cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, 
dcVo.getNetworkType().toString());
    +
    +        cmds.addCommand(cmd);
    --- End diff --
    
    Caller is depending on the fact that the method adds commands to the ref he 
has passed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to