Skip to content

Commit d5ac10d

Browse files
committed
2 parents fd8607d + bf6ed93 commit d5ac10d

52 files changed

Lines changed: 1296 additions & 482 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/src/com/cloud/agent/api/to/FirewallRuleTO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public FirewallRuleTO(long id, String srcIp, String protocol, Integer srcPortSta
5858
this(id,null,srcIp,protocol,srcPortStart,srcPortEnd,revoked,alreadyAdded,purpose,sourceCidr,icmpType,icmpCode);
5959
}
6060
public FirewallRuleTO(long id,String srcVlanTag, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded, FirewallRule.Purpose purpose, List<String> sourceCidr,Integer icmpType,Integer icmpCode) {
61+
this.id = id;
6162
this.srcVlanTag = srcVlanTag;
6263
this.srcIp = srcIp;
6364
this.protocol = protocol;

api/src/com/cloud/agent/api/to/LoadBalancerTO.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ public class LoadBalancerTO {
4343
String algorithm;
4444
boolean revoked;
4545
boolean alreadyAdded;
46+
boolean inline;
4647
DestinationTO[] destinations;
4748
private StickinessPolicyTO[] stickinessPolicies;
4849
private AutoScaleVmGroupTO autoScaleVmGroupTO;
4950
final static int MAX_STICKINESS_POLICIES = 1;
5051

51-
public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> destinations) {
52+
public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List<LbDestination> destinations) {
5253
if (destinations == null) { // for autoscaleconfig destinations will be null;
5354
destinations = new ArrayList<LbDestination>();
5455
}
@@ -59,6 +60,7 @@ public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, S
5960
this.algorithm = algorithm;
6061
this.revoked = revoked;
6162
this.alreadyAdded = alreadyAdded;
63+
this.inline = inline;
6264
this.destinations = new DestinationTO[destinations.size()];
6365
this.stickinessPolicies = null;
6466
int i = 0;
@@ -67,8 +69,8 @@ public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, S
6769
}
6870
}
6971

70-
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies) {
71-
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, arg_destinations);
72+
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies) {
73+
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations);
7274
this.stickinessPolicies = null;
7375
if (stickinessPolicies != null && stickinessPolicies.size() > 0) {
7476
this.stickinessPolicies = new StickinessPolicyTO[MAX_STICKINESS_POLICIES];
@@ -116,6 +118,10 @@ public boolean isAlreadyAdded() {
116118
return alreadyAdded;
117119
}
118120

121+
public boolean isInline() {
122+
return inline;
123+
}
124+
119125
public StickinessPolicyTO[] getStickinessPolicies() {
120126
return stickinessPolicies;
121127
}

api/src/com/cloud/agent/api/to/StaticNatRuleTO.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public StaticNatRuleTO(long id, String srcIp, Integer srcPortStart, Integer srcP
4747
super(id, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.StaticNat, null,0,0);
4848
this.dstIp = dstIp;
4949
}
50+
51+
public StaticNatRuleTO(long id,String srcVlanTag, String srcIp, Integer srcPortStart, Integer srcPortEnd, String dstIp, Integer dstPortStart, Integer dstPortEnd, String protocol, boolean revoked, boolean alreadyAdded) {
52+
super(id, srcVlanTag, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.StaticNat, null,0,0);
53+
this.dstIp = dstIp;
54+
}
5055

5156
public String getDstIp() {
5257
return dstIp;

api/src/com/cloud/network/Network.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public static class Capability {
171171
public static final Capability AssociatePublicIP = new Capability("AssociatePublicIP");
172172
public static final Capability ElasticLb = new Capability("ElasticLb");
173173
public static final Capability AutoScaleCounters = new Capability("AutoScaleCounters");
174+
public static final Capability InlineMode = new Capability("InlineMode");
174175

175176
private String name;
176177

api/src/com/cloud/network/element/IpDeployer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.cloud.exception.ResourceUnavailableException;
2323
import com.cloud.network.Network;
24+
import com.cloud.network.Network.Provider;
2425
import com.cloud.network.Network.Service;
2526
import com.cloud.network.PublicIpAddress;
2627

@@ -33,4 +34,6 @@ public interface IpDeployer {
3334
* @throws ResourceUnavailableException
3435
*/
3536
boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress, Set<Service> services) throws ResourceUnavailableException;
37+
38+
Provider getProvider();
3639
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.network.element;
18+
19+
import com.cloud.network.Network;
20+
21+
public interface IpDeployingRequester {
22+
/**
23+
* Would return the IpDeployer can deploy IP for this element
24+
* @param network
25+
* @return IpDeployer object, or null if there is no deployer for this element
26+
*/
27+
IpDeployer getIpDeployer(Network network);
28+
}

api/src/com/cloud/network/element/LoadBalancingServiceProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.cloud.network.Network;
2323
import com.cloud.network.lb.LoadBalancingRule;
2424

25-
public interface LoadBalancingServiceProvider extends NetworkElement {
25+
public interface LoadBalancingServiceProvider extends NetworkElement, IpDeployingRequester {
2626
/**
2727
* Apply rules
2828
* @param network
@@ -32,7 +32,6 @@ public interface LoadBalancingServiceProvider extends NetworkElement {
3232
*/
3333
boolean applyLBRules(Network network, List<LoadBalancingRule> rules) throws ResourceUnavailableException;
3434

35-
IpDeployer getIpDeployer(Network network);
3635
/**
3736
* Validate rules
3837
* @param network

api/src/com/cloud/network/element/PortForwardingServiceProvider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.cloud.network.Network;
2323
import com.cloud.network.rules.PortForwardingRule;
2424

25-
public interface PortForwardingServiceProvider extends NetworkElement {
25+
public interface PortForwardingServiceProvider extends NetworkElement, IpDeployingRequester {
2626
/**
2727
* Apply rules
2828
* @param network
@@ -31,6 +31,4 @@ public interface PortForwardingServiceProvider extends NetworkElement {
3131
* @throws ResourceUnavailableException
3232
*/
3333
boolean applyPFRules(Network network, List<PortForwardingRule> rules) throws ResourceUnavailableException;
34-
35-
IpDeployer getIpDeployer(Network network);
3634
}

api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
import com.cloud.network.RemoteAccessVpn;
2424
import com.cloud.network.VpnUser;
2525

26-
public interface RemoteAccessVPNServiceProvider extends NetworkElement {
26+
public interface RemoteAccessVPNServiceProvider extends NetworkElement, IpDeployingRequester {
2727
String[] applyVpnUsers(RemoteAccessVpn vpn, List<? extends VpnUser> users) throws ResourceUnavailableException;
2828

2929
boolean startVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
3030

3131
boolean stopVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
32-
33-
IpDeployer getIpDeployer(Network network);
3432
}

api/src/com/cloud/network/element/SourceNatServiceProvider.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616
// under the License.
1717
package com.cloud.network.element;
1818

19-
import com.cloud.network.Network;
20-
21-
public interface SourceNatServiceProvider extends NetworkElement {
22-
IpDeployer getIpDeployer(Network network);
19+
public interface SourceNatServiceProvider extends NetworkElement, IpDeployingRequester {
2320
}

0 commit comments

Comments
 (0)