From bfc8da1082ea3d27eec6d743d28b67ececdfd161 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Tue, 25 Sep 2012 15:51:48 -0700 Subject: [PATCH] Update Nicira Api to support L3 functionality --- .../network/nicira/DestinationNatRule.java | 53 +++++++ .../network/nicira/L3GatewayAttachment.java | 54 +++++++ .../network/nicira/LogicalRouterConfig.java | 64 +++++++++ .../network/nicira/LogicalRouterPort.java | 90 ++++++++++++ .../src/com/cloud/network/nicira/Match.java | 133 ++++++++++++++++++ .../src/com/cloud/network/nicira/NatRule.java | 24 ++++ .../cloud/network/nicira/NiciraNvpApi.java | 61 +++++++- .../cloud/network/nicira/RouterNextHop.java | 34 +++++ .../cloud/network/nicira/RoutingConfig.java | 5 + ...ingleDefaultRouteImplictRoutingConfig.java | 38 +++++ .../cloud/network/nicira/SourceNatRule.java | 79 +++++++++++ 11 files changed, 630 insertions(+), 5 deletions(-) create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/DestinationNatRule.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/L3GatewayAttachment.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterConfig.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterPort.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/Match.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NatRule.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RouterNextHop.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RoutingConfig.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SingleDefaultRouteImplictRoutingConfig.java create mode 100644 plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SourceNatRule.java diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/DestinationNatRule.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/DestinationNatRule.java new file mode 100644 index 00000000000..2cbdace3115 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/DestinationNatRule.java @@ -0,0 +1,53 @@ +package com.cloud.network.nicira; + +public class DestinationNatRule extends NatRule { + private Match match; + private String to_destination_ip_address_min; + private String to_destination_ip_address_max; + private Integer to_destination_port; + private String uuid; + private String type = "DestinationNatRule"; + + public Match getMatch() { + return match; + } + + public void setMatch(Match match) { + this.match = match; + } + + public String getToDestinationIpAddressMin() { + return to_destination_ip_address_min; + } + + public void setToDestinationIpAddressMin( + String to_destination_ip_address_min) { + this.to_destination_ip_address_min = to_destination_ip_address_min; + } + + public String getToDestinationIpAddressMax() { + return to_destination_ip_address_max; + } + + public void setToDestinationIpAddressMax( + String to_destination_ip_address_max) { + this.to_destination_ip_address_max = to_destination_ip_address_max; + } + + public Integer getToDestinationPort() { + return to_destination_port; + } + + public void setToDestinationPort(Integer to_destination_port) { + this.to_destination_port = to_destination_port; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/L3GatewayAttachment.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/L3GatewayAttachment.java new file mode 100644 index 00000000000..65a0a8ed5c4 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/L3GatewayAttachment.java @@ -0,0 +1,54 @@ +// 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.nicira; + +/** + * + */ +public class L3GatewayAttachment extends Attachment { + private String l3_gateway_service_uuid; + private String type = "L3GatewayAttachment"; + private int vlan_id; + + public L3GatewayAttachment(String l3_gateway_service_uuid) { + this.l3_gateway_service_uuid = l3_gateway_service_uuid; + // VLAN 0 is untagged, set explicitly of no vlan is given in the constructor + this.vlan_id = 0; + } + + public L3GatewayAttachment(String l3_gateway_service_uuid, int vlan_id) { + this.l3_gateway_service_uuid = l3_gateway_service_uuid; + this.vlan_id = vlan_id; + } + + public String getL3GatewayServiceUuid() { + return l3_gateway_service_uuid; + } + + public void setL3GatewayServiceUuid(String l3_gateway_service_uuid) { + this.l3_gateway_service_uuid = l3_gateway_service_uuid; + } + + public int getVlanId() { + return vlan_id; + } + + public void setVlanId(int vlan_id) { + this.vlan_id = vlan_id; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterConfig.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterConfig.java new file mode 100644 index 00000000000..897ee06b844 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterConfig.java @@ -0,0 +1,64 @@ +// 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.nicira; + +import java.util.List; + +/** + * + */ +public class LogicalRouterConfig { + private String display_name; + private RoutingConfig routing_config; + private String type = "LogicalRouterConfig"; + private String uuid; + private List tags; + + public RoutingConfig getRoutingConfig() { + return routing_config; + } + + public void setRoutingConfig(RoutingConfig routing_config) { + this.routing_config = routing_config; + } + + public String getDisplayName() { + return display_name; + } + + public void setDisplayName(String display_name) { + this.display_name = display_name; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterPort.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterPort.java new file mode 100644 index 00000000000..196106dbe40 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/LogicalRouterPort.java @@ -0,0 +1,90 @@ +// 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.nicira; + +import java.util.List; + +/** + * + */ +public class LogicalRouterPort { + private String display_name; + private List tags; + private Integer portno; + private boolean admin_status_enabled; + private List ip_addresses; + private String mac_address; + private String type = "LogicalRouterPortConfig"; + private String uuid; + + public int getPortno() { + return portno; + } + + public void setPortno(int portno) { + this.portno = portno; + } + + public boolean isAdminStatusEnabled() { + return admin_status_enabled; + } + + public void setAdminStatusEnabled(boolean admin_status_enabled) { + this.admin_status_enabled = admin_status_enabled; + } + + public List getIpAddresses() { + return ip_addresses; + } + + public void setIpAddresses(List ip_addresses) { + this.ip_addresses = ip_addresses; + } + + public String getMacAddress() { + return mac_address; + } + + public void setMacAddress(String mac_address) { + this.mac_address = mac_address; + } + + public String getDisplayName() { + return display_name; + } + + public void setDisplayName(String display_name) { + this.display_name = display_name; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + +} \ No newline at end of file diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/Match.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/Match.java new file mode 100644 index 00000000000..cd898476b39 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/Match.java @@ -0,0 +1,133 @@ +// 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.nicira; + +/** + * + */ +public class Match { + private Integer protocol; + private String source_ip_addresses; + private boolean source_ip_addresses_not; + private String destination_ip_addresses; + private boolean destination_ip_addresses_not; + private Integer source_port_min; + private Integer source_port_max; + private boolean source_port_not; + private Integer destination_port_min; + private Integer destination_port_max; + private boolean destination_port_not; + private String ethertype = "IPv4"; + + public Integer getProtocol() { + return protocol; + } + + public void setProtocol(Integer protocol) { + this.protocol = protocol; + } + + public Integer getSource_port_min() { + return source_port_min; + } + + public void setSourcePortMin(Integer source_port_min) { + this.source_port_min = source_port_min; + } + + public Integer getSourcePortMax() { + return source_port_max; + } + + public void setSourcePortMax(Integer source_port_max) { + this.source_port_max = source_port_max; + } + + public boolean isSourcePortNot() { + return source_port_not; + } + + public void setSourcePortNot(boolean source_port_not) { + this.source_port_not = source_port_not; + } + + public Integer getDestinationPortMin() { + return destination_port_min; + } + + public void setDestinationPortMin(Integer destination_port_min) { + this.destination_port_min = destination_port_min; + } + + public Integer getDestinationPortMax() { + return destination_port_max; + } + + public void setDestinationPortMax(Integer destination_port_max) { + this.destination_port_max = destination_port_max; + } + + public boolean isDestinationPortNot() { + return destination_port_not; + } + + public void setDestinationPortNot(boolean destination_port_not) { + this.destination_port_not = destination_port_not; + } + + public String getEthertype() { + return ethertype; + } + + public void setEthertype(String ethertype) { + this.ethertype = ethertype; + } + + public String getSourceIpAddresses() { + return source_ip_addresses; + } + + public void setSourceIpAddresses(String source_ip_addresses) { + this.source_ip_addresses = source_ip_addresses; + } + + public boolean isSourceIpAddressesNot() { + return source_ip_addresses_not; + } + + public void setSourceIpAddresses_not(boolean source_ip_addresses_not) { + this.source_ip_addresses_not = source_ip_addresses_not; + } + + public String getDestinationIpAddresses() { + return destination_ip_addresses; + } + + public void setDestinationIpAddresses(String destination_ip_addresses) { + this.destination_ip_addresses = destination_ip_addresses; + } + + public boolean isDestinationIpAddressesNot() { + return destination_ip_addresses_not; + } + + public void setDestinationIpAddressesNot(boolean destination_ip_addresses_not) { + this.destination_ip_addresses_not = destination_ip_addresses_not; + } + + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NatRule.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NatRule.java new file mode 100644 index 00000000000..30196f0e73a --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NatRule.java @@ -0,0 +1,24 @@ +// 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.nicira; + +/** + * + */ +public abstract class NatRule { + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java index 2c002abdbff..1c7b74155d3 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java @@ -78,6 +78,7 @@ import com.google.gson.reflect.TypeToken; public class NiciraNvpApi { private static final Logger s_logger = Logger.getLogger(NiciraNvpApi.class); + private final static String _protocol = "https"; private String _name; private String _host; @@ -117,7 +118,7 @@ public class NiciraNvpApi { String url; try { - url = new URL("https", _host, "/ws.v1/login").toString(); + url = new URL(_protocol, _host, "/ws.v1/login").toString(); } catch (MalformedURLException e) { s_logger.error("Unable to build Nicira API URL", e); throw new NiciraNvpApiException("Unable to build Nicira API URL", e); @@ -210,11 +211,61 @@ public class NiciraNvpApi { return lspl; } + public LogicalRouterConfig createLogicalRouter(LogicalRouterConfig logicalRouterConfig) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter"; + + LogicalRouterConfig lrc = executeCreateObject(logicalRouterConfig, new TypeToken(){}.getType(), uri, Collections.emptyMap()); + + return lrc; + } + + public void deleteLogicalRouter(String logicalRouterUuid) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid; + + executeDeleteObject(uri); + } + + public LogicalRouterPort createLogicalRouterPort(String logicalRouterUuid, LogicalRouterPort logicalRouterPort) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid + "/lport"; + + LogicalRouterPort lrp = executeCreateObject(logicalRouterPort, new TypeToken(){}.getType(), uri, Collections.emptyMap()); + return lrp; + } + + public void deleteLogicalRouterPort(String logicalRouterUuid, String logicalRouterPortUuid) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid + "/lport/" + logicalRouterPortUuid; + + executeDeleteObject(uri); + } + + public void modifyLogicalRouterPortAttachment(String logicalRouterUuid, String logicalRouterPortUuid, Attachment attachment) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid + "/lport/" + logicalRouterPortUuid + "/attachment"; + executeUpdateObject(attachment, uri, Collections.emptyMap()); + } + + public NatRule createLogicalRouterNatRule(String logicalRouterUuid, NatRule natRule) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid + "/nat"; + + if (natRule instanceof SourceNatRule) { + return executeCreateObject(natRule, new TypeToken(){}.getType(), uri, Collections.emptyMap()); + } + else if (natRule instanceof DestinationNatRule) { + return executeCreateObject(natRule, new TypeToken(){}.getType(), uri, Collections.emptyMap()); + } + + throw new NiciraNvpApiException("Unknown NatRule type"); + } + + public void deleteLogicalRouterNatRule(String logicalRouterUuid, String natRuleUuid) throws NiciraNvpApiException { + String uri = "/ws.v1/lrouter/" + logicalRouterUuid + "/nat/" + natRuleUuid; + + executeDeleteObject(uri); + } private void executeUpdateObject(T newObject, String uri, Map parameters) throws NiciraNvpApiException { String url; try { - url = new URL("https", _host, uri).toString(); + url = new URL(_protocol, _host, uri).toString(); } catch (MalformedURLException e) { s_logger.error("Unable to build Nicira API URL", e); throw new NiciraNvpApiException("Connection to NVP Failed"); @@ -244,7 +295,7 @@ public class NiciraNvpApi { private T executeCreateObject(T newObject, Type returnObjectType, String uri, Map parameters) throws NiciraNvpApiException { String url; try { - url = new URL("https", _host, uri).toString(); + url = new URL(_protocol, _host, uri).toString(); } catch (MalformedURLException e) { s_logger.error("Unable to build Nicira API URL", e); throw new NiciraNvpApiException("Unable to build Nicira API URL", e); @@ -282,7 +333,7 @@ public class NiciraNvpApi { private void executeDeleteObject(String uri) throws NiciraNvpApiException { String url; try { - url = new URL("https", _host, uri).toString(); + url = new URL(_protocol, _host, uri).toString(); } catch (MalformedURLException e) { s_logger.error("Unable to build Nicira API URL", e); throw new NiciraNvpApiException("Unable to build Nicira API URL", e); @@ -303,7 +354,7 @@ public class NiciraNvpApi { private T executeRetrieveObject(Type returnObjectType, String uri, Map parameters) throws NiciraNvpApiException { String url; try { - url = new URL("https", _host, uri).toString(); + url = new URL(_protocol, _host, uri).toString(); } catch (MalformedURLException e) { s_logger.error("Unable to build Nicira API URL", e); throw new NiciraNvpApiException("Unable to build Nicira API URL", e); diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RouterNextHop.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RouterNextHop.java new file mode 100644 index 00000000000..be302fab79a --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RouterNextHop.java @@ -0,0 +1,34 @@ +// 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.nicira; + +/** + * + */ +public class RouterNextHop { + private String gateway_ip_address; + private String type = "RouterNextHop"; + + public String getGatewayIpAddress() { + return gateway_ip_address; + } + + public void setGatewayIpAddress(String gateway_ip_address) { + this.gateway_ip_address = gateway_ip_address; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RoutingConfig.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RoutingConfig.java new file mode 100644 index 00000000000..12b3227e2e2 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/RoutingConfig.java @@ -0,0 +1,5 @@ +package com.cloud.network.nicira; + +public class RoutingConfig { + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SingleDefaultRouteImplictRoutingConfig.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SingleDefaultRouteImplictRoutingConfig.java new file mode 100644 index 00000000000..b4eda447b13 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SingleDefaultRouteImplictRoutingConfig.java @@ -0,0 +1,38 @@ +// 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.nicira; + +/** + * + */ +public class SingleDefaultRouteImplictRoutingConfig extends RoutingConfig { + public RouterNextHop default_route_next_hop; + public String type = "SingleDefaultRouteImplicitRoutingConfig"; + + public SingleDefaultRouteImplictRoutingConfig(RouterNextHop routerNextHop) { + default_route_next_hop = routerNextHop; + } + + public RouterNextHop getDefaultRouteNextHop() { + return default_route_next_hop; + } + + public void setDefaultRouteNextHop(RouterNextHop default_route_next_hop) { + this.default_route_next_hop = default_route_next_hop; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SourceNatRule.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SourceNatRule.java new file mode 100644 index 00000000000..7d1c13d9fc5 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/SourceNatRule.java @@ -0,0 +1,79 @@ +// 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.nicira; + +/** + * + */ +public class SourceNatRule extends NatRule { + private Match match; + private String to_source_ip_address_min; + private String to_source_ip_address_max; + private Integer to_source_port_min; + private Integer to_source_port_max; + private String uuid; + private String type = "SourceNatRule"; + + public Match getMatch() { + return match; + } + + public void setMatch(Match match) { + this.match = match; + } + + public String getToSourceIpAddressMin() { + return to_source_ip_address_min; + } + + public void setToSourceIpAddressMin(String to_source_ip_address_min) { + this.to_source_ip_address_min = to_source_ip_address_min; + } + + public String getToSourceIpAddressMax() { + return to_source_ip_address_max; + } + + public void setToSourceIpAddressMax(String to_source_ip_address_max) { + this.to_source_ip_address_max = to_source_ip_address_max; + } + + public Integer getToSourcePortMin() { + return to_source_port_min; + } + + public void setToSourcePortMin(Integer to_source_port_min) { + this.to_source_port_min = to_source_port_min; + } + + public Integer getToSourcePortMax() { + return to_source_port_max; + } + + public void setToSourcePortMax(Integer to_source_port_max) { + this.to_source_port_max = to_source_port_max; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + +}