Search in sources :

Example 26 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetSourceIpTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getLayer3Match());
    assertTrue(actionCase.getSetField().getLayer3Match() instanceof Ipv4Match);
    Ipv4Match ipv4Match = (Ipv4Match) actionCase.getSetField().getLayer3Match();
    assertEquals(new Ipv4Prefix(IP_ADDRESS + "/" + IP_MASK), ipv4Match.getIpv4Source());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase) Ipv4Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match) Ipv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)

Example 27 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetSourceIpv6Test method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getLayer3Match());
    assertTrue(actionCase.getSetField().getLayer3Match() instanceof Ipv6Match);
    Ipv6Match ipv6Match = (Ipv6Match) actionCase.getSetField().getLayer3Match();
    assertEquals(new Ipv6Prefix(IP_ADDRESS + "/" + IP_MASK), ipv6Match.getIpv6Source());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase) Ipv6Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match) Ipv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix)

Example 28 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetTcpDestinationPortTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getLayer4Match());
    assertTrue(actionCase.getSetField().getLayer4Match() instanceof TcpMatch);
    TcpMatch tcpMatch = (TcpMatch) actionCase.getSetField().getLayer4Match();
    assertEquals(PORT, tcpMatch.getTcpDestinationPort().getValue().intValue());
}
Also used : TcpMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch) SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)

Example 29 with SetFieldCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase in project genius by opendaylight.

the class ActionSetUdpSourcePortTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof SetFieldCase);
    SetFieldCase actionCase = (SetFieldCase) action.getAction();
    assertNotNull(actionCase.getSetField().getLayer4Match());
    assertTrue(actionCase.getSetField().getLayer4Match() instanceof UdpMatch);
    UdpMatch tcpMatch = (UdpMatch) actionCase.getSetField().getLayer4Match();
    assertEquals(PORT, tcpMatch.getUdpSourcePort().getValue().intValue());
}
Also used : SetFieldCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase) UdpMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch)

Aggregations

SetFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase)16 ArrayList (java.util.ArrayList)6 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)6 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder)5 SetFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder)5 SetFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase)5 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action)5 Test (org.junit.Test)4 OutputActionCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase)4 PushVlanActionCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase)4 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)4 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)4 ByteBuf (io.netty.buffer.ByteBuf)3 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)3 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)3 List (java.util.List)2 ExecutionException (java.util.concurrent.ExecutionException)2 Ipv6Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix)2 SetDlDstActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder)2 SetDlSrcActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder)2