Search in sources :

Example 61 with EtherType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.

the class Test method createMatchBld.

private static MatchBuilder createMatchBld() {
    MatchBuilder match = new MatchBuilder();
    Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
    Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
    ipv4Match.setIpv4Destination(prefix);
    Ipv4Match i4m = ipv4Match.build();
    match.setLayer3Match(i4m);
    EthernetMatchBuilder eth = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    eth.setEthernetType(ethTypeBuilder.build());
    match.setEthernetMatch(eth.build());
    return match;
}
Also used : Ipv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder) EthernetTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder) EtherType(org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) Ipv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder) Ipv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix) Ipv4Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)

Example 62 with EtherType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.

the class OF13PushPbbActionDeserializer method deserialize.

@Override
public Action deserialize(ByteBuf input) {
    final ActionBuilder builder = new ActionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    PushPbbCaseBuilder caseBuilder = new PushPbbCaseBuilder();
    PushPbbActionBuilder pbbBuilder = new PushPbbActionBuilder();
    pbbBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
    caseBuilder.setPushPbbAction(pbbBuilder.build());
    builder.setActionChoice(caseBuilder.build());
    input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
    return builder.build();
}
Also used : ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) PushPbbActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder) PushPbbActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder) EtherType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType) PushPbbCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder)

Example 63 with EtherType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.

the class OxmEthTypeDeserializer method addEthTypeValue.

private static void addEthTypeValue(ByteBuf input, MatchEntryBuilder builder) {
    EthTypeCaseBuilder caseBuilder = new EthTypeCaseBuilder();
    EthTypeBuilder ethBuilder = new EthTypeBuilder();
    ethBuilder.setEthType(new EtherType(input.readUnsignedShort()));
    caseBuilder.setEthType(ethBuilder.build());
    builder.setMatchEntryValue(caseBuilder.build());
}
Also used : EthTypeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCaseBuilder) EtherType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType) EthTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.type._case.EthTypeBuilder)

Example 64 with EtherType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.

the class PacketOutInputMessageFactoryTest method createAction.

private List<Action> createAction() {
    final List<Action> actions = new ArrayList<>();
    ActionBuilder actionBuilder = new ActionBuilder();
    PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
    PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
    pushVlanBuilder.setEthertype(new EtherType(new EtherType(25)));
    pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
    actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
    actions.add(actionBuilder.build());
    actionBuilder = new ActionBuilder();
    actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
    actions.add(actionBuilder.build());
    actionBuilder = new ActionBuilder();
    actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
    actions.add(actionBuilder.build());
    actionBuilder = new ActionBuilder();
    actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
    actions.add(actionBuilder.build());
    actionBuilder = new ActionBuilder();
    actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
    actions.add(actionBuilder.build());
    return actions;
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action) PushVlanCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) PushVlanActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder) PushVlanActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder) PopVlanCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder) ArrayList(java.util.ArrayList) EtherType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType)

Example 65 with EtherType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.

the class EthernetTypeEntrySerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    final long ethType = 0xffffL;
    final Match match = new MatchBuilder().setEthernetMatch(new EthernetMatchBuilder().setEthernetType(new EthernetTypeBuilder().setType(new EtherType(ethType)).build()).build()).build();
    assertMatch(match, false, (out) -> assertEquals(out.readUnsignedShort(), ethType));
}
Also used : EthernetTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder) EtherType(org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) Test(org.junit.Test)

Aggregations

MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)45 EtherType (org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType)41 EthernetTypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder)41 EthernetMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)41 Ipv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder)34 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)27 Icmpv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder)25 Ipv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder)25 EtherType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType)23 Icmpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder)20 VlanMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder)20 TcpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder)20 UdpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder)20 ArpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder)18 TunnelIpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder)18 SctpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder)18 TcpFlagsMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder)17 ArrayList (java.util.ArrayList)15 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)15 Test (org.junit.Test)14