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


Java OFFlowWildcards类代码示例

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


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

示例1: serializeAttributes

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void serializeAttributes(Map<Object, Object> attributes, JsonGenerator jGen)
           throws IOException, JsonProcessingException {
       if ( null == attributes)
           jGen.writeStringField("attributes","null");
       else{
           jGen.writeFieldName("attributes");
           jGen.writeStartObject();
           for (Map.Entry<Object, Object> entry : attributes.entrySet()) {
               if( entry.getValue() instanceof EnumSet<?>){
                   jGen.writeFieldName(entry.getKey().toString());
                   jGen.writeStartArray();
                   //Maybe need to check other type.
                   for(OFFlowWildcards  wildcard : (EnumSet<OFFlowWildcards>)entry.getValue()){
                       jGen.writeString(wildcard.toString());
                   }
                   jGen.writeEndArray();
               }
               else
                   jGen.writeStringField(entry.getKey().toString(),entry.getValue().toString());
           }
           jGen.writeEndObject();
       }
   }
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:IOFSwitchSerializer.java

示例2: OFSwitch

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager, 
		@Nonnull DatapathId datapathId) {
	if(connection == null)
		throw new NullPointerException("connection must not be null");
	if(!connection.getAuxId().equals(OFAuxId.MAIN))
		throw new IllegalArgumentException("connection must be the main connection");
	if(factory == null)
		throw new NullPointerException("factory must not be null");
	if(switchManager == null)
		throw new NullPointerException("switchManager must not be null");

	this.connected = true;
	this.factory = factory;
	this.switchManager = switchManager;
	this.datapathId = datapathId;
	this.attributes = new ConcurrentHashMap<Object, Object>();
	this.role = null;
	this.description = new SwitchDescription();
	this.portManager = new PortManager();
	this.status = SwitchStatus.HANDSHAKE;

	// Connections
	this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
	this.connections.put(connection.getAuxId(), connection);

	// Switch's controller connection
	this.controllerConnections = ImmutableMap.of();

	// Defaults properties for an ideal switch
	this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
	this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
	this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);

	this.tableFeaturesByTableId = new HashMap<TableId, TableFeatures>();
	this.tables = new ArrayList<TableId>();
	
	this.securityKernel = switchManager.getSecurityKernelService();

}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:40,代码来源:OFSwitch.java

示例3: OFSwitch

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
		@Nonnull DatapathId datapathId) {
	if(connection == null)
		throw new NullPointerException("connection must not be null");
	if(!connection.getAuxId().equals(OFAuxId.MAIN))
		throw new IllegalArgumentException("connection must be the main connection");
	if(factory == null)
		throw new NullPointerException("factory must not be null");
	if(switchManager == null)
		throw new NullPointerException("switchManager must not be null");

	this.connected = true;
	this.factory = factory;
	this.switchManager = switchManager;
	this.datapathId = datapathId;
	this.attributes = new ConcurrentHashMap<Object, Object>();
	this.role = null;
	this.description = new SwitchDescription();
	this.portManager = new PortManager();
	this.status = SwitchStatus.HANDSHAKE;

	// Connections
	this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
	this.connections.put(connection.getAuxId(), connection);

	// Switch's controller connection
	this.controllerConnections = ImmutableMap.of();

	// Defaults properties for an ideal switch
	this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
	this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
	this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:34,代码来源:OFSwitch.java

示例4: OFSwitch

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
		@Nonnull DatapathId datapathId) {
	if(connection == null)
		throw new NullPointerException("connection must not be null");
	if(!connection.getAuxId().equals(OFAuxId.MAIN))
		throw new IllegalArgumentException("connection must be the main connection");
	if(factory == null)
		throw new NullPointerException("factory must not be null");
	if(switchManager == null)
		throw new NullPointerException("switchManager must not be null");

	this.connected = true;
	this.factory = factory;
	this.switchManager = switchManager;
	this.datapathId = datapathId;
	this.attributes = new ConcurrentHashMap<Object, Object>();
	this.role = null;
	this.description = new SwitchDescription();
	this.portManager = new PortManager();
	this.status = SwitchStatus.HANDSHAKE;

	// Connections
	this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
	this.connections.put(connection.getAuxId(), connection);

	// Switch's controller connection
	this.controllerConnections = ImmutableMap.of();

	// Defaults properties for an ideal switch
	this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
	this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
	this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);

	this.tableFeaturesByTableId = new HashMap<TableId, TableFeatures>();
	this.tables = new ArrayList<TableId>();
}
 
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:37,代码来源:OFSwitch.java

示例5: OFSwitch

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
		@Nonnull DatapathId datapathId) {
	if(connection == null)
		throw new NullPointerException("connection must not be null");
	if(!connection.getAuxId().equals(OFAuxId.MAIN))
		throw new IllegalArgumentException("connection must be the main connection");
	if(factory == null)
		throw new NullPointerException("factory must not be null");
	if(switchManager == null)
		throw new NullPointerException("switchManager must not be null");

	this.connected = true;
	this.factory = factory;
	this.switchManager = switchManager;
	this.datapathId = datapathId;
	this.attributes = new ConcurrentHashMap<Object, Object>();
	this.role = null;
	this.description = new SwitchDescription();
	this.portManager = new PortManager();
	this.status = SwitchStatus.HANDSHAKE;

	// Connections
	this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
	this.connections.put(connection.getAuxId(), connection);

	// Switch's controller connection
	this.controllerConnections = ImmutableMap.of();

	// Defaults properties for an ideal switch
	this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
	this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
	this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);

	this.tableFeaturesByTableId = new HashMap<TableId, TableFeatures>();
}
 
开发者ID:rizard,项目名称:fast-failover-demo,代码行数:36,代码来源:OFSwitch.java

示例6: OFSwitch

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
        @Nonnull DatapathId datapathId) {
    if(connection == null)
        throw new NullPointerException("connection must not be null");
    if(!connection.getAuxId().equals(OFAuxId.MAIN))
        throw new IllegalArgumentException("connection must be the main connection");
    if(factory == null)
        throw new NullPointerException("factory must not be null");
    if(switchManager == null)
        throw new NullPointerException("switchManager must not be null");

    this.connected = true;
    this.factory = factory;
    this.switchManager = switchManager;
    this.datapathId = datapathId;
    this.attributes = new ConcurrentHashMap<Object, Object>();
    this.role = null;
    this.description = new SwitchDescription();
    this.portManager = new PortManager();
    this.status = SwitchStatus.HANDSHAKE;

    // Connections
    this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
    this.connections.put(connection.getAuxId(), connection);

    // Switch's controller connection
    this.controllerConnections = ImmutableMap.of();

    // Defaults properties for an ideal switch
    this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
    this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
    this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);
}
 
开发者ID:pixuan,项目名称:floodlight,代码行数:34,代码来源:OFSwitch.java

