當前位置: 首頁>>代碼示例>>Java>>正文


Java Icmpv4MatchBuilder類代碼示例

本文整理匯總了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder的典型用法代碼示例。如果您正苦於以下問題:Java Icmpv4MatchBuilder類的具體用法?Java Icmpv4MatchBuilder怎麽用?Java Icmpv4MatchBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Icmpv4MatchBuilder類屬於org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match包,在下文中一共展示了Icmpv4MatchBuilder類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createICMPv4Match

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Match ICMP code and type
 *
 * @param matchBuilder
 *            MatchBuilder Object
 * @param type
 *            short representing an ICMP type
 * @param code
 *            short representing an ICMP code
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createICMPv4Match(MatchBuilder matchBuilder, short type, short code) {

    // Build the IPv4 Match requied per OVS Syntax
    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol((short) 1);
    matchBuilder.setIpMatch(ipmatch.build());

    // Build the ICMPv4 Match
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();
    if (type != ALL_ICMP) {
        icmpv4match.setIcmpv4Type(type);
    }
    if (code != ALL_ICMP) {
        icmpv4match.setIcmpv4Code(code);
    }
    matchBuilder.setIcmpv4Match(icmpv4match.build());

    return matchBuilder;
}
 
開發者ID:opendaylight,項目名稱:faas,代碼行數:31,代碼來源:OfMatchUtils.java

示例2: createSetIcmpCodeInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Create Set ICMP Code Instruction
 *
 * @param ib   Map InstructionBuilder without any instructions
 * @param code short repesenting an ICMP code
 * @return ib Map InstructionBuilder with instructions
 */

public static InstructionBuilder createSetIcmpCodeInstruction(InstructionBuilder ib, short code) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();

    // Build the ICMPv4 Code Match
    icmpv4match.setIcmpv4Code(code);
    setFieldBuilder.setIcmpv4Match(icmpv4match.build());

    ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
開發者ID:opendaylight,項目名稱:faas,代碼行數:32,代碼來源:OfInstructionUtils.java

示例3: createSetIcmpTypeInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Create Set ICMP Code Instruction
 *
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSetIcmpTypeInstruction(InstructionBuilder ib, short type) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();

    // Build the ICMPv4 Code Match
    icmpv4match.setIcmpv4Code(type);
    setFieldBuilder.setIcmpv4Match(icmpv4match.build());

    ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
開發者ID:opendaylight,項目名稱:faas,代碼行數:30,代碼來源:OfInstructionUtils.java

示例4: createICMPv4Match

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Match ICMP code and type
 *
 * @param matchBuilder MatchBuilder Object without a match yet
 * @param type         short representing an ICMP type
 * @param code         short representing an ICMP code
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createICMPv4Match(MatchBuilder matchBuilder, short type, short code) {

    EthernetMatchBuilder eth = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(IPV4_LONG));
    eth.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(eth.build());

    // Build the IPv4 Match requied per OVS Syntax
    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol((short) 1);
    matchBuilder.setIpMatch(ipmatch.build());

    // Build the ICMPv4 Match
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();
    icmpv4match.setIcmpv4Type(type);
    icmpv4match.setIcmpv4Code(code);
    matchBuilder.setIcmpv4Match(icmpv4match.build());

    return matchBuilder;
}
 
開發者ID:sdnhub,項目名稱:SDNHub_Opendaylight_Tutorial,代碼行數:30,代碼來源:MatchUtils.java

示例5: createSetIcmpCodeInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Create Set ICMP Code Instruction
 *
 * @param ib   Map InstructionBuilder without any instructions
 * @param code short repesenting an ICMP code
 * @return ib Map InstructionBuilder with instructions
 */

public static InstructionBuilder createSetIcmpCodeInstruction(InstructionBuilder ib, short code) {

    List<Action> actionList = Lists.newArrayList();
    ActionBuilder ab = new ActionBuilder();
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();

    // Build the ICMPv4 Code Match
    icmpv4match.setIcmpv4Code(code);
    setFieldBuilder.setIcmpv4Match(icmpv4match.build());

    ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
開發者ID:sdnhub,項目名稱:SDNHub_Opendaylight_Tutorial,代碼行數:32,代碼來源:InstructionUtils.java

示例6: createSetIcmpTypeInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
/**
 * Create Set ICMP Code Instruction
 *
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSetIcmpTypeInstruction(InstructionBuilder ib, short type) {

    List<Action> actionList = Lists.newArrayList();
    ActionBuilder ab = new ActionBuilder();
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();

    // Build the ICMPv4 Code Match
    icmpv4match.setIcmpv4Code(type);
    setFieldBuilder.setIcmpv4Match(icmpv4match.build());

    ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 
開發者ID:sdnhub,項目名稱:SDNHub_Opendaylight_Tutorial,代碼行數:30,代碼來源:InstructionUtils.java

示例7: setIcmpTypeAction

import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder; //導入依賴的package包/類
public static Action setIcmpTypeAction(byte value) {
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    setFieldBuilder.setIcmpv4Match(new Icmpv4MatchBuilder().setIcmpv4Type((short) value).build());
    return new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build();
}
 
開發者ID:opendaylight,項目名稱:faas,代碼行數:6,代碼來源:OfActionUtils.java


注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。