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


Java OFActionNetworkTypeOfService.setNetworkTypeOfService方法代码示例

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


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

示例1: decode_set_tos_bits

import org.openflow.protocol.action.OFActionNetworkTypeOfService; //导入方法依赖的package包/类
private static SubActionStruct decode_set_tos_bits(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n = Pattern.compile("set-tos-bits=((?:0x)?\\d+)").matcher(subaction); 

    if (n.matches()) {
        if (n.group(1) != null) {
            try {
                byte tosbits = get_byte(n.group(1));
                OFActionNetworkTypeOfService action = new OFActionNetworkTypeOfService();
                action.setNetworkTypeOfService(tosbits);
                log.debug("  action {}", action);
                
                sa = new SubActionStruct();
                sa.action = action;
                sa.len = OFActionNetworkTypeOfService.MINIMUM_LENGTH;
            }
            catch (NumberFormatException e) {
                log.debug("Invalid dst-port in: {} (error ignored)", subaction);
                return null;
            }
        }
    }
    else {
        log.debug("Invalid action: '{}'", subaction);
        return null;
    }

    return sa;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:30,代码来源:LoadBalancer.java

示例2: decode_set_tos_bits

import org.openflow.protocol.action.OFActionNetworkTypeOfService; //导入方法依赖的package包/类
private static SubActionStruct decode_set_tos_bits(String subaction, Logger log) {
    SubActionStruct sa = null;
    Matcher n = Pattern.compile("set-tos-bits=((?:0x)?\\d+)").matcher(subaction);

    if (n.matches()) {
        if (n.group(1) != null) {
            try {
                byte tosbits = get_byte(n.group(1));
                OFActionNetworkTypeOfService action = new OFActionNetworkTypeOfService();
                action.setNetworkTypeOfService(tosbits);
                log.debug("  action {}", action);

                sa = new SubActionStruct();
                sa.action = action;
                sa.len = OFActionNetworkTypeOfService.MINIMUM_LENGTH;
            }
            catch (NumberFormatException e) {
                log.debug("Invalid dst-port in: {} (error ignored)", subaction);
                return null;
            }
        }
    }
    else {
        log.debug("Invalid action: '{}'", subaction);
        return null;
    }

    return sa;
}
 
开发者ID:andi-bigswitch,项目名称:floodlight-oss,代码行数:30,代码来源:StaticFlowEntries.java


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