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


Java OFActionOutput.setMaxLength方法代码示例

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


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

示例1: decode_output

import org.openflow.protocol.action.OFActionOutput; //导入方法依赖的package包/类
private static SubActionStruct decode_output(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n;
    
    n = Pattern.compile("output=(?:((?:0x)?\\d+)|(all)|(controller)|(local)|(ingress-port)|(normal)|(flood))").matcher(subaction);
    if (n.matches()) {
        OFActionOutput action = new OFActionOutput();
        action.setMaxLength(Short.MAX_VALUE);
        short port = OFPort.OFPP_NONE.getValue();
        if (n.group(1) != null) {
            try {
                port = get_short(n.group(1));
            }
            catch (NumberFormatException e) {
                log.debug("Invalid port in: '{}' (error ignored)", subaction);
                return null;
            }
        }
        else if (n.group(2) != null)
            port = OFPort.OFPP_ALL.getValue();
        else if (n.group(3) != null)
            port = OFPort.OFPP_CONTROLLER.getValue();
        else if (n.group(4) != null)
            port = OFPort.OFPP_LOCAL.getValue();
        else if (n.group(5) != null)
            port = OFPort.OFPP_IN_PORT.getValue();
        else if (n.group(6) != null)
            port = OFPort.OFPP_NORMAL.getValue();
        else if (n.group(7) != null)
            port = OFPort.OFPP_FLOOD.getValue();
        action.setPort(port);
        log.debug("action {}", action);
        
        sa = new SubActionStruct();
        sa.action = action;
        sa.len = OFActionOutput.MINIMUM_LENGTH;
    }
    else {
        log.error("Invalid subaction: '{}'", subaction);
        return null;
    }
    
    return sa;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:45,代码来源:LoadBalancer.java

示例2: decode_output

import org.openflow.protocol.action.OFActionOutput; //导入方法依赖的package包/类
@LogMessageDoc(level="ERROR",
        message="Invalid subaction: '{subaction}'",
        explanation="A static flow entry contained an invalid subaction",
        recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
private static SubActionStruct decode_output(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n;
    
    n = Pattern.compile("output=(?:((?:0x)?\\d+)|(all)|(controller)|(local)|(ingress-port)|(normal)|(flood))").matcher(subaction);
    if (n.matches()) {
        OFActionOutput action = new OFActionOutput();
        action.setMaxLength(Short.MAX_VALUE);
        short port = OFPort.OFPP_NONE.getValue();
        if (n.group(1) != null) {
            try {
                port = get_short(n.group(1));
            }
            catch (NumberFormatException e) {
                log.debug("Invalid port in: '{}' (error ignored)", subaction);
                return null;
            }
        }
        else if (n.group(2) != null)
            port = OFPort.OFPP_ALL.getValue();
        else if (n.group(3) != null)
            port = OFPort.OFPP_CONTROLLER.getValue();
        else if (n.group(4) != null)
            port = OFPort.OFPP_LOCAL.getValue();
        else if (n.group(5) != null)
            port = OFPort.OFPP_IN_PORT.getValue();
        else if (n.group(6) != null)
            port = OFPort.OFPP_NORMAL.getValue();
        else if (n.group(7) != null)
            port = OFPort.OFPP_FLOOD.getValue();
        action.setPort(port);
        log.debug("action {}", action);
        
        sa = new SubActionStruct();
        sa.action = action;
        sa.len = OFActionOutput.MINIMUM_LENGTH;
    }
    else {
        log.error("Invalid subaction: '{}'", subaction);
        return null;
    }
    
    return sa;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:49,代码来源:StaticFlowEntries.java

示例3: decode_output

import org.openflow.protocol.action.OFActionOutput; //导入方法依赖的package包/类
@LogMessageDoc(level="ERROR",
        message="Invalid subaction: '{subaction}'",
        explanation="A static flow entry contained an invalid subaction",
        recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
private static SubActionStruct decode_output(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n;
    
    n = Pattern.compile("output=(?:((?:0x)?\\d+)|(all)|(controller)|(local)|(ingress-port)|(normal)|(flood))").matcher(subaction);
    if (n.matches()) {
        OFActionOutput action = new OFActionOutput();
        action.setMaxLength((short) Short.MAX_VALUE);
        short port = OFPort.OFPP_NONE.getValue();
        if (n.group(1) != null) {
            try {
                port = get_short(n.group(1));
            }
            catch (NumberFormatException e) {
                log.debug("Invalid port in: '{}' (error ignored)", subaction);
                return null;
            }
        }
        else if (n.group(2) != null)
            port = OFPort.OFPP_ALL.getValue();
        else if (n.group(3) != null)
            port = OFPort.OFPP_CONTROLLER.getValue();
        else if (n.group(4) != null)
            port = OFPort.OFPP_LOCAL.getValue();
        else if (n.group(5) != null)
            port = OFPort.OFPP_IN_PORT.getValue();
        else if (n.group(6) != null)
            port = OFPort.OFPP_NORMAL.getValue();
        else if (n.group(7) != null)
            port = OFPort.OFPP_FLOOD.getValue();
        action.setPort(port);
        log.debug("action {}", action);
        
        sa = new SubActionStruct();
        sa.action = action;
        sa.len = OFActionOutput.MINIMUM_LENGTH;
    }
    else {
        log.error("Invalid subaction: '{}'", subaction);
        return null;
    }
    
    return sa;
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:49,代码来源:StaticFlowEntries.java

示例4: decode_output

import org.openflow.protocol.action.OFActionOutput; //导入方法依赖的package包/类
private static SubActionStruct decode_output(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n;
    
    n = Pattern.compile("output=(?:((?:0x)?\\d+)|(all)|(controller)|(local)|(ingress-port)|(normal)|(flood))").matcher(subaction);
    if (n.matches()) {
        OFActionOutput action = new OFActionOutput();
        action.setMaxLength((short) Short.MAX_VALUE);
        short port = OFPort.OFPP_NONE.getValue();
        if (n.group(1) != null) {
            try {
                port = get_short(n.group(1));
            }
            catch (NumberFormatException e) {
                log.debug("Invalid port in: '{}' (error ignored)", subaction);
                return null;
            }
        }
        else if (n.group(2) != null)
            port = OFPort.OFPP_ALL.getValue();
        else if (n.group(3) != null)
            port = OFPort.OFPP_CONTROLLER.getValue();
        else if (n.group(4) != null)
            port = OFPort.OFPP_LOCAL.getValue();
        else if (n.group(5) != null)
            port = OFPort.OFPP_IN_PORT.getValue();
        else if (n.group(6) != null)
            port = OFPort.OFPP_NORMAL.getValue();
        else if (n.group(7) != null)
            port = OFPort.OFPP_FLOOD.getValue();
        action.setPort(port);
        log.debug("action {}", action);
        
        sa = new SubActionStruct();
        sa.action = action;
        sa.len = OFActionOutput.MINIMUM_LENGTH;
    }
    else {
        log.error("Invalid subaction: '{}'", subaction);
        return null;
    }
    
    return sa;
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:45,代码来源:LoadBalancer.java


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