@Override public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) { /* * Parse out all the individual replies for each table. */ for (OFTableFeaturesStatsReply reply : replies) { /* * Add or update the features for a particular table. */ List<OFTableFeatures> tfs = reply.getEntries(); for (OFTableFeatures tf : tfs) { tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf)); log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName()); } } }
@Override public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) { /* * Parse out all the individual replies for each table. */ for (OFTableFeaturesStatsReply reply : replies) { /* * Add or update the features for a particular table. */ List<OFTableFeatures> tfs = reply.getEntries(); for (OFTableFeatures tf : tfs) { tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf)); tables.add(tf.getTableId()); log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName()); } } }
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>(); }
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>(); }
@Override public TableFeatures getTableFeatures(TableId table) { // TODO Auto-generated method stub return null; }
@Override public TableFeatures getTableFeatures(TableId table) { return tableFeaturesByTableId.get(table); }
/** * Get the features of a particular switch table. The features are cached from * the initial handshake, or, if applicable, from a more recent * OFTableFeaturesStatsRequest/Reply sent by a user module. * * @param table, The table of which to get features. * @return The table features or null if no features are known for the table requested. */ public TableFeatures getTableFeatures(TableId table);