本文整理汇总了Java中net.floodlightcontroller.packet.Ethernet.hashCode方法的典型用法代码示例。如果您正苦于以下问题:Java Ethernet.hashCode方法的具体用法?Java Ethernet.hashCode怎么用?Java Ethernet.hashCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.packet.Ethernet
的用法示例。
在下文中一共展示了Ethernet.hashCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isInBroadcastCache
import net.floodlightcontroller.packet.Ethernet; //导入方法依赖的package包/类
protected boolean isInBroadcastCache(IOFSwitch sw, OFPacketIn pi,
FloodlightContext cntx) {
// Get the cluster id of the switch.
// Get the hash of the Ethernet packet.
if (sw == null) return true;
// If the feature is disabled, always return false;
if (!broadcastCacheFeature) return false;
Ethernet eth =
IFloodlightProviderService.bcStore.get(cntx,
IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
Long broadcastHash;
broadcastHash = topology.getL2DomainId(sw.getId()) * prime1 +
pi.getInPort() * prime2 + eth.hashCode();
if (broadcastCache.update(broadcastHash)) {
sw.updateBroadcastCache(broadcastHash, pi.getInPort());
return true;
} else {
return false;
}
}
示例2: isInSwitchBroadcastCache
import net.floodlightcontroller.packet.Ethernet; //导入方法依赖的package包/类
protected boolean isInSwitchBroadcastCache(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) {
if (sw == null) return true;
// If the feature is disabled, always return false;
if (!broadcastCacheFeature) return false;
// Get the hash of the Ethernet packet.
Ethernet eth =
IFloodlightProviderService.bcStore.get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
long hash = pi.getInPort() * prime2 + eth.hashCode();
// some FORWARD_OR_FLOOD packets are unicast with unknown destination mac
return sw.updateBroadcastCache(hash, pi.getInPort());
}