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