SfcOpenflowUtils { public static Action createActionPushVlan(int order) { PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder(); pushVlanBuilder.setEthernetType(ETHERTYPE_VLAN); PushVlanActionCaseBuilder pushVlanActionCase = new PushVlanActionCaseBuilder(); pushVlanActionCase.setPushVlanAction(pushVlanBuilder.build()); ActionBuilder ab = createActionBuilder(order); ab.setAction(pushVlanActionCase.build()); return ab.build(); }  static FlowBuilder createFlowBuilder(
            final short table, final int priority, final BigInteger cookieValue,
            final String flowName, MatchBuilder match, InstructionsBuilder isb); static FlowBuilder createFlowBuilder(
            final short table, final int priority, final String flowName, MatchBuilder match, InstructionsBuilder isb); static void addMatchEtherType(MatchBuilder match, final long etherType); static void addMatchSrcMac(MatchBuilder match, final String srcMac); static void addMatchDstMac(MatchBuilder match, final String dstMac); static void addMatchIpProtocol(MatchBuilder match, final short ipProtocol); static void addMatchTcpSyn(MatchBuilder match); static void addMatchDscp(MatchBuilder match, short dscpVal); static void addMatchSrcUdpPort(MatchBuilder match, int portNum); static void addMatchDstUdpPort(MatchBuilder match, int portNum); static void addMatchSrcTcpPort(MatchBuilder match, int portNum); static void addMatchDstTcpPort(MatchBuilder match, int portNum); static void addMatchSrcSctpPort(MatchBuilder match, int portNum); static void addMatchDstSctpPort(MatchBuilder match, int portNum); static void addMatchMplsLabel(MatchBuilder match, long label); static void addMatchVlan(MatchBuilder match, int vlan); static void addMatchArpRequest(MatchBuilder match); static void addMatchArpRequestAndTpa(MatchBuilder match, String requestedIp); static void addMatchSrcIpv4(MatchBuilder match, String srcIpStr, int netmask); static void addMatchSrcIpv4(MatchBuilder match, Ipv4Prefix srcIp); static void addMatchDstIpv4(MatchBuilder match, String dstIpStr, int netmask); static void addMatchDstIpv4(MatchBuilder match, Ipv4Prefix dstIp); static void addMatchSrcIpv6(MatchBuilder match, String srcIpStr, int netmask); static void addMatchSrcIpv6(MatchBuilder match, Ipv6Prefix srcIp); static void addMatchDstIpv6(MatchBuilder match, String dstIpStr, int netmask); static void addMatchDstIpv6(MatchBuilder match, Ipv6Prefix dstIp); static void addMatchMetada(MatchBuilder match, BigInteger metadataValue, BigInteger metadataMask); static void addMatchNshNsp(MatchBuilder match, long nsp); static void addMatchNshNsi(MatchBuilder match, short nsi); static void addMatchNshNsc1(MatchBuilder match, long nsc); static void addMatchInPort(MatchBuilder match, NodeId nodeId, long inPort); static void addMatchInPort(MatchBuilder match, NodeConnectorId nodeConnId); static GoToTableBuilder createActionGotoTable(final short toTable); static Action createActionResubmitTable(final short toTable, int order); static GroupActionBuilder createGroupAction(final long groupId); static Action createActionOutPort(final int portUri, final int order); static Action createActionOutPort(final String portUri, final int order); static Action createActionSetEtherType(final long etherType, final int order); static Action createActionWriteDscp(short dscpVal, final int order); static Action createActionPktIn(final int pktLength, final int order); static Action createActionNormal(final int order); static Action createActionSetDlSrc(String srcMac, int order); static Action createActionSetDlDst(String dstMac, int order); static Action createActionSetNwDst(String ipStr, int netmask, int order); static Action createActionPopVlan(int order); static Action createActionPushVlan(int order); static Action createActionSetVlanId(int vlan, int order); static Action createActionPushMpls(int order); static Action createActionSetMplsLabel(long label, int order); static Action createActionPopMpls(int order); static Action createActionDropPacket(int order); static Action createActionDecNwTtl(int order); static Action createActionNxPushNsh(int order); static Action createActionNxPopNsh(int order); static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxLoadRegAction(
            DstChoice dstChoice, BigInteger value, int endOffset, boolean groupBucket); static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxMoveRegAction(
            SrcChoice srcChoice, DstChoice dstChoice, int endOffset, boolean groupBucket); static Action createActionNxSetTunIpv4Dst(String ipStr, int order); static Action createActionNxMoveTunIdRegister(int order); static Action createActionNxMoveTunIpv4Dst(int order); static Action createActionNxMoveNsc1(int order); static Action createActionNxMoveNsc2(int order); static Action createActionNxMoveNsc3(int order); static Action createActionNxMoveNsc4(int order); static Action createActionNxMoveNsi(int order); static Action createActionNxMoveNsp(int order); static Action createActionNxMoveTunGpeNp(int order); static Action createActionNxMoveNshMdtype(int order); static Action createActionNxMoveNshNp(int order); static Action createActionNxMoveNsc2ToTunIdRegister(int order); static Action createActionNxMoveNsc1ToTunIpv4DstRegister(int order); static Action createActionNxLoadArpOpAction(int value, int order); static Action createActionNxMoveArpShaToArpThaAction(int order); static Action createActionNxMoveEthSrcToEthDstAction(int order); static Action createActionNxLoadNshMdtype(short value, int order); static Action createActionNxLoadNshNp(short value, int order); static Action createActionNxLoadTunGpeNp(short value, int order); static Action createActionNxLoadNsp(int value, int order); static Action createActionNxLoadNsi(short value, int order); static Action createActionNxLoadNshc1(long value, int order); static Action createActionNxLoadNshc2(long value, int order); static Action createActionNxLoadNshc3(long value, int order); static Action createActionNxLoadNshc4(long value, int order); static Action createActionNxLoadEncapEthSrc(String value, int order); static Action createActionNxLoadEncapEthDst(String mac, int order); static Action createActionNxLoadTunId(long value, int order); static Action createActionNxLoadTunIpv4Dst(String ipStr, int order); static Action createActionNxResubmit(int inPort, short table, int order); static Action createActionNxMoveEthSrcToEncapEthSrc(int order); static Action createActionNxMoveEthDstToEncapEthDst(int order); static Action createActionNxLoadArpShaAction(String mac, int order); static Action createActionNxMoveArpTpaToRegAction(int order); static Action createActionNxLoadArpSpaAction(String ip, int order); static void addMatchEncapEthType(MatchBuilder match, int ethType); static void addMatchEncapEthSrc(MatchBuilder match, String mac); static void addMatchEncapEthDst(MatchBuilder match, String mac); static void addMatchNshMdtype(MatchBuilder match, short nshMdtype); static void addMatchNshNp(MatchBuilder match, short nshNp); static void addMatchTunGpeNp(MatchBuilder match, short tunGpeNp); static void addMatchReg0(MatchBuilder match, int value); static void addMatchInPort(MatchBuilder match, String nodeName, int value); static Action createActionNxMoveArpSpaToArpTpaAction(int order); static Action createActionNxMoveRegToArpSpaAction(int order); static Action createActionNxLoadReg0(int value, int order); static Action createActionNxSetNsp(Long nsp, int order); static Action createActionNxSetNsi(Short nsi, int order); static Action createActionNxSetNshc1(Long c1, int order); static Action createActionNxSetNshc2(Long c2, int order); static Action createActionNxSetNshc3(Long c3, int order); static Action createActionNxSetNshc4(Long c4, int order); static WriteMetadataCase createInstructionMetadata(int order, BigInteger metadataVal, BigInteger metadataMask); static InstructionsBuilder createInstructionsBuilder(InstructionBuilder ib); static InstructionsBuilder createInstructionsBuilder(InstructionBuilder... ibs); static InstructionBuilder createActionsInstructionBuilder(Action... actions); static boolean writeFlowToDataStore(final String nodeName, FlowBuilder flow); static boolean removeFlowFromDataStore(final String nodeName, TableKey tableKey, FlowKey flowKey); static boolean isSffOpenFlowCapable(final String sffName); static final InstanceIdentifier<Node> createNodePath(final NodeId nodeId); static final InstanceIdentifier<Table> createTablePath(final NodeId nodeId, final short tableId); static InstanceIdentifier<Flow> createFlowPath(final InstanceIdentifier<Table> table, final FlowKey flowKey); static InstanceIdentifier<Flow> createFlowPath(final InstanceIdentifier<Table> table, final FlowId flowId); static InstructionsBuilder wrapActionsIntoApplyActionsInstruction(List<Action> theActions); static MatchBuilder getNshMatches(long nsp, short nsi); static MatchBuilder getNshMatches(long nsp); static InstructionsBuilder appendGotoTableInstruction(InstructionsBuilder isb, short nextTableId); static Instruction createGotoTableInstruction(short nextTableId, int order); static InstructionsBuilder appendMetadataInstruction(InstructionsBuilder isb, BigInteger theMetadata, BigInteger metadataMask); static Instruction createAddMetadataInstruction(BigInteger theMetadata, BigInteger metadataMask, int order); static String macStringFromBigInteger(BigInteger value); static final int ETHERTYPE_IPV4; static final int ETHERTYPE_VLAN; static final int ETHERTYPE_IPV6; static final int ETHERTYPE_MPLS_UCAST; static final int ETHERTYPE_MPLS_MCAST; static final int ETHERTYPE_ARP; static final int ETHERTYPE_NSH; static final short IP_PROTOCOL_ICMP; static final short IP_PROTOCOL_TCP; static final short IP_PROTOCOL_UDP; static final short IP_PROTOCOL_SCTP; static final int PKT_LENGTH_IP_HEADER; static final int TCP_FLAG_SYN; static final int ARP_REQUEST; static final int ARP_REPLY; }
@Test @Parameters(method = "createActionVlanParams") public void testCreateActionPushVlan(int order) { org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action testActList = createActionPushVlan(order); Action testAct = testActList.getAction(); assertEquals("Wrong toString response", "PushVlanActionCase [_pushVlanAction=PushVlanAction [_ethernetType=33024, augmentation=[]], augmentation=[]]", testAct.toString()); assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase", testAct.getImplementedInterface().getName()); assertEquals("Wrong order", new Integer(order), testActList.getOrder()); }