• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IPv6类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.floodlightcontroller.packet.IPv6的典型用法代码示例。如果您正苦于以下问题:Java IPv6类的具体用法?Java IPv6怎么用?Java IPv6使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IPv6类属于net.floodlightcontroller.packet包,在下文中一共展示了IPv6类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext fmc) throws FloodlightModuleException {
	this.perClassIndices =
			new HashSet<EnumSet<DeviceField>>();
	addIndex(true, EnumSet.of(DeviceField.IPv4));
	addIndex(true, EnumSet.of(DeviceField.IPv6));

	this.deviceListeners = new ListenerDispatcher<String, IDeviceListener>();
	this.suppressAPs = Collections.newSetFromMap(
			new ConcurrentHashMap<SwitchPort, Boolean>());

	this.floodlightProvider =
			fmc.getServiceImpl(IFloodlightProviderService.class);
	this.storageSource =
			fmc.getServiceImpl(IStorageSourceService.class);
	this.topology =
			fmc.getServiceImpl(ITopologyService.class);
	this.restApi = fmc.getServiceImpl(IRestApiService.class);
	this.threadPool = fmc.getServiceImpl(IThreadPoolService.class);
	this.entityClassifier = fmc.getServiceImpl(IEntityClassifierService.class);
	this.debugCounters = fmc.getServiceImpl(IDebugCounterService.class);
	this.debugEventService = fmc.getServiceImpl(IDebugEventService.class);
	this.syncService = fmc.getServiceImpl(ISyncService.class);
	this.deviceSyncManager = new DeviceSyncManager();
	this.haListenerDelegate = new HAListenerDelegate();
	registerDeviceManagerDebugCounters();
	registerDeviceManagerDebugEvents();
	this.addListener(new DeviceDebugEventLogger());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:30,代码来源:DeviceManagerImpl.java


示例2: getSrcIPv6Addr

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
/**
 * Get sender IPv6 address from packet if the packet is ND
 * 
 * @param eth
 * @param dlAddr
 * @return
 */
private IPv6Address getSrcIPv6Addr(Ethernet eth) {
	if (eth.getPayload() instanceof IPv6) {
		IPv6 ipv6 = (IPv6) eth.getPayload();
		return ipv6.getSourceAddress();
	}
	return IPv6Address.NONE;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:15,代码来源:DeviceManagerImpl.java


示例3: getDestEntityFromPacket

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
/**
 * Get a (partial) entity for the destination from the packet.
 * @param eth
 * @return
 */
protected Entity getDestEntityFromPacket(Ethernet eth) {
	MacAddress dlAddr = eth.getDestinationMACAddress();
	VlanVid vlan = VlanVid.ofVlan(eth.getVlanID());
	IPv4Address ipv4Dst = IPv4Address.NONE;
	IPv6Address ipv6Dst = IPv6Address.NONE;

	// Ignore broadcast/multicast destination
	if (dlAddr.isBroadcast() || dlAddr.isMulticast())
		return null;
	// Ignore zero dest mac
	if (dlAddr.equals(MacAddress.of(0)))
		return null;

	if (eth.getPayload() instanceof IPv4) {
		IPv4 ipv4 = (IPv4) eth.getPayload();
		ipv4Dst = ipv4.getDestinationAddress();
	} else if (eth.getPayload() instanceof IPv6) {
		IPv6 ipv6 = (IPv6) eth.getPayload();
		ipv6Dst = ipv6.getDestinationAddress();
	}
	
	return new Entity(dlAddr,
			vlan,
			ipv4Dst,
			ipv6Dst,
			DatapathId.NONE,
			OFPort.ZERO,
			Entity.NO_DATE);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:35,代码来源:DeviceManagerImpl.java


示例4: notifyListeners

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
protected void notifyListeners(List<IDeviceListener> listeners, DeviceUpdate update) {
 if (listeners == null) {
	 return;
 }
 for (IDeviceListener listener : listeners) {
	 switch (update.change) {
	 case ADD:
		 listener.deviceAdded(update.device);
		 break;
	 case DELETE:
		 listener.deviceRemoved(update.device);
		 break;
	 case CHANGE:
		 for (DeviceField field : update.fieldsChanged) {
			 switch (field) {
			 case IPv4:
				 listener.deviceIPV4AddrChanged(update.device);
				 break;
			 case IPv6:
				 listener.deviceIPV6AddrChanged(update.device);
				 break;
			 case SWITCH:
			 case PORT:
				 listener.deviceMoved(update.device); // TODO why was this commented out?
				 break;
			 case VLAN:
				 listener.deviceVlanChanged(update.device);
				 break;
			 default:
				 logger.debug("Unknown device field changed {}",
						 update.fieldsChanged.toString());
				 break;
			 }
		 }
		 break;
	 }
 }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:39,代码来源:DeviceManagerImpl.java


示例5: allKeyFieldsPresent

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
/**
 * Check if the entity e has all the keyFields set. Returns false if not
 * @param e entity to check
 * @param keyFields the key fields to check e against
 * @return
 */
protected boolean allKeyFieldsPresent(Entity e, EnumSet<DeviceField> keyFields) {
 for (DeviceField f : keyFields) {
	 switch (f) {
	 case MAC:
		 // MAC address is always present
		 break;
	 case IPv4:
	 case IPv6:
		 if (e.ipv4Address.equals(IPv4Address.NONE) && e.ipv6Address.equals(IPv6Address.NONE)) {
			 return false; // mutually exclusive
		 }
		 break;
	 case SWITCH:
		 if (e.switchDPID.equals(DatapathId.NONE)) {
			 return false;
		 }
		 break;
	 case PORT:
		 if (e.switchPort.equals(OFPort.ZERO)) {
			 return false;
		 }
		 break;
	 case VLAN:
		 if (e.vlan == null) { /* VLAN is null for 'don't care' or 'unspecified'. It's VlanVid.ZERO for untagged. */
			 return false; 	   /* For key field of VLAN, the VLAN **MUST** be set to either ZERO or some value. */
		 }
		 break;
	 default:
		 // we should never get here. unless somebody extended
		 // DeviceFields
		 throw new IllegalStateException();
	 }
 }
 return true;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:42,代码来源:DeviceManagerImpl.java


示例6: getEntityKeys

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
private EnumSet<DeviceField> getEntityKeys(@Nonnull MacAddress macAddress,
	 VlanVid vlan, /* A null VLAN means 'don't care'; VlanVid.ZERO means 'untagged' */
	 @Nonnull IPv4Address ipv4Address,
	 @Nonnull IPv6Address ipv6Address,
	 @Nonnull DatapathId switchDPID,
	 @Nonnull OFPort switchPort) {
 EnumSet<DeviceField> keys = EnumSet.noneOf(DeviceField.class);
 if (!macAddress.equals(MacAddress.NONE)) keys.add(DeviceField.MAC);
 if (vlan != null) keys.add(DeviceField.VLAN); /* TODO verify fix. null means 'don't care' and will conduct full search; VlanVid.ZERO means 'untagged' and only uses untagged index */
 if (!ipv4Address.equals(IPv4Address.NONE)) keys.add(DeviceField.IPv4);
 if (!ipv6Address.equals(IPv6Address.NONE)) keys.add(DeviceField.IPv6);
 if (!switchDPID.equals(DatapathId.NONE)) keys.add(DeviceField.SWITCH);
 if (!switchPort.equals(OFPort.ZERO)) keys.add(DeviceField.PORT);
 return keys;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:16,代码来源:DeviceManagerImpl.java


示例7: getSrcIPv6Addr

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
/**
 * Get sender IPv6 address from packet if the packet is ND
 *
 * @param eth
 * @param dlAddr
 * @return
 */
private IPv6Address getSrcIPv6Addr(Ethernet eth) {
	if (eth.getPayload() instanceof IPv6) {
		IPv6 ipv6 = (IPv6) eth.getPayload();
		return ipv6.getSourceAddress();
	}
	return IPv6Address.NONE;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:15,代码来源:DeviceManagerImpl.java


示例8: getDestEntityFromPacket

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
/**
 * Get a (partial) entity for the destination from the packet.
 * @param eth
 * @return
 */
protected Entity getDestEntityFromPacket(Ethernet eth) {
	MacAddress dlAddr = eth.getDestinationMACAddress();
	VlanVid vlan = VlanVid.ofVlan(eth.getVlanID());
	IPv4Address ipv4Dst = IPv4Address.NONE;
	IPv6Address ipv6Dst = IPv6Address.NONE;

	// Ignore broadcast/multicast destination
	if (dlAddr.isBroadcast() || dlAddr.isMulticast())
		return null;
	// Ignore zero dest mac
	if (dlAddr.equals(MacAddress.of(0)))
		return null;

	if (eth.getPayload() instanceof IPv4) {
		IPv4 ipv4 = (IPv4) eth.getPayload();
		ipv4Dst = ipv4.getDestinationAddress();
	} else if (eth.getPayload() instanceof IPv6) {
		IPv6 ipv6 = (IPv6) eth.getPayload();
		ipv6Dst = ipv6.getDestinationAddress();
	}

	return new Entity(dlAddr,
			vlan,
			ipv4Dst,
			ipv6Dst,
			DatapathId.NONE,
			OFPort.ZERO,
			Entity.NO_DATE);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:35,代码来源:DeviceManagerImpl.java


示例9: createMatchFromPacket0

import net.floodlightcontroller.packet.IPv6; //导入依赖的package包/类
protected Match createMatchFromPacket0(IOFSwitch sw,IPv6Address _eid, IPv6Address _rloc,FloodlightContext cntx) {
	log.info("SXT_DBG: ******createMatchFromPacket0******");
	Match.Builder mb = sw.getOFFactory().buildMatch();
	IPv6Address src_eid = _eid;
	IPv6Address dst_rloc = _rloc;
	mb.setExact(MatchField.ETH_TYPE, EthType.IPv6)
	.setExact(MatchField.IPV6_SRC, src_eid)
	.setExact(MatchField.IPV6_DST, dst_rloc);
	return mb.build();
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:11,代码来源:MappingTableManager.java



注:本文中的net.floodlightcontroller.packet.IPv6类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CryptoCodec类代码示例发布时间:2022-05-23
下一篇:
Java AnalysisRegistry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap