Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0A3B6200AE4 for ; Wed, 11 May 2016 04:02:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 08CC2160A11; Wed, 11 May 2016 02:02:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52C3F16098A for ; Wed, 11 May 2016 04:02:28 +0200 (CEST) Received: (qmail 32452 invoked by uid 500); 11 May 2016 02:02:27 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 32441 invoked by uid 99); 11 May 2016 02:02:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 02:02:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1708DDFDCF; Wed, 11 May 2016 02:02:27 +0000 (UTC) From: jburwell To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: OSPF: adding dynamically routing capabili... Content-Type: text/plain Message-Id: <20160511020227.1708DDFDCF@git1-us-west.apache.org> Date: Wed, 11 May 2016 02:02:27 +0000 (UTC) archived-at: Wed, 11 May 2016 02:02:29 -0000 Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1371#discussion_r62782681 --- Diff: server/src/com/cloud/network/vpc/VpcManagerImpl.java --- @@ -747,6 +810,67 @@ public VpcOffering updateVpcOffering(final long vpcOffId, final String vpcOfferi } @Override + public CIDR[] getZoneSuperCidrList(final long zoneId) throws BadCIDRException { + final String superCIDRList = _dcDao.getDetail(zoneId, Params.SUPER_CIDR.name()); + if (superCIDRList != null) { + String[] str_cidr_list = superCIDRList.split(","); + CIDR[] cidr_list = NetUtils.convertToCIDR(str_cidr_list); + if (!NetUtils.cidrListConsistency(cidr_list)) { + throw new InvalidParameterValueException("The cidr list is not consistent " + Arrays.toString(cidr_list)); + } + return cidr_list; + } else { + throw new InvalidParameterValueException("Zone super cidr is null check cloud.data_center_details for zone id=" + zoneId); + } + } + + private List getAllVpcCidrs() throws BadCIDRException { + // get all the used cidrs + List usedSubnets = new ArrayList(); + for (Vpc vpc : _vpcDao.listAll()) { + if (_vpcSrvcDao.areServicesSupportedInVpc(vpc.getId(), Service.VPCDynamicRouting)) { + usedSubnets.add(CIDRFactory.getCIDR(vpc.getCidr())); + } + } + return usedSubnets; + } + + @Override + @ActionEvent(eventType = EventTypes.EVENT_VPC_CREATE, eventDescription = "creating vpc", create = true) + public synchronized Vpc createDynamicVpc(final long zoneId, final long vpcOffId, final long vpcOwnerId, final String vpcName, final String displayText, final String netmask, + String networkDomain, final Boolean displayVpc) throws ResourceAllocationException, BadCIDRException { + if (netmask != null) { + if (!NetUtils.isValidNetmask(netmask)) { --- End diff -- Please consider implementing this validation on the as a static method on the ``Netmask`` interface for IPv4/IPv6 dual stack support. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---