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


Java OFMessage.getType方法代码示例

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


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

示例1: processDriverHandshakeMessage

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
    if (!startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeNotStarted();
    }
    if (driverHandshakeComplete.get()) {
        throw new SwitchDriverSubHandshakeCompleted(m);
    }

    log.debug("processDriverHandshakeMessage for sw {}", getStringId());

    switch (m.getType()) {
    case STATS_REPLY: // multipart message is reported as STAT
        processOFMultipartReply((OFStatsReply) m);
        break;
    default:
        log.warn("Received message {} during switch-driver " +
                "subhandshake " + "from switch {} ... " +
                "Ignoring message", m,
                getStringId());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:OFOpticalSwitch13.java

示例2: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	if (!this.enabled) {
		return Command.CONTINUE;
	}

	switch (msg.getType()) {
	case PACKET_IN:
		IRoutingDecision decision = null;
		if (cntx != null) {
			decision = IRoutingDecision.rtStore.get(cntx, IRoutingDecision.CONTEXT_DECISION);
			return this.processPacketInMessage(sw, (OFPacketIn) msg, decision, cntx);
		}
		break;
	default:
		break;
	}

	return Command.CONTINUE;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:21,代码来源:Firewall.java

示例3: write

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:OFConnection.java

示例4: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public net.floodlightcontroller.core.IListener.Command receive(
		IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	System.out.println("flow expired: "+sw.toString() + msg.toString());
	
	//OFFlowRemoved flowRemoved = (OFFlowRemoved) msg;
	
	if (!switchStates.containsKey(sw))
		switchStates.put(sw, new ObfuscationSwitchState(sw));
	
	if (msg.getType() == OFType.FLOW_REMOVED) {
		OFFlowRemoved flowRemoved = (OFFlowRemoved) msg;
		System.out.println("flow expired: "+sw.toString() + "dst: " + flowRemoved.getCookie());
		long dst = flowRemoved.getCookie().getValue();
		ObfuscationHeader oHeader = new ObfuscationHeader();
		Match match = flowRemoved.getMatch();
		
		switchStates.get(sw).removeDestinationID(dst);
	
	}
	
	return Command.CONTINUE;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:ObfuscationSwitchStateManager.java

示例5: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext context) {
    switch (msg.getType()) {
        case PACKET_IN:
            return handlePacketIn(sw, (OFPacketIn) msg, context);
        default:
            break;
    }
    return Command.CONTINUE;
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:11,代码来源:PathVerificationService.java

示例6: processWrittenOFMessage

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
void processWrittenOFMessage(OFMessage m) {
	switch(m.getType()) {
	case ROLE_REQUEST:
		processOFRoleRequest((OFRoleRequest) m);
		break;
	case EXPERIMENTER:
		if (m instanceof OFNiciraControllerRoleRequest) {
			processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
		}
		break;
	default:
		break;
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:15,代码来源:OFSwitchHandshakeHandler.java

示例7: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	switch (msg.getType()) {
	case PACKET_IN:
		ctrIncoming.increment();
		return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
	default:
		break;
	}

	return Command.CONTINUE;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:13,代码来源:TopologyManager.java

示例8: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	switch (msg.getType()) {
	case FLOW_REMOVED:
		return handleFlowRemoved(sw, (OFFlowRemoved) msg, cntx);
	default:
		return Command.CONTINUE;
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:10,代码来源:StaticFlowEntryPusher.java

示例9: sendMsg

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public final void sendMsg(OFMessage m) {
    OFMessage newMsg = m;

    if (m.getType() == OFType.STATS_REQUEST) {
        OFStatsRequest sr = (OFStatsRequest) m;
        log.debug("Rebuilding stats request type {}", sr.getStatsType());
        switch (sr.getStatsType()) {
            case FLOW:
                OFCalientFlowStatsRequest request = this.factory().buildCalientFlowStatsRequest()
                        .setCookie(((OFFlowStatsRequest) sr).getCookie())
                        .setCookieMask(((OFFlowStatsRequest) sr).getCookieMask())
                        .setMatch(this.factory().matchWildcardAll())
                        .setOutGroup(((OFFlowStatsRequest) sr).getOutGroup().getGroupNumber())
                        .setOutPort(OFPort.ANY)
                        .setTableId(TableId.ALL)
                        .setXid(sr.getXid())
                        .setFlags(sr.getFlags())
                        .build();
                newMsg = request;
                break;
            case PORT:
                // TODO
                break;
            default:
                break;
        }
    }

    super.sendMsg(newMsg);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:CalientFiberSwitchHandshaker.java

示例10: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	switch (msg.getType()) {
	case PACKET_IN:
		IRoutingDecision decision = null;
		if (cntx != null) {
			decision = RoutingDecision.rtStore.get(cntx, IRoutingDecision.CONTEXT_DECISION);
		}

		return this.processPacketInMessage(sw, (OFPacketIn) msg, decision, cntx);
	default:
		break;
	}
	return Command.CONTINUE;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:16,代码来源:ForwardingBase.java

示例11: handleOutgoingMessage

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void handleOutgoingMessage(Dpid dpid, List<OFMessage> msgs) {
    for (OFMessage msg : msgs) {
        if (msg.getType() == OFType.PACKET_OUT ||
                msg.getType() == OFType.FLOW_MOD ||
                msg.getType() == OFType.STATS_REQUEST) {
            aggregators.computeIfPresent(dpid, (k, v) -> {
                v.increment(msg);
                return v;
            });
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:OpenFlowControlMessageProvider.java

示例12: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
@LogMessageDoc(level="ERROR",
message="Got a FlowRemove message for a infinite " +
		"timeout flow: {flow} from switch {switch}",
		explanation="Flows with infinite timeouts should not expire. " +
				"The switch has expired the flow anyway.",
				recommendation=LogMessageDoc.REPORT_SWITCH_BUG)
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	switch (msg.getType()) {
	case FLOW_REMOVED:
		return handleFlowRemoved(sw, (OFFlowRemoved) msg, cntx);
	default:
		return Command.CONTINUE;
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:16,代码来源:StaticFlowEntryPusher.java

示例13: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg,
		FloodlightContext cntx) {
	switch (msg.getType()) {
	case PACKET_IN:
		cntIncoming.increment();
		return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
	default:
		break;
	}
	return Command.CONTINUE;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:13,代码来源:DeviceManagerImpl.java

示例14: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
	switch (msg.getType()) {
	case PACKET_IN:
		return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
	case FLOW_REMOVED:
		return this.processFlowRemovedMessage(sw, (OFFlowRemoved) msg);
	case ERROR:
		log.info("received an error {} from switch {}", msg, sw);
		return Command.CONTINUE;
	default:
		log.error("received an unexpected message {} from switch {}", msg, sw);
		return Command.CONTINUE;
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:16,代码来源:LearningSwitch.java

示例15: receive

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public net.floodlightcontroller.core.IListener.Command
        receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
    switch (msg.getType()) {
        case PACKET_IN:
            return processPacketIn(sw, (OFPacketIn)msg, cntx);
        default:
            break;
    }
    log.warn("Received unexpected message {}", msg);
    return Command.CONTINUE;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:13,代码来源:LoadBalancer.java


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