示例7: readFrom

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static Set<OFFlowWildcards> readFrom(ChannelBuffer bb) throws OFParseError {
    try {
        return ofWireValue(bb.readInt());
    } catch (IllegalArgumentException e) {
        throw new OFParseError(e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:8,代码来源:OFFlowWildcardsSerializerVer10.java

示例8: ofWireValue

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static Set<OFFlowWildcards> ofWireValue(int val) {
    EnumSet<OFFlowWildcards> set = EnumSet.noneOf(OFFlowWildcards.class);

    if((val & IN_PORT_VAL) != 0)
        set.add(OFFlowWildcards.IN_PORT);
    if((val & DL_VLAN_VAL) != 0)
        set.add(OFFlowWildcards.DL_VLAN);
    if((val & DL_SRC_VAL) != 0)
        set.add(OFFlowWildcards.DL_SRC);
    if((val & DL_DST_VAL) != 0)
        set.add(OFFlowWildcards.DL_DST);
    if((val & DL_TYPE_VAL) != 0)
        set.add(OFFlowWildcards.DL_TYPE);
    if((val & NW_PROTO_VAL) != 0)
        set.add(OFFlowWildcards.NW_PROTO);
    if((val & TP_SRC_VAL) != 0)
        set.add(OFFlowWildcards.TP_SRC);
    if((val & TP_DST_VAL) != 0)
        set.add(OFFlowWildcards.TP_DST);
    if((val & NW_SRC_ALL_VAL) != 0)
        set.add(OFFlowWildcards.NW_SRC_ALL);
    if((val & NW_SRC_MASK_VAL) != 0)
        set.add(OFFlowWildcards.NW_SRC_MASK);
    if((val & NW_DST_ALL_VAL) != 0)
        set.add(OFFlowWildcards.NW_DST_ALL);
    if((val & NW_DST_MASK_VAL) != 0)
        set.add(OFFlowWildcards.NW_DST_MASK);
    if((val & DL_VLAN_PCP_VAL) != 0)
        set.add(OFFlowWildcards.DL_VLAN_PCP);
    if((val & NW_TOS_VAL) != 0)
        set.add(OFFlowWildcards.NW_TOS);
    if((val & ALL_VAL) != 0)
        set.add(OFFlowWildcards.ALL);
    return Collections.unmodifiableSet(set);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:36,代码来源:OFFlowWildcardsSerializerVer10.java

示例9: ofWireValue

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static Set<OFFlowWildcards> ofWireValue(int val) {
    EnumSet<OFFlowWildcards> set = EnumSet.noneOf(OFFlowWildcards.class);

    if((val & IN_PORT_VAL) != 0)
        set.add(OFFlowWildcards.IN_PORT);
    if((val & DL_VLAN_VAL) != 0)
        set.add(OFFlowWildcards.DL_VLAN);
    if((val & DL_TYPE_VAL) != 0)
        set.add(OFFlowWildcards.DL_TYPE);
    if((val & NW_PROTO_VAL) != 0)
        set.add(OFFlowWildcards.NW_PROTO);
    if((val & TP_SRC_VAL) != 0)
        set.add(OFFlowWildcards.TP_SRC);
    if((val & TP_DST_VAL) != 0)
        set.add(OFFlowWildcards.TP_DST);
    if((val & DL_VLAN_PCP_VAL) != 0)
        set.add(OFFlowWildcards.DL_VLAN_PCP);
    if((val & NW_TOS_VAL) != 0)
        set.add(OFFlowWildcards.NW_TOS);
    if((val & ALL_VAL) != 0)
        set.add(OFFlowWildcards.ALL);
    if((val & MPLS_LABEL_VAL) != 0)
        set.add(OFFlowWildcards.MPLS_LABEL);
    if((val & MPLS_TC_VAL) != 0)
        set.add(OFFlowWildcards.MPLS_TC);
    return Collections.unmodifiableSet(set);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:28,代码来源:OFFlowWildcardsSerializerVer11.java

示例10: readFrom

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static Set<OFFlowWildcards> readFrom(ByteBuf bb) throws OFParseError {
    try {
        return ofWireValue(bb.readInt());
    } catch (IllegalArgumentException e) {
        throw new OFParseError(e);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:8,代码来源:OFFlowWildcardsSerializerVer10.java

示例11: writeTo

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static void writeTo(ChannelBuffer bb, Set<OFFlowWildcards> set) {
    bb.writeInt(toWireValue(set));
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:4,代码来源:OFFlowWildcardsSerializerVer10.java

示例12: putTo

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static void putTo(Set<OFFlowWildcards> set, PrimitiveSink sink) {
    sink.putInt(toWireValue(set));
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:4,代码来源:OFFlowWildcardsSerializerVer10.java

示例13: toWireValue

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static int toWireValue(Set<OFFlowWildcards> set) {
    int wireValue = 0;

    for(OFFlowWildcards e: set) {
        switch(e) {
            case IN_PORT:
                wireValue |= IN_PORT_VAL;
                break;
            case DL_VLAN:
                wireValue |= DL_VLAN_VAL;
                break;
            case DL_SRC:
                wireValue |= DL_SRC_VAL;
                break;
            case DL_DST:
                wireValue |= DL_DST_VAL;
                break;
            case DL_TYPE:
                wireValue |= DL_TYPE_VAL;
                break;
            case NW_PROTO:
                wireValue |= NW_PROTO_VAL;
                break;
            case TP_SRC:
                wireValue |= TP_SRC_VAL;
                break;
            case TP_DST:
                wireValue |= TP_DST_VAL;
                break;
            case NW_SRC_ALL:
                wireValue |= NW_SRC_ALL_VAL;
                break;
            case NW_SRC_MASK:
                wireValue |= NW_SRC_MASK_VAL;
                break;
            case NW_DST_ALL:
                wireValue |= NW_DST_ALL_VAL;
                break;
            case NW_DST_MASK:
                wireValue |= NW_DST_MASK_VAL;
                break;
            case DL_VLAN_PCP:
                wireValue |= DL_VLAN_PCP_VAL;
                break;
            case NW_TOS:
                wireValue |= NW_TOS_VAL;
                break;
            case ALL:
                wireValue |= ALL_VAL;
                break;
            default:
                throw new IllegalArgumentException("Illegal enum value for type OFFlowWildcards in version 1.0: " + e);
        }
    }
    return wireValue;
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:57,代码来源:OFFlowWildcardsSerializerVer10.java

示例14: toWireValue

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static int toWireValue(Set<OFFlowWildcards> set) {
    int wireValue = 0;

    for(OFFlowWildcards e: set) {
        switch(e) {
            case IN_PORT:
                wireValue |= IN_PORT_VAL;
                break;
            case DL_VLAN:
                wireValue |= DL_VLAN_VAL;
                break;
            case DL_TYPE:
                wireValue |= DL_TYPE_VAL;
                break;
            case NW_PROTO:
                wireValue |= NW_PROTO_VAL;
                break;
            case TP_SRC:
                wireValue |= TP_SRC_VAL;
                break;
            case TP_DST:
                wireValue |= TP_DST_VAL;
                break;
            case DL_VLAN_PCP:
                wireValue |= DL_VLAN_PCP_VAL;
                break;
            case NW_TOS:
                wireValue |= NW_TOS_VAL;
                break;
            case ALL:
                wireValue |= ALL_VAL;
                break;
            case MPLS_LABEL:
                wireValue |= MPLS_LABEL_VAL;
                break;
            case MPLS_TC:
                wireValue |= MPLS_TC_VAL;
                break;
            default:
                throw new IllegalArgumentException("Illegal enum value for type OFFlowWildcards in version 1.1: " + e);
        }
    }
    return wireValue;
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:45,代码来源:OFFlowWildcardsSerializerVer11.java

示例15: writeTo

import org.projectfloodlight.openflow.protocol.OFFlowWildcards; //导入依赖的package包/类
public static void writeTo(ByteBuf bb, Set<OFFlowWildcards> set) {
    bb.writeInt(toWireValue(set));
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:4,代码来源:OFFlowWildcardsSerializerVer10.java


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