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


Java VlanVid.FULL_MASK属性代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.types.VlanVid.FULL_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java VlanVid.FULL_MASK属性的具体用法?Java VlanVid.FULL_MASK怎么用?Java VlanVid.FULL_MASK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.projectfloodlight.openflow.types.VlanVid的用法示例。


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

示例1: addToPortMap

/**
 * Adds a host to the MAC/VLAN->SwitchPort mapping
 * @param sw The switch to add the mapping to
 * @param mac The MAC address of the host to add
 * @param vlan The VLAN that the host is on
 * @param portVal The switchport that the host is on
 */
protected void addToPortMap(IOFSwitch sw, MacAddress mac, VlanVid vlan, OFPort portVal) {
	Map<MacVlanPair, OFPort> swMap = macVlanToSwitchPortMap.get(sw);

	if (vlan == VlanVid.FULL_MASK || vlan == null) {
		vlan = VlanVid.ofVlan(0);
	}

	if (swMap == null) {
		// May be accessed by REST API so we need to make it thread safe
		swMap = Collections.synchronizedMap(new LRULinkedHashMap<MacVlanPair, OFPort>(MAX_MACS_PER_SWITCH));
		macVlanToSwitchPortMap.put(sw, swMap);
	}
	swMap.put(new MacVlanPair(mac, vlan), portVal);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:21,代码来源:LearningSwitch.java

示例2: removeFromPortMap

/**
 * Removes a host from the MAC/VLAN->SwitchPort mapping
 * @param sw The switch to remove the mapping from
 * @param mac The MAC address of the host to remove
 * @param vlan The VLAN that the host is on
 */
protected void removeFromPortMap(IOFSwitch sw, MacAddress mac, VlanVid vlan) {
	if (vlan == VlanVid.FULL_MASK) {
		vlan = VlanVid.ofVlan(0);
	}

	Map<MacVlanPair, OFPort> swMap = macVlanToSwitchPortMap.get(sw);
	if (swMap != null) {
		swMap.remove(new MacVlanPair(mac, vlan));
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:16,代码来源:LearningSwitch.java

示例3: getFromPortMap

/**
 * Get the port that a MAC/VLAN pair is associated with
 * @param sw The switch to get the mapping from
 * @param mac The MAC address to get
 * @param vlan The VLAN number to get
 * @return The port the host is on
 */
public OFPort getFromPortMap(IOFSwitch sw, MacAddress mac, VlanVid vlan) {
	if (vlan == VlanVid.FULL_MASK || vlan == null) {
		vlan = VlanVid.ofVlan(0);
	}
	Map<MacVlanPair, OFPort> swMap = macVlanToSwitchPortMap.get(sw);
	if (swMap != null) {
		return swMap.get(new MacVlanPair(mac, vlan));
	}

	// if none found
	return null;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:LearningSwitch.java


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