Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
3317085
wip
shwstppr Nov 10, 2021
ef44c34
IPv6: configure VR of isolated networks
weizhouapache Oct 19, 2021
8bc0e03
IPv6: add default IPv6 route in VR of isolated networks
weizhouapache Oct 19, 2021
1cfe54c
Reformat server/src/main/java/com/cloud/network/NetworkServiceImpl.java
weizhouapache Oct 19, 2021
3874027
IPv6: update network to offering which support IPv6
weizhouapache Oct 19, 2021
cbce2be
IPv6: update vm nic ipv6 address when update network to new offering
weizhouapache Oct 19, 2021
bcf1d39
IPv6: configure VPC VR to support multiple tiers with IPv6
weizhouapache Oct 19, 2021
84f8efb
IPv6: add RDNSS in radvd.conf
weizhouapache Oct 19, 2021
5000bcf
IPv6/UI: support ipv6 protocols in Network ACL
weizhouapache Oct 19, 2021
d7543de
wip
shwstppr Dec 15, 2021
a44e631
changes for diagnostics
shwstppr Dec 17, 2021
5100f59
more import fromo #5594
shwstppr Dec 17, 2021
6b175ee
IPv6: fix wrong public ipv6 in VPC VR
weizhouapache Oct 22, 2021
1aca1fe
changes
shwstppr Dec 17, 2021
71f29b4
fix
shwstppr Dec 17, 2021
bfa9a06
Update server/src/main/java/com/cloud/configuration/ConfigurationMana…
shwstppr Dec 17, 2021
b329221
ui: fix add ipv6 prefix labels, message
shwstppr Dec 17, 2021
d430dd8
ui: label fix
shwstppr Dec 17, 2021
98b2738
logging fix
shwstppr Dec 20, 2021
178119c
test fix
shwstppr Dec 20, 2021
5eac72d
changes
shwstppr Dec 22, 2021
7663a3c
minor ui refactor
shwstppr Dec 23, 2021
e66270b
ip6 events
shwstppr Dec 24, 2021
be6b688
ip6 usage
shwstppr Dec 29, 2021
50a5d63
unused
shwstppr Dec 29, 2021
fd27b86
slaac based public ip
shwstppr Dec 30, 2021
110a99a
fix
shwstppr Dec 31, 2021
f0172b2
remove unused
shwstppr Dec 31, 2021
57e392c
diagnostics fix for vr
shwstppr Jan 3, 2022
ee12754
firewall changes
shwstppr Jan 6, 2022
0e0f3b8
alert and show ipv6 usage
shwstppr Jan 17, 2022
d3146d6
fix
shwstppr Jan 17, 2022
7d2fdc7
change for network response
shwstppr Jan 20, 2022
9ca5d78
ipv6 network test
shwstppr Jan 20, 2022
6d99fae
changes
shwstppr Feb 1, 2022
fd27a09
Merge branch 'main' into ip6-routes
shwstppr Feb 1, 2022
4402c9f
ui: fix ipaddress listing
shwstppr Feb 3, 2022
91d7003
wip
shwstppr Feb 3, 2022
5d95774
Merge branch 'main' into ip6-routes
shwstppr Feb 8, 2022
e211218
fix simulator
shwstppr Feb 8, 2022
27a93a0
changes
shwstppr Feb 8, 2022
f51afaa
changes
shwstppr Feb 16, 2022
537774f
Merge branch 'main' into ip6-routes
shwstppr Feb 16, 2022
150058c
test fix
shwstppr Feb 17, 2022
593468f
test and fixes
shwstppr Feb 21, 2022
779acb6
Merge branch 'main' into ip6-routes
shwstppr Feb 21, 2022
bd2949a
Merge branch 'main' into ip6-routes
shwstppr Feb 22, 2022
bf2c4d3
test temp change revert
shwstppr Feb 22, 2022
4bf8183
fixes
shwstppr Feb 22, 2022
f656943
use uuid
shwstppr Mar 1, 2022
b78d46e
event syntax fix
shwstppr Mar 1, 2022
139b5c2
Merge branch 'main' into ip6-routes
shwstppr Mar 7, 2022
539bef5
wip
shwstppr Mar 7, 2022
54aada4
review comments
shwstppr Mar 8, 2022
c1d6316
Merge branch 'main' into ip6-routes
shwstppr Mar 11, 2022
c1d26a3
Merge branch 'main' into ip6-routes
shwstppr Mar 11, 2022
02f26ca
assign vlan public IP for dualstack only if both protocols present on…
shwstppr Mar 11, 2022
4e9cab8
internetprotocol in networkofferingresponse
shwstppr Mar 14, 2022
d549948
add tcp, udp
shwstppr Mar 14, 2022
4601797
support vpc with ipv6 only on same vlan
shwstppr Mar 14, 2022
b88528d
change and fix
shwstppr Mar 14, 2022
9700cc4
fix
shwstppr Mar 14, 2022
ee5b8b1
test fix
shwstppr Mar 17, 2022
5b4b41a
ui fixes
shwstppr Mar 17, 2022
4180984
fix multiple routes, network guest ipv6 gateway
shwstppr Mar 17, 2022
97ab9d3
Merge branch 'main' into ip6-routes
shwstppr Mar 21, 2022
60abf8a
address review comments
shwstppr Mar 24, 2022
6cce781
stop radvd on backup VR
shwstppr Mar 24, 2022
a0d9412
fix router redundant status with ipv6
shwstppr Mar 24, 2022
3e254af
disable radvd for backup vr
shwstppr Mar 24, 2022
2b64e2a
correctly set ipv6 in redundant router case
shwstppr Mar 24, 2022
dcbd5de
remove unused code
shwstppr Mar 28, 2022
6e8108f
fix connection
shwstppr Mar 29, 2022
5b7a983
ui: don't show all protocol for egress
shwstppr Mar 29, 2022
1525337
fix guest ipv6 for redundant VRs
shwstppr Mar 29, 2022
d7ba377
fix missing ipv6 on redundant vr
shwstppr Mar 29, 2022
9d104a4
Merge branch 'main' into ip6-routes
shwstppr Mar 29, 2022
2a1db17
fix syntax
shwstppr Mar 30, 2022
140225f
ui: fix vpc tier redirect to show details
shwstppr Mar 30, 2022
33f0c3d
Merge branch 'main' into ip6-routes
shwstppr Mar 30, 2022
ce44b4d
Merge branch 'fix-ui-vpctier-redirect' into ip6-routes
shwstppr Mar 30, 2022
6dde906
restart radvd on primary redundant vr
shwstppr Mar 30, 2022
524ce70
check for ipv6 values
shwstppr Mar 31, 2022
661d49a
Merge branch 'main' into ip6-routes
shwstppr Mar 31, 2022
351db91
remove old ui change
shwstppr Mar 31, 2022
273e692
fix condition
shwstppr Apr 1, 2022
db3304d
remove gateway from backup vr
shwstppr Apr 1, 2022
d128c81
network upgrade fail early
shwstppr Apr 1, 2022
8cf6886
fix radvd not running on RVR
shwstppr Apr 1, 2022
34e898a
prepare radvd.conf once
shwstppr Apr 4, 2022
2cd2301
fix job polling
shwstppr Apr 4, 2022
3f7d7e2
Merge branch 'main' into ip6-routes
shwstppr Apr 4, 2022
e0bdfa9
fix RVR for vpc with ipv6
shwstppr Apr 5, 2022
cf0bfe1
fix ipv6 network acls
shwstppr Apr 5, 2022
b0e4750
Update CsConfig.py
shwstppr Apr 8, 2022
2b2d57f
add check
shwstppr Apr 11, 2022
6ac3848
Merge branch 'main' into ip6-routes
shwstppr Apr 11, 2022
2f9da8d
test: vpc offering test
shwstppr Apr 12, 2022
a0cd817
test: add negative tests for guest prefix, public range
shwstppr Apr 12, 2022
ddbc60d
add default ipv6 route for primary
shwstppr Apr 12, 2022
df594e5
fix dadfailed on vpc rvr
shwstppr Apr 12, 2022
9c1c975
Merge branch 'main' into ip6-routes
shwstppr Apr 12, 2022
aafff95
ui: fix add iprange form, dedicate action visibility
shwstppr Apr 13, 2022
362b375
fix adding, deleting ipv6 range
shwstppr Apr 13, 2022
ed523b4
fix failing test
shwstppr Apr 13, 2022
be04d67
fix missing destination cidr in ipv6 firewall
shwstppr Apr 13, 2022
b7b1db4
fix ipv6 nftables rules
shwstppr Apr 17, 2022
95214f4
fix icmpv6 type, code
shwstppr Apr 17, 2022
85c75ab
fix icmp type, code
shwstppr Apr 18, 2022
d6d9548
test: add more for ipv6 network
shwstppr Apr 18, 2022
6cc019c
add warning message for egress policy in ipv6 fw rule
shwstppr Apr 19, 2022
ddc2efb
ui,server: update ipv6 vlan range
shwstppr Apr 19, 2022
22a635e
Merge branch 'main' into ip6-routes
shwstppr Apr 20, 2022
7e2cf75
subnet operations inside transaction
shwstppr Apr 20, 2022
9b64fc7
server: persistent public IPv6 for network
shwstppr Apr 20, 2022
42ba9e9
ui: fix action alignment
shwstppr Apr 21, 2022
d9ff0c0
fix vpc acl for tiers
shwstppr Apr 21, 2022
072b60e
fix removing network placeholder nic
shwstppr Apr 21, 2022
16d7bf2
fix acl rules for ip version
shwstppr Apr 21, 2022
be1a748
fix placeholder nic and nd-neighbor block issue
shwstppr Apr 21, 2022
2dd7eec
test for redundant nw
shwstppr Apr 21, 2022
86bd2d7
Merge branch 'main' into ip6-routes
shwstppr Apr 21, 2022
76e04e6
fix ping
shwstppr Apr 22, 2022
53683e6
Merge remote-tracking branch 'apache/main' into HEAD
weizhouapache Apr 24, 2022
b4b669e
systemvm: uprgade to debian 11.3.0
weizhouapache Apr 24, 2022
7dbe7a3
ipv6: enable ipv6 in sysctl config in bootstrap.sh
weizhouapache Apr 24, 2022
8bc29b3
VR: fix KeyError: 'nic_ip6_cidr'
weizhouapache Apr 25, 2022
d2d674e
Merge branch 'main' into ip6-routes
shwstppr Apr 25, 2022
636ead7
build fix for latest event changes
shwstppr Apr 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/FirewallRuleTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, Firewa
rule.getIcmpType(),
rule.getIcmpCode());
this.trafficType = trafficType;
if (FirewallRule.Purpose.Ipv6Firewall.equals(purpose)) {
this.destCidrList = rule.getDestinationCidrList();
}
}

public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType,
Expand Down
9 changes: 9 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/NetworkTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class NetworkTO {
protected boolean isSecurityGroupEnabled;
protected String name;
protected String ip6address;
protected String ip6gateway;
protected String ip6cidr;

public NetworkTO() {
Expand Down Expand Up @@ -68,6 +69,10 @@ public void setIp6Address(String addr) {
this.ip6address = addr;
}

public void setIp6Gateway(String gateway) {
this.ip6gateway = gateway;
}

public void setIp6Cidr(String cidr) {
this.ip6cidr = cidr;
}
Expand Down Expand Up @@ -161,6 +166,10 @@ public String getIp6Address() {
return ip6address;
}

public String getIp6Gateway() {
return ip6gateway;
}

public String getIp6Cidr() {
return ip6cidr;
}
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/capacity/Capacity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public interface Capacity extends InternalIdentity, Identity {
public static final short CAPACITY_TYPE_VLAN = 7;
public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8;
public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9;
public static final short CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 10;
public static final short CAPACITY_TYPE_GPU = 19;

public static final short CAPACITY_TYPE_CPU_CORE = 90;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@

import org.apache.cloudstack.api.command.admin.config.ResetCfgCmd;
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
import org.apache.cloudstack.api.command.admin.network.CreateGuestNetworkIpv6PrefixCmd;
import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd;
import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
import org.apache.cloudstack.api.command.admin.network.DeleteGuestNetworkIpv6PrefixCmd;
import org.apache.cloudstack.api.command.admin.network.DeleteManagementNetworkIpRangeCmd;
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.command.admin.network.ListGuestNetworkIpv6PrefixesCmd;
import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
import org.apache.cloudstack.api.command.admin.network.UpdatePodManagementNetworkIpRangeCmd;
import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd;
Expand Down Expand Up @@ -51,6 +54,7 @@
import org.apache.cloudstack.region.PortableIpRange;

import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenterGuestIpv6Prefix;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
import com.cloud.domain.Domain;
Expand Down Expand Up @@ -223,6 +227,21 @@ public interface ConfigurationService {
*/
void updatePodIpRange(UpdatePodManagementNetworkIpRangeCmd cmd) throws ConcurrentOperationException;

/**
* Creates a new IPv6 prefix for a zone. Needs to be >= /64.
*/
DataCenterGuestIpv6Prefix createDataCenterGuestIpv6Prefix(CreateGuestNetworkIpv6PrefixCmd cmd);

/**
* Lists IPv6 prefixes for a zone.
*/
List<? extends DataCenterGuestIpv6Prefix> listDataCenterGuestIpv6Prefixes(ListGuestNetworkIpv6PrefixesCmd cmd);

/**
* Deletes an existing IPv6 prefix.
*/
boolean deleteDataCenterGuestIpv6Prefix(DeleteGuestNetworkIpv6PrefixCmd cmd);

/**
* Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system.
*
Expand Down
32 changes: 32 additions & 0 deletions api/src/main/java/com/cloud/dc/DataCenterGuestIpv6Prefix.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package com.cloud.dc;

import java.util.Date;

import org.apache.cloudstack.acl.InfrastructureEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

public interface DataCenterGuestIpv6Prefix extends InfrastructureEntity, InternalIdentity, Identity {
Long getDataCenterId();

String getPrefix();

Date getCreated();
}
19 changes: 19 additions & 0 deletions api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.cloudstack.usage.Usage;

import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenterGuestIpv6Prefix;
import com.cloud.dc.Pod;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.dc.Vlan;
Expand Down Expand Up @@ -150,6 +151,10 @@ public class EventTypes {
public static final String EVENT_FIREWALL_CLOSE = "FIREWALL.CLOSE";
public static final String EVENT_FIREWALL_UPDATE = "FIREWALL.UPDATE";

public static final String EVENT_NET_IP6_ASSIGN = "NET.IP6ASSIGN";
public static final String EVENT_NET_IP6_RELEASE = "NET.IP6RELEASE";
public static final String EVENT_NET_IP6_UPDATE = "NET.IP6UPDATE";

public static final String EVENT_FIREWALL_EGRESS_OPEN = "FIREWALL.EGRESS.OPEN";
public static final String EVENT_FIREWALL_EGRESS_CLOSE = "FIREWALL.EGRESS.CLOSE";
public static final String EVENT_FIREWALL_EGRESS_UPDATE = "FIREWALL.EGRESS.UPDATE";
Expand Down Expand Up @@ -334,6 +339,9 @@ public class EventTypes {
public static final String EVENT_MANAGEMENT_IP_RANGE_DELETE = "MANAGEMENT.IP.RANGE.DELETE";
public static final String EVENT_MANAGEMENT_IP_RANGE_UPDATE = "MANAGEMENT.IP.RANGE.UPDATE";

public static final String EVENT_GUEST_IP6_PREFIX_CREATE = "GUEST.IP6.PREFIX.CREATE";
public static final String EVENT_GUEST_IP6_PREFIX_DELETE = "GUEST.IP6.PREFIX.DELETE";

public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE";
public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE";
public static final String EVENT_STORAGE_IP_RANGE_UPDATE = "STORAGE.IP.RANGE.UPDATE";
Expand Down Expand Up @@ -482,6 +490,11 @@ public class EventTypes {
public static final String EVENT_NETWORK_ACL_ITEM_UPDATE = "NETWORK.ACL.ITEM.UPDATE";
public static final String EVENT_NETWORK_ACL_ITEM_DELETE = "NETWORK.ACL.ITEM.DELETE";

// IPv6 firewall rule
public static final String EVENT_IPV6_FIREWALL_RULE_CREATE = "IPV6.FIREWALL.RULE.CREATE";
public static final String EVENT_IPV6_FIREWALL_RULE_UPDATE = "IPV6.FIREWALL.RULE.UPDATE";
public static final String EVENT_IPV6_FIREWALL_RULE_DELETE = "IPV6.FIREWALL.RULE.DELETE";

// VPC offerings
public static final String EVENT_VPC_OFFERING_CREATE = "VPC.OFFERING.CREATE";
public static final String EVENT_VPC_OFFERING_UPDATE = "VPC.OFFERING.UPDATE";
Expand Down Expand Up @@ -704,6 +717,9 @@ public class EventTypes {
entityEventDetails.put(EVENT_FIREWALL_EGRESS_OPEN, FirewallRule.class);
entityEventDetails.put(EVENT_FIREWALL_EGRESS_CLOSE, FirewallRule.class);
entityEventDetails.put(EVENT_FIREWALL_EGRESS_UPDATE, FirewallRule.class);
entityEventDetails.put(EVENT_NET_IP6_ASSIGN, Network.class);
entityEventDetails.put(EVENT_NET_IP6_RELEASE, Network.class);
entityEventDetails.put(EVENT_NET_IP6_UPDATE, Network.class);

// Nic Events
entityEventDetails.put(EVENT_NIC_CREATE, Nic.class);
Expand Down Expand Up @@ -845,6 +861,9 @@ public class EventTypes {
entityEventDetails.put(EVENT_MANAGEMENT_IP_RANGE_CREATE, Pod.class);
entityEventDetails.put(EVENT_MANAGEMENT_IP_RANGE_DELETE, Pod.class);

entityEventDetails.put(EVENT_GUEST_IP6_PREFIX_CREATE, DataCenterGuestIpv6Prefix.class);
entityEventDetails.put(EVENT_GUEST_IP6_PREFIX_DELETE, DataCenterGuestIpv6Prefix.class);

entityEventDetails.put(EVENT_STORAGE_IP_RANGE_CREATE, StorageNetworkIpRange.class);
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_DELETE, StorageNetworkIpRange.class);
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_UPDATE, StorageNetworkIpRange.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package com.cloud.network;

import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

public interface Ipv6GuestPrefixSubnetNetworkMap extends Identity, InternalIdentity {
enum State {
Allocating, // The subnet will be assigned to a network
Allocated, // The subnet is in use.
Free // The subnet is ready to be allocated.
}

long getPrefixId();

String getSubnet();

Long getNetworkId();

State getState();
}
94 changes: 94 additions & 0 deletions api/src/main/java/com/cloud/network/Ipv6Service.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.network;

import java.util.List;

import org.apache.cloudstack.api.command.user.ipv6.CreateIpv6FirewallRuleCmd;
import org.apache.cloudstack.api.command.user.ipv6.ListIpv6FirewallRulesCmd;
import org.apache.cloudstack.api.command.user.ipv6.UpdateIpv6FirewallRuleCmd;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.Configurable;

import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenterGuestIpv6Prefix;
import com.cloud.dc.Vlan;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.vpc.Vpc;
import com.cloud.utils.Pair;
import com.cloud.utils.component.PluggableService;
import com.cloud.vm.Nic;
import com.cloud.vm.NicProfile;

public interface Ipv6Service extends PluggableService, Configurable {

public static final int IPV6_SLAAC_CIDR_NETMASK = 64;

static final ConfigKey<Boolean> Ipv6OfferingCreationEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class,
"ipv6.offering.enabled",
"false",
"Indicates whether creation of IPv6 network/VPC offering is enabled or not.",
true);

static final ConfigKey<Integer> Ipv6PrefixSubnetCleanupInterval = new ConfigKey<Integer>("Advanced", Integer.class,
"network.ipv6.prefix.subnet.cleanup.interval",
"1800",
"Determines how long (in seconds) to wait before deallocating prefix subnets which are in Allocating state. The default value = 1800 seconds.",
true);

Pair<Integer, Integer> getUsedTotalIpv6SubnetForPrefix(DataCenterGuestIpv6Prefix prefix);

Pair<Integer, Integer> getUsedTotalIpv6SubnetForZone(long zoneId);

Pair<String, String> preAllocateIpv6SubnetForNetwork(long zoneId) throws ResourceAllocationException;

void assignIpv6SubnetToNetwork(String subnet, long networkId);

void releaseIpv6SubnetForNetwork(long networkId);

List<String> getAllocatedIpv6FromVlanRange(Vlan vlan);

Nic assignPublicIpv6ToNetwork(Network network, Nic nic);

void updateNicIpv6(NicProfile nic, DataCenter dc, Network network) throws InsufficientAddressCapacityException;

void releasePublicIpv6ForNic(Network network, String nicIpv6Address);

List<String> getPublicIpv6AddressesForNetwork(Network network);

void updateIpv6RoutesForVpcResponse(Vpc vpc, VpcResponse response);

void checkNetworkIpv6Upgrade(Network network) throws InsufficientAddressCapacityException, ResourceAllocationException;

FirewallRule updateIpv6FirewallRule(UpdateIpv6FirewallRuleCmd updateIpv6FirewallRuleCmd);

Pair<List<? extends FirewallRule>,Integer> listIpv6FirewallRules(ListIpv6FirewallRulesCmd listIpv6FirewallRulesCmd);

boolean revokeIpv6FirewallRule(Long id);

FirewallRule createIpv6FirewallRule(CreateIpv6FirewallRuleCmd createIpv6FirewallRuleCmd) throws NetworkRuleConflictException;

FirewallRule getIpv6FirewallRule(Long entityId);

boolean applyIpv6FirewallRule(long id);

void removePublicIpv6PlaceholderNics(Network network);
}
25 changes: 20 additions & 5 deletions api/src/main/java/com/cloud/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
import java.util.Date;
import java.util.List;

import com.cloud.exception.InvalidParameterValueException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Displayable;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang3.StringUtils;

import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType;
Expand Down Expand Up @@ -79,6 +78,22 @@ static PVlanType fromValue(String type) {
}
}

enum Routing {
Static, Dynamic;

public static Routing fromValue(String type) {
if (StringUtils.isBlank(type)) {
return null;
} else if (type.equalsIgnoreCase("Static")) {
return Static;
} else if (type.equalsIgnoreCase("Dynamic")) {
return Dynamic;
} else {
throw new InvalidParameterValueException("Unexpected Routing type : " + type);
}
}
}

String updatingInSequence = "updatingInSequence";
String hideIpAddressUsage = "hideIpAddressUsage";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public interface FirewallRule extends ControlledEntity, Identity, InternalIdentity, Displayable {
enum Purpose {
Firewall, PortForwarding, LoadBalancing, Vpn, StaticNat, NetworkACL,
Firewall, PortForwarding, LoadBalancing, Vpn, StaticNat, NetworkACL, Ipv6Firewall,
}

enum FirewallRuleType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.cloudstack.api.command.user.vpc.ListVPCOfferingsCmd;

import com.cloud.utils.Pair;
import com.cloud.utils.net.NetUtils;

public interface VpcProvisioningService {

Expand All @@ -34,7 +35,7 @@ public interface VpcProvisioningService {

VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices,
Map<String, List<String>> serviceProviders,
Map serviceCapabilitystList,
Map serviceCapabilitystList, NetUtils.InternetProtocol internetProtocol,
Long serviceOfferingId, List<Long> domainIds, List<Long> zoneIds, VpcOffering.State state);

Pair<List<? extends VpcOffering>,Integer> listVpcOfferings(ListVPCOfferingsCmd cmd);
Expand Down
Loading