当前位置: 首页>>代码示例>>Java>>正文


Java Icmpv4MatchBuilder.setIcmpv4Code方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder.setIcmpv4Code方法的典型用法代码示例。如果您正苦于以下问题:Java Icmpv4MatchBuilder.setIcmpv4Code方法的具体用法?Java Icmpv4MatchBuilder.setIcmpv4Code怎么用?Java Icmpv4MatchBuilder.setIcmpv4Code使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder的用法示例。


在下文中一共展示了Icmpv4MatchBuilder.setIcmpv4Code方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder.setIcmpv4Code方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。