本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}