Package com.cloud.network.nicira

Examples of com.cloud.network.nicira.DestinationNatRule


      }
    }
   
    protected NatRule[] generateStaticNatRulePair(String insideIp, String outsideIp) {
      NatRule[] rulepair = new NatRule[2];
      rulepair[0] = new DestinationNatRule();
      rulepair[0].setType("DestinationNatRule");
      rulepair[0].setOrder(100);
      rulepair[1] = new SourceNatRule();
      rulepair[1].setType("SourceNatRule");
      rulepair[1].setOrder(100);
View Full Code Here


  public void testGenerateStaticNatRulePair() {
    NatRule[] rules = _resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
    assertTrue("DestinationNatRule".equals(rules[0].getType()));
    assertTrue("SourceNatRule".equals(rules[1].getType()));
   
    DestinationNatRule dnr = (DestinationNatRule) rules[0];
    assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
    assertTrue(dnr.getToDestinationPort() == null);
    assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"))
   
    SourceNatRule snr = (SourceNatRule) rules[1];
    assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
    assertTrue(snr.getToSourcePort() == null);
    assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

  public void testGeneratePortForwardingRulePair() {
    NatRule[] rules = _resource.generatePortForwardingRulePair("10.10.10.10", new int[] { 80808080 }, "11.11.11.11", new int[] { 80, 80 }, "tcp" );
    assertTrue("DestinationNatRule".equals(rules[0].getType()));
    assertTrue("SourceNatRule".equals(rules[1].getType()));
   
    DestinationNatRule dnr = (DestinationNatRule) rules[0];
    assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
    assertTrue(dnr.getToDestinationPort() == 8080);
    assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"))
    assertTrue(dnr.getMatch().getDestinationPort() == 80 );
    assertTrue(dnr.getMatch().getEthertype().equals("IPv4") && dnr.getMatch().getProtocol() == 6);
   
    SourceNatRule snr = (SourceNatRule) rules[1];
    assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
    assertTrue(snr.getToSourcePort() == 80);
    assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

        }
    }

    protected NatRule[] generateStaticNatRulePair(final String insideIp, final String outsideIp) {
        NatRule[] rulepair = new NatRule[2];
        rulepair[0] = new DestinationNatRule();
        rulepair[0].setType("DestinationNatRule");
        rulepair[0].setOrder(100);
        rulepair[1] = new SourceNatRule();
        rulepair[1].setType("SourceNatRule");
        rulepair[1].setOrder(100);
View Full Code Here

    public void testGenerateStaticNatRulePair() {
        final NatRule[] rules = resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
        assertTrue("DestinationNatRule".equals(rules[0].getType()));
        assertTrue("SourceNatRule".equals(rules[1].getType()));

        final DestinationNatRule dnr = (DestinationNatRule)rules[0];
        assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
        assertTrue(dnr.getToDestinationPort() == null);
        assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"));

        final SourceNatRule snr = (SourceNatRule)rules[1];
        assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
        assertTrue(snr.getToSourcePort() == null);
        assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

    public void testGeneratePortForwardingRulePair() {
        final NatRule[] rules = resource.generatePortForwardingRulePair("10.10.10.10", new int[] {8080, 8080}, "11.11.11.11", new int[] {80, 80}, "tcp");
        assertTrue("DestinationNatRule".equals(rules[0].getType()));
        assertTrue("SourceNatRule".equals(rules[1].getType()));

        final DestinationNatRule dnr = (DestinationNatRule)rules[0];
        assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
        assertTrue(dnr.getToDestinationPort() == 8080);
        assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"));
        assertTrue(dnr.getMatch().getDestinationPort() == 80);
        assertTrue(dnr.getMatch().getEthertype().equals("IPv4") && dnr.getMatch().getProtocol() == 6);

        final SourceNatRule snr = (SourceNatRule)rules[1];
        assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
        assertTrue(snr.getToSourcePort() == 80);
        assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

    public void testGenerateStaticNatRulePair() {
        NatRule[] rules = _resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
        assertTrue("DestinationNatRule".equals(rules[0].getType()));
        assertTrue("SourceNatRule".equals(rules[1].getType()));

        DestinationNatRule dnr = (DestinationNatRule) rules[0];
        assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
        assertTrue(dnr.getToDestinationPort() == null);
        assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"));

        SourceNatRule snr = (SourceNatRule) rules[1];
        assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
        assertTrue(snr.getToSourcePort() == null);
        assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

    public void testGeneratePortForwardingRulePair() {
        NatRule[] rules = _resource.generatePortForwardingRulePair("10.10.10.10", new int[] { 80808080 }, "11.11.11.11", new int[] { 80, 80 }, "tcp" );
        assertTrue("DestinationNatRule".equals(rules[0].getType()));
        assertTrue("SourceNatRule".equals(rules[1].getType()));

        DestinationNatRule dnr = (DestinationNatRule) rules[0];
        assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
        assertTrue(dnr.getToDestinationPort() == 8080);
        assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"));
        assertTrue(dnr.getMatch().getDestinationPort() == 80 );
        assertTrue(dnr.getMatch().getEthertype().equals("IPv4") && dnr.getMatch().getProtocol() == 6);

        SourceNatRule snr = (SourceNatRule) rules[1];
        assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
        assertTrue(snr.getToSourcePort() == 80);
        assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
View Full Code Here

        }
    }

    protected NatRule[] generateStaticNatRulePair(String insideIp, String outsideIp) {
        NatRule[] rulepair = new NatRule[2];
        rulepair[0] = new DestinationNatRule();
        rulepair[0].setType("DestinationNatRule");
        rulepair[0].setOrder(100);
        rulepair[1] = new SourceNatRule();
        rulepair[1].setType("SourceNatRule");
        rulepair[1].setOrder(100);
View Full Code Here

TOP

Related Classes of com.cloud.network.nicira.DestinationNatRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.