tom

Moving /of to /openflow

Showing 1000 changed files with 0 additions and 4808 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-of-api</artifactId>
<packaging>bundle</packaging>
<description>ONOS OpenFlow controller subsystem API</description>
<dependencies>
<dependency>
<groupId>org.projectfloodlight</groupId>
<artifactId>openflowj</artifactId>
<version>0.3.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>3.9.0.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<artifactSet>
<excludes>
<exclude>io.netty:netty</exclude>
<exclude>com.google.guava:guava</exclude>
<exclude>org.slf4j:slfj-api</exclude>
<exclude>ch.qos.logback:logback-core</exclude>
<exclude>ch.qos.logback:logback-classic</exclude>
<exclude>com.google.code.findbugs:annotations</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
org.onlab.onos.of.*,org.projectfloodlight.openflow.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
package org.onlab.onos.of.controller;
import static org.slf4j.LoggerFactory.getLogger;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicBoolean;
import org.onlab.packet.Ethernet;
import org.projectfloodlight.openflow.protocol.OFPacketIn;
import org.projectfloodlight.openflow.protocol.OFPacketOut;
import org.projectfloodlight.openflow.protocol.action.OFAction;
import org.projectfloodlight.openflow.protocol.action.OFActionOutput;
import org.projectfloodlight.openflow.protocol.match.MatchField;
import org.projectfloodlight.openflow.types.OFBufferId;
import org.projectfloodlight.openflow.types.OFPort;
import org.slf4j.Logger;
public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext {
private final Logger log = getLogger(getClass());
private final AtomicBoolean free = new AtomicBoolean(true);
private final AtomicBoolean isBuilt = new AtomicBoolean(false);
private final OpenFlowSwitch sw;
private final OFPacketIn pktin;
private OFPacketOut pktout = null;
private DefaultOpenFlowPacketContext(OpenFlowSwitch s, OFPacketIn pkt) {
this.sw = s;
this.pktin = pkt;
}
@Override
public void send() {
if (block() && isBuilt.get()) {
sw.sendMsg(pktout);
}
}
@Override
public void build(OFPort outPort) {
if (isBuilt.getAndSet(true)) {
return;
}
OFPacketOut.Builder builder = sw.factory().buildPacketOut();
OFAction act = buildOutput(outPort.getPortNumber());
pktout = builder.setXid(pktin.getXid())
.setInPort(pktin.getInPort())
.setBufferId(pktin.getBufferId())
.setActions(Collections.singletonList(act))
.build();
}
@Override
public void build(Ethernet ethFrame, OFPort outPort) {
if (isBuilt.getAndSet(true)) {
return;
}
OFPacketOut.Builder builder = sw.factory().buildPacketOut();
OFAction act = buildOutput(outPort.getPortNumber());
pktout = builder.setXid(pktin.getXid())
.setBufferId(OFBufferId.NO_BUFFER)
.setInPort(pktin.getInPort())
.setActions(Collections.singletonList(act))
.setData(ethFrame.serialize())
.build();
}
@Override
public Ethernet parsed() {
Ethernet eth = new Ethernet();
eth.deserialize(pktin.getData(), 0, pktin.getTotalLen());
return eth;
}
@Override
public Dpid dpid() {
return new Dpid(sw.getId());
}
public static OpenFlowPacketContext packetContextFromPacketIn(OpenFlowSwitch s,
OFPacketIn pkt) {
return new DefaultOpenFlowPacketContext(s, pkt);
}
@Override
public Integer inPort() {
try {
return pktin.getInPort().getPortNumber();
} catch (UnsupportedOperationException e) {
return pktin.getMatch().get(MatchField.IN_PORT).getPortNumber();
}
}
@Override
public byte[] unparsed() {
return pktin.getData().clone();
}
private OFActionOutput buildOutput(Integer port) {
OFActionOutput act = sw.factory().actions()
.buildOutput()
.setPort(OFPort.of(port))
.build();
return act;
}
@Override
public boolean block() {
return free.getAndSet(false);
}
@Override
public boolean isHandled() {
return !free.get();
}
}
package org.onlab.onos.of.controller;
import org.projectfloodlight.openflow.util.HexString;
import java.net.URI;
import java.net.URISyntaxException;
import static com.google.common.base.Preconditions.checkArgument;
import static org.onlab.util.Tools.fromHex;
import static org.onlab.util.Tools.toHex;
/**
* The class representing a network switch DPID.
* This class is immutable.
*/
public final class Dpid {
private static final String SCHEME = "of";
private static final long UNKNOWN = 0;
private final long value;
/**
* Default constructor.
*/
public Dpid() {
this.value = Dpid.UNKNOWN;
}
/**
* Constructor from a long value.
*
* @param value the value to use.
*/
public Dpid(long value) {
this.value = value;
}
/**
* Constructor from a string.
*
* @param value the value to use.
*/
public Dpid(String value) {
this.value = HexString.toLong(value);
}
/**
* Get the value of the DPID.
*
* @return the value of the DPID.
*/
public long value() {
return value;
}
/**
* Convert the DPID value to a ':' separated hexadecimal string.
*
* @return the DPID value as a ':' separated hexadecimal string.
*/
@Override
public String toString() {
return HexString.toHexString(this.value);
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Dpid)) {
return false;
}
Dpid otherDpid = (Dpid) other;
return value == otherDpid.value;
}
@Override
public int hashCode() {
int hash = 17;
hash += 31 * hash + (int) (value ^ value >>> 32);
return hash;
}
/**
* Returns DPID created from the given device URI.
*
* @param uri device URI
* @return dpid
*/
public static Dpid dpid(URI uri) {
checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme");
return new Dpid(fromHex(uri.getSchemeSpecificPart()));
}
/**
* Produces device URI from the given DPID.
*
* @param dpid device dpid
* @return device URI
*/
public static URI uri(Dpid dpid) {
return uri(dpid.value);
}
/**
* Produces device URI from the given DPID long.
*
* @param value device dpid as long
* @return device URI
*/
public static URI uri(long value) {
try {
return new URI(SCHEME, toHex(value), null);
} catch (URISyntaxException e) {
return null;
}
}
}
package org.onlab.onos.of.controller;
import org.projectfloodlight.openflow.protocol.OFMessage;
/**
* Abstraction of an OpenFlow controller. Serves as a one stop
* shop for obtaining OpenFlow devices and (un)register listeners
* on OpenFlow events
*/
public interface OpenFlowController {
/**
* Returns all switches known to this OF controller.
* @return Iterable of dpid elements
*/
public Iterable<OpenFlowSwitch> getSwitches();
/**
* Returns all master switches known to this OF controller.
* @return Iterable of dpid elements
*/
public Iterable<OpenFlowSwitch> getMasterSwitches();
/**
* Returns all equal switches known to this OF controller.
* @return Iterable of dpid elements
*/
public Iterable<OpenFlowSwitch> getEqualSwitches();
/**
* Returns the actual switch for the given Dpid.
* @param dpid the switch to fetch
* @return the interface to this switch
*/
public OpenFlowSwitch getSwitch(Dpid dpid);
/**
* Returns the actual master switch for the given Dpid, if one exists.
* @param dpid the switch to fetch
* @return the interface to this switch
*/
public OpenFlowSwitch getMasterSwitch(Dpid dpid);
/**
* Returns the actual equal switch for the given Dpid, if one exists.
* @param dpid the switch to fetch
* @return the interface to this switch
*/
public OpenFlowSwitch getEqualSwitch(Dpid dpid);
/**
* Register a listener for meta events that occur to OF
* devices.
* @param listener the listener to notify
*/
public void addListener(OpenFlowSwitchListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
public void removeListener(OpenFlowSwitchListener listener);
/**
* Register a listener for packet events.
* @param priority the importance of this listener, lower values are more important
* @param listener the listener to notify
*/
public void addPacketListener(int priority, PacketListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
public void removePacketListener(PacketListener listener);
/**
* Send a message to a particular switch.
* @param dpid the switch to send to.
* @param msg the message to send
*/
public void write(Dpid dpid, OFMessage msg);
/**
* Process a message and notify the appropriate listeners.
*
* @param dpid the dpid the message arrived on
* @param msg the message to process.
*/
public void processPacket(Dpid dpid, OFMessage msg);
/**
* Sets the role for a given switch.
* @param role the desired role
* @param dpid the switch to set the role for.
*/
public void setRole(Dpid dpid, RoleState role);
}
package org.onlab.onos.of.controller;
import org.onlab.packet.Ethernet;
import org.projectfloodlight.openflow.types.OFPort;
/**
* A representation of a packet context which allows any provider
* to view the packet in event but may block the response to the
* event if blocked has been called.
*/
public interface OpenFlowPacketContext {
//TODO: may want to support sending packet out other switches than
// the one it came in on.
/**
* Blocks further responses (ie. send() calls) on this
* packet in event.
*/
public boolean block();
/**
* Checks whether the packet has been handled.
* @return true if handled, false otherwise.
*/
public boolean isHandled();
/**
* Provided build has been called send the packet
* out the switch it came in on.
*/
public void send();
/**
* Build the packet out in response to this packet in event.
* @param outPort the out port to send to packet out of.
*/
public void build(OFPort outPort);
/**
* Build the packet out in response to this packet in event.
* @param ethFrame the actual packet to send out.
* @param outPort the out port to send to packet out of.
*/
public void build(Ethernet ethFrame, OFPort outPort);
/**
* Provided a handle onto the parsed payload.
* @return the parsed form of the payload.
*/
public Ethernet parsed();
/**
* Provide an unparsed copy of the data.
* @return the unparsed form of the payload.
*/
public byte[] unparsed();
/**
* Provide the dpid of the switch where the packet in arrived.
* @return the dpid of the switch.
*/
public Dpid dpid();
/**
* Provide the port on which the packet arrived.
* @return the port
*/
public Integer inPort();
}
package org.onlab.onos.of.controller;
import java.util.List;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
/**
* Represents to provider facing side of a switch.
*/
public interface OpenFlowSwitch {
/**
* Writes the message to the driver.
*
* @param msg the message to write
*/
public void sendMsg(OFMessage msg);
/**
* Writes to the OFMessage list to the driver.
*
* @param msgs the messages to be written
*/
public void sendMsg(List<OFMessage> msgs);
/**
* Handle a message from the switch.
* @param fromSwitch the message to handle
*/
public void handleMessage(OFMessage fromSwitch);
/**
* Sets the role for this switch.
* @param role the role to set.
*/
public void setRole(RoleState role);
/**
* Fetch the role for this switch.
* @return the role.
*/
public RoleState getRole();
/**
* Fetches the ports of this switch.
* @return unmodifiable list of the ports.
*/
public List<OFPortDesc> getPorts();
/**
* Provides the factory for this OF version.
* @return OF version specific factory.
*/
public OFFactory factory();
/**
* Gets a string version of the ID for this switch.
*
* @return string version of the ID
*/
public String getStringId();
/**
* Gets the datapathId of the switch.
*
* @return the switch dpid in long format
*/
public long getId();
/**
* fetch the manufacturer description.
* @return the description
*/
public String manfacturerDescription();
/**
* fetch the datapath description.
* @return the description
*/
public String datapathDescription();
/**
* fetch the hardware description.
* @return the description
*/
public String hardwareDescription();
/**
* fetch the software description.
* @return the description
*/
public String softwareDescription();
/**
* fetch the serial number.
* @return the serial
*/
public String serialNumber();
/**
* Disconnects the switch by closing the TCP connection. Results in a call
* to the channel handler's channelDisconnected method for cleanup
*/
public void disconnectSwitch();
}
package org.onlab.onos.of.controller;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
/**
* Allows for providers interested in Switch events to be notified.
*/
public interface OpenFlowSwitchListener {
/**
* Notify that the switch was added.
* @param dpid the switch where the event occurred
*/
public void switchAdded(Dpid dpid);
/**
* Notify that the switch was removed.
* @param dpid the switch where the event occurred.
*/
public void switchRemoved(Dpid dpid);
/**
* Notify that a port has changed.
* @param dpid the switch on which the change happened.
* @param status the new state of the port.
*/
public void portChanged(Dpid dpid, OFPortStatus status);
}
package org.onlab.onos.of.controller;
/**
* Notifies providers about Packet in events.
*/
public interface PacketListener {
/**
* Handles the packet.
*
* @param pktCtx the packet context
*/
public void handlePacket(OpenFlowPacketContext pktCtx);
}
package org.onlab.onos.of.controller;
import org.projectfloodlight.openflow.protocol.OFControllerRole;
/**
* The role of the controller as it pertains to a particular switch.
* Note that this definition of the role enum is different from the
* OF1.3 definition. It is maintained here to be backward compatible to
* earlier versions of the controller code. This enum is translated
* to the OF1.3 enum, before role messages are sent to the switch.
* See sendRoleRequestMessage method in OFSwitchImpl
*/
public enum RoleState {
EQUAL(OFControllerRole.ROLE_EQUAL),
MASTER(OFControllerRole.ROLE_MASTER),
SLAVE(OFControllerRole.ROLE_SLAVE);
private RoleState(OFControllerRole nxRole) {
nxRole.ordinal();
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.driver;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.netty.channel.Channel;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.RoleState;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
import org.projectfloodlight.openflow.protocol.OFExperimenter;
import org.projectfloodlight.openflow.protocol.OFFactories;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFRoleReply;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An abstract representation of an OpenFlow switch. Can be extended by others
* to serve as a base for their vendor specific representation of a switch.
*/
public abstract class AbstractOpenFlowSwitch implements OpenFlowSwitchDriver {
private static Logger log =
LoggerFactory.getLogger(AbstractOpenFlowSwitch.class);
protected Channel channel;
private boolean connected;
protected boolean startDriverHandshakeCalled = false;
private final Dpid dpid;
private OpenFlowAgent agent;
private final AtomicInteger xidCounter = new AtomicInteger(0);
private OFVersion ofVersion;
protected OFPortDescStatsReply ports;
protected boolean tableFull;
private RoleHandler roleMan;
protected RoleState role;
protected OFFeaturesReply features;
protected OFDescStatsReply desc;
/**
* Given a dpid build this switch.
* @param dp the dpid
*/
protected AbstractOpenFlowSwitch(Dpid dp) {
this.dpid = dp;
}
public AbstractOpenFlowSwitch(Dpid dpid, OFDescStatsReply desc) {
this.dpid = dpid;
this.desc = desc;
}
//************************
// Channel related
//************************
@Override
public final void disconnectSwitch() {
this.channel.close();
}
@Override
public final void sendMsg(OFMessage m) {
this.write(m);
}
@Override
public final void sendMsg(List<OFMessage> msgs) {
this.write(msgs);
}
@Override
public abstract void write(OFMessage msg);
@Override
public abstract void write(List<OFMessage> msgs);
@Override
public final boolean isConnected() {
return this.connected;
}
@Override
public final void setConnected(boolean connected) {
this.connected = connected;
};
@Override
public final void setChannel(Channel channel) {
this.channel = channel;
};
//************************
// Switch features related
//************************
@Override
public final long getId() {
return this.dpid.value();
};
@Override
public final String getStringId() {
return this.dpid.toString();
}
@Override
public final void setOFVersion(OFVersion ofV) {
this.ofVersion = ofV;
}
@Override
public void setTableFull(boolean full) {
this.tableFull = full;
}
@Override
public void setFeaturesReply(OFFeaturesReply featuresReply) {
this.features = featuresReply;
}
@Override
public abstract Boolean supportNxRole();
//************************
// Message handling
//************************
/**
* Handle the message coming from the dataplane.
*
* @param m the actual message
*/
@Override
public final void handleMessage(OFMessage m) {
this.agent.processMessage(dpid, m);
}
@Override
public RoleState getRole() {
return role;
};
@Override
public final boolean connectSwitch() {
return this.agent.addConnectedSwitch(dpid, this);
}
@Override
public final boolean activateMasterSwitch() {
return this.agent.addActivatedMasterSwitch(dpid, this);
}
@Override
public final boolean activateEqualSwitch() {
return this.agent.addActivatedEqualSwitch(dpid, this);
}
@Override
public final void transitionToEqualSwitch() {
this.agent.transitionToEqualSwitch(dpid);
}
@Override
public final void transitionToMasterSwitch() {
this.agent.transitionToMasterSwitch(dpid);
}
@Override
public final void removeConnectedSwitch() {
this.agent.removeConnectedSwitch(dpid);
}
@Override
public OFFactory factory() {
return OFFactories.getFactory(ofVersion);
}
@Override
public void setPortDescReply(OFPortDescStatsReply portDescReply) {
this.ports = portDescReply;
}
@Override
public abstract void startDriverHandshake();
@Override
public abstract boolean isDriverHandshakeComplete();
@Override
public abstract void processDriverHandshakeMessage(OFMessage m);
@Override
public void setRole(RoleState role) {
try {
log.info("Sending role {} to switch {}", role, getStringId());
if (this.roleMan.sendRoleRequest(role, RoleRecvStatus.MATCHED_SET_ROLE)) {
this.role = role;
}
} catch (IOException e) {
log.error("Unable to write to switch {}.", this.dpid);
}
}
// Role Handling
@Override
public void handleRole(OFMessage m) throws SwitchStateException {
RoleReplyInfo rri = roleMan.extractOFRoleReply((OFRoleReply) m);
RoleRecvStatus rrs = roleMan.deliverRoleReply(rri);
if (rrs == RoleRecvStatus.MATCHED_SET_ROLE) {
if (rri.getRole() == RoleState.MASTER) {
this.transitionToMasterSwitch();
} else if (rri.getRole() == RoleState.EQUAL ||
rri.getRole() == RoleState.MASTER) {
this.transitionToEqualSwitch();
}
}
}
@Override
public void handleNiciraRole(OFMessage m) throws SwitchStateException {
RoleState r = this.roleMan.extractNiciraRoleReply((OFExperimenter) m);
if (r == null) {
// The message wasn't really a Nicira role reply. We just
// dispatch it to the OFMessage listeners in this case.
this.handleMessage(m);
}
RoleRecvStatus rrs = this.roleMan.deliverRoleReply(
new RoleReplyInfo(r, null, m.getXid()));
if (rrs == RoleRecvStatus.MATCHED_SET_ROLE) {
if (r == RoleState.MASTER) {
this.transitionToMasterSwitch();
} else if (r == RoleState.EQUAL ||
r == RoleState.SLAVE) {
this.transitionToEqualSwitch();
}
}
}
@Override
public boolean handleRoleError(OFErrorMsg error) {
try {
return RoleRecvStatus.OTHER_EXPECTATION != this.roleMan.deliverError(error);
} catch (SwitchStateException e) {
this.disconnectSwitch();
}
return true;
}
@Override
public void reassertRole() {
if (this.getRole() == RoleState.MASTER) {
this.setRole(RoleState.MASTER);
}
}
@Override
public final void setAgent(OpenFlowAgent ag) {
if (this.agent == null) {
this.agent = ag;
}
}
@Override
public final void setRoleHandler(RoleHandler roleHandler) {
if (this.roleMan == null) {
this.roleMan = roleHandler;
}
}
@Override
public void setSwitchDescription(OFDescStatsReply d) {
this.desc = d;
}
@Override
public int getNextTransactionId() {
return this.xidCounter.getAndIncrement();
}
@Override
public List<OFPortDesc> getPorts() {
return Collections.unmodifiableList(ports.getEntries());
}
@Override
public String manfacturerDescription() {
return this.desc.getMfrDesc();
}
@Override
public String datapathDescription() {
return this.desc.getDpDesc();
}
@Override
public String hardwareDescription() {
return this.desc.getHwDesc();
}
@Override
public String softwareDescription() {
return this.desc.getSwDesc();
}
@Override
public String serialNumber() {
return this.desc.getSerialNum();
}
}
package org.onlab.onos.of.controller.driver;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.OpenFlowSwitch;
import org.projectfloodlight.openflow.protocol.OFMessage;
/**
* Responsible for keeping track of the current set of switches
* connected to the system. As well as whether they are in Master
* role or not.
*
*/
public interface OpenFlowAgent {
/**
* Add a switch that has just connected to the system.
* @param dpid the dpid to add
* @param sw the actual switch object.
* @return true if added, false otherwise.
*/
public boolean addConnectedSwitch(Dpid dpid, OpenFlowSwitch sw);
/**
* Checks if the activation for this switch is valid.
* @param dpid the dpid to check
* @return true if valid, false otherwise
*/
public boolean validActivation(Dpid dpid);
/**
* Called when a switch is activated, with this controller's role as MASTER.
* @param dpid the dpid to add.
* @param sw the actual switch
* @return true if added, false otherwise.
*/
public boolean addActivatedMasterSwitch(Dpid dpid, OpenFlowSwitch sw);
/**
* Called when a switch is activated, with this controller's role as EQUAL.
* @param dpid the dpid to add.
* @param sw the actual switch
* @return true if added, false otherwise.
*/
public boolean addActivatedEqualSwitch(Dpid dpid, OpenFlowSwitch sw);
/**
* Called when this controller's role for a switch transitions from equal
* to master. For 1.0 switches, we internally refer to the role 'slave' as
* 'equal' - so this transition is equivalent to 'addActivatedMasterSwitch'.
* @param dpid the dpid to transistion.
*/
public void transitionToMasterSwitch(Dpid dpid);
/**
* Called when this controller's role for a switch transitions to equal.
* For 1.0 switches, we internally refer to the role 'slave' as
* 'equal'.
* @param dpid the dpid to transistion.
*/
public void transitionToEqualSwitch(Dpid dpid);
/**
* Clear all state in controller switch maps for a switch that has
* disconnected from the local controller. Also release control for
* that switch from the global repository. Notify switch listeners.
* @param dpid the dpid to remove.
*/
public void removeConnectedSwitch(Dpid dpid);
/**
* Process a message coming from a switch.
*
* @param dpid the dpid the message came on.
* @param m the message to process
*/
public void processMessage(Dpid dpid, OFMessage m);
}
package org.onlab.onos.of.controller.driver;
import java.util.List;
import org.jboss.netty.channel.Channel;
import org.onlab.onos.of.controller.OpenFlowSwitch;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFVersion;
/**
* Represents the driver side of an OpenFlow switch.
* This interface should never be exposed to consumers.
*
*/
public interface OpenFlowSwitchDriver extends OpenFlowSwitch {
/**
* Sets the OpenFlow agent to be used. This method
* can only be called once.
* @param agent the agent to set.
*/
public void setAgent(OpenFlowAgent agent);
/**
* Sets the Role handler object.
* This method can only be called once.
* @param roleHandler the roleHandler class
*/
public void setRoleHandler(RoleHandler roleHandler);
/**
* Reasserts this controllers role to the switch.
* Useful in cases where the switch no longer agrees
* that this controller has the role it claims.
*/
public void reassertRole();
/**
* Handle the situation where the role request triggers an error.
* @param error the error to handle.
* @return true if handled, false if not.
*/
public boolean handleRoleError(OFErrorMsg error);
/**
* If this driver know of Nicira style role messages, these should
* be handled here.
* @param m the role message to handle.
* @throws SwitchStateException if the message received was
* not a nicira role or was malformed.
*/
public void handleNiciraRole(OFMessage m) throws SwitchStateException;
/**
* Handle OF 1.x (where x > 0) role messages.
* @param m the role message to handle
* @throws SwitchStateException if the message received was
* not a nicira role or was malformed.
*/
public void handleRole(OFMessage m) throws SwitchStateException;
/**
* Starts the driver specific handshake process.
*/
public void startDriverHandshake();
/**
* Checks whether the driver specific handshake is complete.
* @return true is finished, false if not.
*/
public boolean isDriverHandshakeComplete();
/**
* Process a message during the driver specific handshake.
* @param m the message to process.
*/
public void processDriverHandshakeMessage(OFMessage m);
/**
* Announce to the OpenFlow agent that this switch has connected.
* @return true if successful, false if duplicate switch.
*/
public boolean connectSwitch();
/**
* Activate this MASTER switch-controller relationship in the OF agent.
* @return true is successful, false is switch has not
* connected or is unknown to the system.
*/
public boolean activateMasterSwitch();
/**
* Activate this EQUAL switch-controller relationship in the OF agent.
* @return true is successful, false is switch has not
* connected or is unknown to the system.
*/
public boolean activateEqualSwitch();
/**
* Transition this switch-controller relationship to an EQUAL state.
*/
public void transitionToEqualSwitch();
/**
* Transition this switch-controller relationship to an Master state.
*/
public void transitionToMasterSwitch();
/**
* Remove this switch from the openflow agent.
*/
public void removeConnectedSwitch();
/**
* Sets the ports on this switch.
* @param portDescReply the port set and descriptions
*/
public void setPortDescReply(OFPortDescStatsReply portDescReply);
/**
* Sets the features reply for this switch.
* @param featuresReply the features to set.
*/
public void setFeaturesReply(OFFeaturesReply featuresReply);
/**
* Sets the switch description.
* @param desc the descriptions
*/
public void setSwitchDescription(OFDescStatsReply desc);
/**
* Gets the next transaction id to use.
* @return the xid
*/
public int getNextTransactionId();
/**
* Does this switch support Nicira Role messages.
* @return true if supports, false otherwise.
*/
public Boolean supportNxRole();
/**
* Sets the OF version for this switch.
* @param ofV the version to set.
*/
public void setOFVersion(OFVersion ofV);
/**
* Sets this switch has having a full flowtable.
* @param full true if full, false otherswise.
*/
public void setTableFull(boolean full);
/**
* Sets the associated Netty channel for this switch.
* @param channel the Netty channel
*/
public void setChannel(Channel channel);
/**
* Sets whether the switch is connected.
*
* @param connected whether the switch is connected
*/
public void setConnected(boolean connected);
/**
* Checks if the switch is still connected.
*
* @return whether the switch is still connected
*/
public boolean isConnected();
/**
* Writes the message to the output stream
* in a driver specific manner.
*
* @param msg the message to write
*/
public void write(OFMessage msg);
/**
* Writes to the OFMessage list to the output stream
* in a driver specific manner.
*
* @param msgs the messages to be written
*/
public void write(List<OFMessage> msgs);
}
package org.onlab.onos.of.controller.driver;
import org.onlab.onos.of.controller.Dpid;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFVersion;
/**
* Switch factory which returns concrete switch objects for the
* physical openflow switch in use.
*
*/
public interface OpenFlowSwitchDriverFactory {
/**
* Constructs the real openflow switch representation.
* @param dpid the dpid for this switch.
* @param desc its description.
* @param ofv the OF version in use
* @return the openflow switch representation.
*/
public OpenFlowSwitchDriver getOFSwitchImpl(Dpid dpid,
OFDescStatsReply desc, OFVersion ofv);
}
package org.onlab.onos.of.controller.driver;
import java.io.IOException;
import org.onlab.onos.of.controller.RoleState;
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
import org.projectfloodlight.openflow.protocol.OFExperimenter;
import org.projectfloodlight.openflow.protocol.OFRoleReply;
/**
* Role handling.
*
*/
public interface RoleHandler {
/**
* Extract the role from an OFVendor message.
*
* Extract the role from an OFVendor message if the message is a
* Nicira role reply. Otherwise return null.
*
* @param experimenterMsg The vendor message to parse.
* @return The role in the message if the message is a Nicira role
* reply, null otherwise.
* @throws SwitchStateException If the message is a Nicira role reply
* but the numeric role value is unknown.
*/
public RoleState extractNiciraRoleReply(OFExperimenter experimenterMsg)
throws SwitchStateException;
/**
* Send a role request with the given role to the switch and update
* the pending request and timestamp.
* Sends an OFPT_ROLE_REQUEST to an OF1.3 switch, OR
* Sends an NX_ROLE_REQUEST to an OF1.0 switch if configured to support it
* in the IOFSwitch driver. If not supported, this method sends nothing
* and returns 'false'. The caller should take appropriate action.
*
* One other optimization we do here is that for OF1.0 switches with
* Nicira role message support, we force the Role.EQUAL to become
* Role.SLAVE, as there is no defined behavior for the Nicira role OTHER.
* We cannot expect it to behave like SLAVE. We don't have this problem with
* OF1.3 switches, because Role.EQUAL is well defined and we can simulate
* SLAVE behavior by using ASYNC messages.
*
* @param role
* @throws IOException
* @return false if and only if the switch does not support role-request
* messages, according to the switch driver; true otherwise.
*/
public boolean sendRoleRequest(RoleState role, RoleRecvStatus exp)
throws IOException;
/**
* Extract the role information from an OF1.3 Role Reply Message.
* @param rrmsg role reply message
* @return RoleReplyInfo object
* @throws SwitchStateException
*/
public RoleReplyInfo extractOFRoleReply(OFRoleReply rrmsg)
throws SwitchStateException;
/**
* Deliver a received role reply.
*
* Check if a request is pending and if the received reply matches the
* the expected pending reply (we check both role and xid) we set
* the role for the switch/channel.
*
* If a request is pending but doesn't match the reply we ignore it, and
* return
*
* If no request is pending we disconnect with a SwitchStateException
*
* @param rri information about role-reply in format that
* controller can understand.
* @throws SwitchStateException if no request is pending
*/
public RoleRecvStatus deliverRoleReply(RoleReplyInfo rri)
throws SwitchStateException;
/**
* Called if we receive an error message. If the xid matches the
* pending request we handle it otherwise we ignore it.
*
* Note: since we only keep the last pending request we might get
* error messages for earlier role requests that we won't be able
* to handle
*/
public RoleRecvStatus deliverError(OFErrorMsg error)
throws SwitchStateException;
}
package org.onlab.onos.of.controller.driver;
/**
* When we remove a pending role request we use this enum to indicate how we
* arrived at the decision. When we send a role request to the switch, we
* also use this enum to indicate what we expect back from the switch, so the
* role changer can match the reply to our expectation.
*/
public enum RoleRecvStatus {
/** The switch returned an error indicating that roles are not.
* supported*/
UNSUPPORTED,
/** The request timed out. */
NO_REPLY,
/** The reply was old, there is a newer request pending. */
OLD_REPLY,
/**
* The reply's role matched the role that this controller set in the
* request message - invoked either initially at startup or to reassert
* current role.
*/
MATCHED_CURRENT_ROLE,
/**
* The reply's role matched the role that this controller set in the
* request message - this is the result of a callback from the
* global registry, followed by a role request sent to the switch.
*/
MATCHED_SET_ROLE,
/**
* The reply's role was a response to the query made by this controller.
*/
REPLY_QUERY,
/** We received a role reply message from the switch
* but the expectation was unclear, or there was no expectation.
*/
OTHER_EXPECTATION,
}
package org.onlab.onos.of.controller.driver;
import org.onlab.onos.of.controller.RoleState;
import org.projectfloodlight.openflow.types.U64;
/**
* Helper class returns role reply information in the format understood
* by the controller.
*/
public class RoleReplyInfo {
private final RoleState role;
private final U64 genId;
private final long xid;
public RoleReplyInfo(RoleState role, U64 genId, long xid) {
this.role = role;
this.genId = genId;
this.xid = xid;
}
public RoleState getRole() { return role; }
public U64 getGenId() { return genId; }
public long getXid() { return xid; }
@Override
public String toString() {
return "[Role:" + role + " GenId:" + genId + " Xid:" + xid + "]";
}
}
package org.onlab.onos.of.controller.driver;
/**
* Thrown when IOFSwitch.startDriverHandshake() is called more than once.
*
*/
public class SwitchDriverSubHandshakeAlreadyStarted extends
SwitchDriverSubHandshakeException {
private static final long serialVersionUID = -5491845708752443501L;
public SwitchDriverSubHandshakeAlreadyStarted() {
super();
}
}
package org.onlab.onos.of.controller.driver;
import org.projectfloodlight.openflow.protocol.OFMessage;
/**
* Indicates that a message was passed to a switch driver's subhandshake
* handling code but the driver has already completed the sub-handshake.
*
*/
public class SwitchDriverSubHandshakeCompleted
extends SwitchDriverSubHandshakeException {
private static final long serialVersionUID = -8817822245846375995L;
public SwitchDriverSubHandshakeCompleted(OFMessage m) {
super("Sub-Handshake is already complete but received message "
+ m.getType());
}
}
package org.onlab.onos.of.controller.driver;
/**
* Base class for exception thrown by switch driver sub-handshake processing.
*
*/
public class SwitchDriverSubHandshakeException extends RuntimeException {
private static final long serialVersionUID = -6257836781419604438L;
protected SwitchDriverSubHandshakeException() {
super();
}
protected SwitchDriverSubHandshakeException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
protected SwitchDriverSubHandshakeException(String arg0) {
super(arg0);
}
protected SwitchDriverSubHandshakeException(Throwable arg0) {
super(arg0);
}
}
package org.onlab.onos.of.controller.driver;
/**
* Thrown when a switch driver's sub-handshake has not been started but an
* operation requiring the sub-handshake has been attempted.
*
*/
public class SwitchDriverSubHandshakeNotStarted extends
SwitchDriverSubHandshakeException {
private static final long serialVersionUID = -5491845708752443501L;
public SwitchDriverSubHandshakeNotStarted() {
super();
}
}
package org.onlab.onos.of.controller.driver;
/**
* Thrown when a switch driver's sub-handshake state-machine receives an
* unexpected OFMessage and/or is in an invald state.
*
*/
public class SwitchDriverSubHandshakeStateException extends
SwitchDriverSubHandshakeException {
private static final long serialVersionUID = -8249926069195147051L;
public SwitchDriverSubHandshakeStateException(String msg) {
super(msg);
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.driver;
/**
* This exception indicates an error or unexpected message during
* message handling. E.g., if an OFMessage is received that is illegal or
* unexpected given the current handshake state.
*
* We don't allow wrapping other exception in a switch state exception. We
* only log the SwitchStateExceptions message so the causing exceptions
* stack trace is generally not available.
*
*/
public class SwitchStateException extends Exception {
private static final long serialVersionUID = 9153954512470002631L;
public SwitchStateException() {
super();
}
public SwitchStateException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
public SwitchStateException(String arg0) {
super(arg0);
}
public SwitchStateException(Throwable arg0) {
super(arg0);
}
}
/**
* OpenFlow controller switch driver API.
*/
package org.onlab.onos.of.controller.driver;
/**
* OpenFlow controller API.
*/
package org.onlab.onos.of.controller;
package org.onlab.onos.of.controller;
import org.projectfloodlight.openflow.protocol.OFMessage;
/**
* Test adapter for the OpenFlow controller interface.
*/
public class OpenflowControllerAdapter implements OpenFlowController {
@Override
public Iterable<OpenFlowSwitch> getSwitches() {
return null;
}
@Override
public Iterable<OpenFlowSwitch> getMasterSwitches() {
return null;
}
@Override
public Iterable<OpenFlowSwitch> getEqualSwitches() {
return null;
}
@Override
public OpenFlowSwitch getSwitch(Dpid dpid) {
return null;
}
@Override
public OpenFlowSwitch getMasterSwitch(Dpid dpid) {
return null;
}
@Override
public OpenFlowSwitch getEqualSwitch(Dpid dpid) {
return null;
}
@Override
public void addListener(OpenFlowSwitchListener listener) {
}
@Override
public void removeListener(OpenFlowSwitchListener listener) {
}
@Override
public void addPacketListener(int priority, PacketListener listener) {
}
@Override
public void removePacketListener(PacketListener listener) {
}
@Override
public void write(Dpid dpid, OFMessage msg) {
}
@Override
public void processPacket(Dpid dpid, OFMessage msg) {
}
@Override
public void setRole(Dpid dpid, RoleState role) {
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-of-ctl</artifactId>
<packaging>bundle</packaging>
<description>ONOS OpenFlow controller subsystem API</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<powermock.version>1.5.5</powermock.version>
<restlet.version>2.1.4</restlet.version>
<cobertura-maven-plugin.version>2.6</cobertura-maven-plugin.version>
<!-- Following 2 findbugs version needs to be updated in sync to match the
findbugs version used in findbugs-plugin -->
<findbugs.version>3.0.0</findbugs.version>
<findbugs-plugin.version>3.0.0</findbugs-plugin.version>
<findbugs.effort>Max</findbugs.effort>
<findbugs.excludeFilterFile>${project.basedir}/conf/findbugs/exclude.xml
</findbugs.excludeFilterFile>
<checkstyle-plugin.version>2.12</checkstyle-plugin.version>
<!-- To publish javadoc to github,
uncomment com.github.github site-maven-plugin and
see https://github.com/OPENNETWORKINGLAB/ONOS/pull/425
<github.global.server>github</github.global.server>
-->
<metrics.version>3.0.2</metrics.version>
<maven.surefire.plugin.version>2.16</maven.surefire.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of-api</artifactId>
</dependency>
<!-- ONOS's direct dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<!-- findbugs suppression annotation and @GuardedBy, etc. -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>${findbugs.version}</version>
</dependency>
<dependency>
<groupId>org.projectfloodlight</groupId>
<artifactId>openflowj</artifactId>
<version>0.3.8-SNAPSHOT</version>
</dependency>
<!-- Floodlight's dependencies -->
<dependency>
<!-- dependency to old version of netty? -->
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>3.9.2.Final</version>
</dependency>
<!-- Dependency for libraries used for testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executors;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.group.ChannelGroup;
import org.jboss.netty.channel.group.DefaultChannelGroup;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.driver.OpenFlowAgent;
import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver;
import org.onlab.onos.of.drivers.impl.DriverManager;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFFactories;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The main controller class. Handles all setup and network listeners
* - Distributed ownership control of switch through IControllerRegistryService
*/
public class Controller {
protected static final Logger log = LoggerFactory.getLogger(Controller.class);
static final String ERROR_DATABASE =
"The controller could not communicate with the system database.";
protected static final OFFactory FACTORY13 = OFFactories.getFactory(OFVersion.OF_13);
protected static final OFFactory FACTORY10 = OFFactories.getFactory(OFVersion.OF_10);
// The controllerNodeIPsCache maps Controller IDs to their IP address.
// It's only used by handleControllerNodeIPsChanged
protected HashMap<String, String> controllerNodeIPsCache;
private ChannelGroup cg;
// Configuration options
protected int openFlowPort = 6633;
protected int workerThreads = 0;
// Start time of the controller
protected long systemStartTime;
private OpenFlowAgent agent;
private NioServerSocketChannelFactory execFactory;
// Perf. related configuration
protected static final int SEND_BUFFER_SIZE = 4 * 1024 * 1024;
// ***************
// Getters/Setters
// ***************
public OFFactory getOFMessageFactory10() {
return FACTORY10;
}
public OFFactory getOFMessageFactory13() {
return FACTORY13;
}
public Map<String, String> getControllerNodeIPs() {
// We return a copy of the mapping so we can guarantee that
// the mapping return is the same as one that will be (or was)
// dispatched to IHAListeners
HashMap<String, String> retval = new HashMap<String, String>();
synchronized (controllerNodeIPsCache) {
retval.putAll(controllerNodeIPsCache);
}
return retval;
}
public long getSystemStartTime() {
return (this.systemStartTime);
}
// **************
// Initialization
// **************
/**
* Tell controller that we're ready to accept switches loop.
*/
public void run() {
try {
final ServerBootstrap bootstrap = createServerBootStrap();
bootstrap.setOption("reuseAddr", true);
bootstrap.setOption("child.keepAlive", true);
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.sendBufferSize", Controller.SEND_BUFFER_SIZE);
ChannelPipelineFactory pfact =
new OpenflowPipelineFactory(this, null);
bootstrap.setPipelineFactory(pfact);
InetSocketAddress sa = new InetSocketAddress(openFlowPort);
cg = new DefaultChannelGroup();
cg.add(bootstrap.bind(sa));
log.info("Listening for switch connections on {}", sa);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private ServerBootstrap createServerBootStrap() {
if (workerThreads == 0) {
execFactory = new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
return new ServerBootstrap(execFactory);
} else {
execFactory = new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool(), workerThreads);
return new ServerBootstrap(execFactory);
}
}
public void setConfigParams(Map<String, String> configParams) {
String ofPort = configParams.get("openflowport");
if (ofPort != null) {
this.openFlowPort = Integer.parseInt(ofPort);
}
log.debug("OpenFlow port set to {}", this.openFlowPort);
String threads = configParams.get("workerthreads");
if (threads != null) {
this.workerThreads = Integer.parseInt(threads);
}
log.debug("Number of worker threads set to {}", this.workerThreads);
}
/**
* Initialize internal data structures.
*/
public void init(Map<String, String> configParams) {
// These data structures are initialized here because other
// module's startUp() might be called before ours
this.controllerNodeIPsCache = new HashMap<String, String>();
setConfigParams(configParams);
this.systemStartTime = System.currentTimeMillis();
}
// **************
// Utility methods
// **************
public Map<String, Long> getMemory() {
Map<String, Long> m = new HashMap<String, Long>();
Runtime runtime = Runtime.getRuntime();
m.put("total", runtime.totalMemory());
m.put("free", runtime.freeMemory());
return m;
}
public Long getUptime() {
RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
return rb.getUptime();
}
/**
* Forward to the driver-manager to get an IOFSwitch instance.
* @param desc
* @return switch instance
*/
protected OpenFlowSwitchDriver getOFSwitchInstance(long dpid,
OFDescStatsReply desc, OFVersion ofv) {
OpenFlowSwitchDriver sw = DriverManager.getSwitch(new Dpid(dpid),
desc, ofv);
sw.setAgent(agent);
sw.setRoleHandler(new RoleManager(sw));
return sw;
}
public void start(OpenFlowAgent ag) {
log.info("Starting OpenFlow IO");
this.agent = ag;
this.init(new HashMap<String, String>());
this.run();
}
public void stop() {
log.info("Stopping OpenFlow IO");
execFactory.shutdown();
cg.close();
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
/**
* Exception is thrown when the handshake fails to complete.
* before a specified time
*
*/
public class HandshakeTimeoutException extends Exception {
private static final long serialVersionUID = 6859880268940337312L;
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
import java.util.concurrent.TimeUnit;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.util.Timeout;
import org.jboss.netty.util.Timer;
import org.jboss.netty.util.TimerTask;
/**
* Trigger a timeout if a switch fails to complete handshake soon enough.
*/
public class HandshakeTimeoutHandler
extends SimpleChannelUpstreamHandler {
static final HandshakeTimeoutException EXCEPTION =
new HandshakeTimeoutException();
final OFChannelHandler channelHandler;
final Timer timer;
final long timeoutNanos;
volatile Timeout timeout;
public HandshakeTimeoutHandler(OFChannelHandler channelHandler,
Timer timer,
long timeoutSeconds) {
super();
this.channelHandler = channelHandler;
this.timer = timer;
this.timeoutNanos = TimeUnit.SECONDS.toNanos(timeoutSeconds);
}
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception {
if (timeoutNanos > 0) {
timeout = timer.newTimeout(new HandshakeTimeoutTask(ctx),
timeoutNanos, TimeUnit.NANOSECONDS);
}
ctx.sendUpstream(e);
}
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception {
if (timeout != null) {
timeout.cancel();
timeout = null;
}
}
private final class HandshakeTimeoutTask implements TimerTask {
private final ChannelHandlerContext ctx;
HandshakeTimeoutTask(ChannelHandlerContext ctx) {
this.ctx = ctx;
}
@Override
public void run(Timeout t) throws Exception {
if (t.isCancelled()) {
return;
}
if (!ctx.getChannel().isOpen()) {
return;
}
if (!channelHandler.isHandshakeComplete()) {
Channels.fireExceptionCaught(ctx, EXCEPTION);
}
}
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
import org.projectfloodlight.openflow.protocol.OFFactories;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFMessageReader;
/**
* Decode an openflow message from a Channel, for use in a netty pipeline.
*/
public class OFMessageDecoder extends FrameDecoder {
@Override
protected Object decode(ChannelHandlerContext ctx, Channel channel,
ChannelBuffer buffer) throws Exception {
if (!channel.isConnected()) {
// In testing, I see decode being called AFTER decode last.
// This check avoids that from reading corrupted frames
return null;
}
// Note that a single call to decode results in reading a single
// OFMessage from the channel buffer, which is passed on to, and processed
// by, the controller (in OFChannelHandler).
// This is different from earlier behavior (with the original openflowj),
// where we parsed all the messages in the buffer, before passing on
// a list of the parsed messages to the controller.
// The performance *may or may not* not be as good as before.
OFMessageReader<OFMessage> reader = OFFactories.getGenericReader();
OFMessage message = reader.readFrom(buffer);
return message;
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
import org.projectfloodlight.openflow.protocol.OFMessage;
/**
* Encode an openflow message for output into a ChannelBuffer, for use in a
* netty pipeline.
*/
public class OFMessageEncoder extends OneToOneEncoder {
@Override
protected Object encode(ChannelHandlerContext ctx, Channel channel,
Object msg) throws Exception {
if (!(msg instanceof List)) {
return msg;
}
@SuppressWarnings("unchecked")
List<OFMessage> msglist = (List<OFMessage>) msg;
/* XXX S can't get length of OFMessage in loxigen's openflowj??
int size = 0;
for (OFMessage ofm : msglist) {
size += ofm.getLengthU();
}*/
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
for (OFMessage ofm : msglist) {
ofm.writeTo(buf);
}
return buf;
}
}
package org.onlab.onos.of.controller.impl;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Service;
import org.onlab.onos.of.controller.DefaultOpenFlowPacketContext;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.OpenFlowController;
import org.onlab.onos.of.controller.OpenFlowPacketContext;
import org.onlab.onos.of.controller.OpenFlowSwitch;
import org.onlab.onos.of.controller.OpenFlowSwitchListener;
import org.onlab.onos.of.controller.PacketListener;
import org.onlab.onos.of.controller.RoleState;
import org.onlab.onos.of.controller.driver.OpenFlowAgent;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPacketIn;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
@Component(immediate = true)
@Service
public class OpenFlowControllerImpl implements OpenFlowController {
private static final Logger log =
LoggerFactory.getLogger(OpenFlowControllerImpl.class);
protected ConcurrentHashMap<Dpid, OpenFlowSwitch> connectedSwitches =
new ConcurrentHashMap<Dpid, OpenFlowSwitch>();
protected ConcurrentHashMap<Dpid, OpenFlowSwitch> activeMasterSwitches =
new ConcurrentHashMap<Dpid, OpenFlowSwitch>();
protected ConcurrentHashMap<Dpid, OpenFlowSwitch> activeEqualSwitches =
new ConcurrentHashMap<Dpid, OpenFlowSwitch>();
protected OpenFlowSwitchAgent agent = new OpenFlowSwitchAgent();
protected Set<OpenFlowSwitchListener> ofEventListener = new HashSet<>();
protected Multimap<Integer, PacketListener> ofPacketListener =
ArrayListMultimap.create();
private final Controller ctrl = new Controller();
@Activate
public void activate() {
ctrl.start(agent);
}
@Deactivate
public void deactivate() {
ctrl.stop();
}
@Override
public Iterable<OpenFlowSwitch> getSwitches() {
return connectedSwitches.values();
}
@Override
public Iterable<OpenFlowSwitch> getMasterSwitches() {
return activeMasterSwitches.values();
}
@Override
public Iterable<OpenFlowSwitch> getEqualSwitches() {
return activeEqualSwitches.values();
}
@Override
public OpenFlowSwitch getSwitch(Dpid dpid) {
return connectedSwitches.get(dpid);
}
@Override
public OpenFlowSwitch getMasterSwitch(Dpid dpid) {
return activeMasterSwitches.get(dpid);
}
@Override
public OpenFlowSwitch getEqualSwitch(Dpid dpid) {
return activeEqualSwitches.get(dpid);
}
@Override
public void addListener(OpenFlowSwitchListener listener) {
if (!ofEventListener.contains(listener)) {
this.ofEventListener.add(listener);
}
}
@Override
public void removeListener(OpenFlowSwitchListener listener) {
this.ofEventListener.remove(listener);
}
@Override
public void addPacketListener(int priority, PacketListener listener) {
ofPacketListener.put(priority, listener);
}
@Override
public void removePacketListener(PacketListener listener) {
ofPacketListener.values().remove(listener);
}
@Override
public void write(Dpid dpid, OFMessage msg) {
this.getSwitch(dpid).sendMsg(msg);
}
@Override
public void processPacket(Dpid dpid, OFMessage msg) {
switch (msg.getType()) {
case PORT_STATUS:
for (OpenFlowSwitchListener l : ofEventListener) {
l.portChanged(dpid, (OFPortStatus) msg);
}
break;
case PACKET_IN:
OpenFlowPacketContext pktCtx = DefaultOpenFlowPacketContext
.packetContextFromPacketIn(this.getSwitch(dpid),
(OFPacketIn) msg);
for (PacketListener p : ofPacketListener.values()) {
p.handlePacket(pktCtx);
}
break;
default:
log.warn("Handling message type {} not yet implemented {}",
msg.getType(), msg);
}
}
@Override
public void setRole(Dpid dpid, RoleState role) {
getSwitch(dpid).setRole(role);
}
/**
* Implementation of an OpenFlow Agent which is responsible for
* keeping track of connected switches and the state in which
* they are.
*/
public class OpenFlowSwitchAgent implements OpenFlowAgent {
private final Logger log = LoggerFactory.getLogger(OpenFlowSwitchAgent.class);
private final Lock switchLock = new ReentrantLock();
@Override
public boolean addConnectedSwitch(Dpid dpid, OpenFlowSwitch sw) {
if (connectedSwitches.get(dpid) != null) {
log.error("Trying to add connectedSwitch but found a previous "
+ "value for dpid: {}", dpid);
return false;
} else {
log.error("Added switch {}", dpid);
connectedSwitches.put(dpid, sw);
for (OpenFlowSwitchListener l : ofEventListener) {
l.switchAdded(dpid);
}
return true;
}
}
@Override
public boolean validActivation(Dpid dpid) {
if (connectedSwitches.get(dpid) == null) {
log.error("Trying to activate switch but is not in "
+ "connected switches: dpid {}. Aborting ..",
dpid);
return false;
}
if (activeMasterSwitches.get(dpid) != null ||
activeEqualSwitches.get(dpid) != null) {
log.error("Trying to activate switch but it is already "
+ "activated: dpid {}. Found in activeMaster: {} "
+ "Found in activeEqual: {}. Aborting ..", new Object[]{
dpid,
(activeMasterSwitches.get(dpid) == null) ? 'N' : 'Y',
(activeEqualSwitches.get(dpid) == null) ? 'N' : 'Y'});
return false;
}
return true;
}
@Override
public boolean addActivatedMasterSwitch(Dpid dpid, OpenFlowSwitch sw) {
switchLock.lock();
try {
if (!validActivation(dpid)) {
return false;
}
activeMasterSwitches.put(dpid, sw);
return true;
} finally {
switchLock.unlock();
}
}
@Override
public boolean addActivatedEqualSwitch(Dpid dpid, OpenFlowSwitch sw) {
switchLock.lock();
try {
if (!validActivation(dpid)) {
return false;
}
activeEqualSwitches.put(dpid, sw);
log.info("Added Activated EQUAL Switch {}", dpid);
return true;
} finally {
switchLock.unlock();
}
}
@Override
public void transitionToMasterSwitch(Dpid dpid) {
switchLock.lock();
try {
if (activeMasterSwitches.containsKey(dpid)) {
return;
}
OpenFlowSwitch sw = activeEqualSwitches.remove(dpid);
if (sw == null) {
sw = getSwitch(dpid);
if (sw == null) {
log.error("Transition to master called on sw {}, but switch "
+ "was not found in controller-cache", dpid);
return;
}
}
log.info("Transitioned switch {} to MASTER", dpid);
activeMasterSwitches.put(dpid, sw);
} finally {
switchLock.unlock();
}
}
@Override
public void transitionToEqualSwitch(Dpid dpid) {
switchLock.lock();
try {
if (activeEqualSwitches.containsKey(dpid)) {
return;
}
OpenFlowSwitch sw = activeMasterSwitches.remove(dpid);
if (sw == null) {
sw = getSwitch(dpid);
if (sw == null) {
log.error("Transition to equal called on sw {}, but switch "
+ "was not found in controller-cache", dpid);
return;
}
}
log.info("Transitioned switch {} to EQUAL", dpid);
activeEqualSwitches.put(dpid, sw);
} finally {
switchLock.unlock();
}
}
@Override
public void removeConnectedSwitch(Dpid dpid) {
connectedSwitches.remove(dpid);
OpenFlowSwitch sw = activeMasterSwitches.remove(dpid);
if (sw == null) {
sw = activeEqualSwitches.remove(dpid);
}
for (OpenFlowSwitchListener l : ofEventListener) {
l.switchRemoved(dpid);
}
}
@Override
public void processMessage(Dpid dpid, OFMessage m) {
processPacket(dpid, m);
}
}
}
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package org.onlab.onos.of.controller.impl;
import java.util.concurrent.ThreadPoolExecutor;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.execution.ExecutionHandler;
import org.jboss.netty.handler.timeout.IdleStateHandler;
import org.jboss.netty.handler.timeout.ReadTimeoutHandler;
import org.jboss.netty.util.ExternalResourceReleasable;
import org.jboss.netty.util.HashedWheelTimer;
import org.jboss.netty.util.Timer;
/**
* Creates a ChannelPipeline for a server-side openflow channel.
*/
public class OpenflowPipelineFactory
implements ChannelPipelineFactory, ExternalResourceReleasable {
protected Controller controller;
protected ThreadPoolExecutor pipelineExecutor;
protected Timer timer;
protected IdleStateHandler idleHandler;
protected ReadTimeoutHandler readTimeoutHandler;
public OpenflowPipelineFactory(Controller controller,
ThreadPoolExecutor pipelineExecutor) {
super();
this.controller = controller;
this.pipelineExecutor = pipelineExecutor;
this.timer = new HashedWheelTimer();
this.idleHandler = new IdleStateHandler(timer, 20, 25, 0);
this.readTimeoutHandler = new ReadTimeoutHandler(timer, 30);
}
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelHandler handler = new OFChannelHandler(controller);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
// XXX S ONOS: was 15 increased it to fix Issue #296
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(handler, timer, 60));
if (pipelineExecutor != null) {
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
}
pipeline.addLast("handler", handler);
return pipeline;
}
@Override
public void releaseExternalResources() {
timer.stop();
}
}
/**
* Implementation of the OpenFlow controller IO subsystem.
*/
package org.onlab.onos.of.controller.impl;
package org.onlab.onos.of.drivers.impl;
import java.util.Collections;
import java.util.List;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.driver.AbstractOpenFlowSwitch;
import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver;
import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriverFactory;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A simple implementation of a driver manager that differentiates between
* connected switches using the OF Description Statistics Reply message.
*/
public final class DriverManager implements OpenFlowSwitchDriverFactory {
private static final Logger log = LoggerFactory.getLogger(DriverManager.class);
// Whether to use an OF 1.3 configured TTP, or to use an OF 1.0-style
// single table with packet-ins.
private static boolean cpqdUsePipeline13 = false;
/**
* Return an IOFSwitch object based on switch's manufacturer description
* from OFDescStatsReply.
*
* @param desc DescriptionStatistics reply from the switch
* @return A IOFSwitch instance if the driver found an implementation for
* the given description. Otherwise it returns OFSwitchImplBase
*/
@Override
public OpenFlowSwitchDriver getOFSwitchImpl(Dpid dpid,
OFDescStatsReply desc, OFVersion ofv) {
String vendor = desc.getMfrDesc();
String hw = desc.getHwDesc();
if (vendor.startsWith("Stanford University, Ericsson Research and CPqD Research")
&&
hw.startsWith("OpenFlow 1.3 Reference Userspace Switch")) {
return new OFSwitchImplCPqD13(dpid, desc, cpqdUsePipeline13);
}
if (vendor.startsWith("Nicira") &&
hw.startsWith("Open vSwitch")) {
if (ofv == OFVersion.OF_10) {
return new OFSwitchImplOVS10(dpid, desc);
} else if (ofv == OFVersion.OF_13) {
return new OFSwitchImplOVS13(dpid, desc);
}
}
log.warn("DriverManager could not identify switch desc: {}. "
+ "Assigning AbstractOpenFlowSwich", desc);
return new AbstractOpenFlowSwitch(dpid, desc) {
@Override
public void write(List<OFMessage> msgs) {
channel.write(msgs);
}
@Override
public void write(OFMessage msg) {
channel.write(Collections.singletonList(msg));
}
@Override
public Boolean supportNxRole() {
return false;
}
@Override
public void startDriverHandshake() {}
@Override
public void processDriverHandshakeMessage(OFMessage m) {}
@Override
public boolean isDriverHandshakeComplete() {
return true;
}
@Override
public List<OFPortDesc> getPorts() {
if (this.factory().getVersion() == OFVersion.OF_10) {
return Collections.unmodifiableList(features.getPorts());
} else {
return Collections.unmodifiableList(ports.getEntries());
}
}
};
}
/**
* Private constructor to avoid instantiation.
*/
private DriverManager() {
}
/**
* Sets the configuration parameter which determines how the CPqD switch
* is set up. If usePipeline13 is true, a 1.3 pipeline will be set up on
* the switch. Otherwise, the switch will be set up in a 1.0 style with
* a single table where missed packets are sent to the controller.
*
* @param usePipeline13 whether to use a 1.3 pipeline or not
*/
public static void setConfigForCpqd(boolean usePipeline13) {
cpqdUsePipeline13 = usePipeline13;
}
public static OpenFlowSwitchDriver getSwitch(Dpid dpid,
OFDescStatsReply desc, OFVersion ofv) {
return new DriverManager().getOFSwitchImpl(dpid, desc, ofv);
}
}
package org.onlab.onos.of.drivers.impl;
import java.util.Collections;
import java.util.List;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.driver.AbstractOpenFlowSwitch;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
/**
* OFDescriptionStatistics Vendor (Manufacturer Desc.): Nicira, Inc. Make
* (Hardware Desc.) : Open vSwitch Model (Datapath Desc.) : None Software :
* 1.11.90 (or whatever version + build) Serial : None
*/
public class OFSwitchImplOVS10 extends AbstractOpenFlowSwitch {
public OFSwitchImplOVS10(Dpid dpid, OFDescStatsReply desc) {
super(dpid);
setSwitchDescription(desc);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "OFSwitchImplOVS10 [" + ((channel != null)
? channel.getRemoteAddress() : "?")
+ " DPID[" + ((getStringId() != null) ? getStringId() : "?") + "]]";
}
@Override
public Boolean supportNxRole() {
return true;
}
@Override
public void startDriverHandshake() {}
@Override
public boolean isDriverHandshakeComplete() {
return true;
}
@Override
public void processDriverHandshakeMessage(OFMessage m) {}
@Override
public void write(OFMessage msg) {
channel.write(Collections.singletonList(msg));
}
@Override
public void write(List<OFMessage> msgs) {
channel.write(msgs);
}
@Override
public List<OFPortDesc> getPorts() {
return Collections.unmodifiableList(features.getPorts());
}
}
package org.onlab.onos.of.drivers.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import org.onlab.onos.of.controller.Dpid;
import org.onlab.onos.of.controller.driver.AbstractOpenFlowSwitch;
import org.onlab.onos.of.controller.driver.SwitchDriverSubHandshakeAlreadyStarted;
import org.onlab.onos.of.controller.driver.SwitchDriverSubHandshakeCompleted;
import org.onlab.onos.of.controller.driver.SwitchDriverSubHandshakeNotStarted;
import org.projectfloodlight.openflow.protocol.OFBarrierRequest;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFMatchV3;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFOxmList;
import org.projectfloodlight.openflow.protocol.action.OFAction;
import org.projectfloodlight.openflow.protocol.instruction.OFInstruction;
import org.projectfloodlight.openflow.types.OFBufferId;
import org.projectfloodlight.openflow.types.OFPort;
import org.projectfloodlight.openflow.types.TableId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* OFDescriptionStatistics Vendor (Manufacturer Desc.): Nicira, Inc. Make
* (Hardware Desc.) : Open vSwitch Model (Datapath Desc.) : None Software :
* 2.1.0 (or whatever version + build) Serial : None
*/
public class OFSwitchImplOVS13 extends AbstractOpenFlowSwitch {
private static Logger log =
LoggerFactory.getLogger(OFSwitchImplOVS13.class);
private final AtomicBoolean driverHandshakeComplete;
private OFFactory factory;
private long barrierXidToWaitFor = -1;
private static final short MIN_PRIORITY = 0x0;
private static final int OFPCML_NO_BUFFER = 0xffff;
public OFSwitchImplOVS13(Dpid dpid, OFDescStatsReply desc) {
super(dpid);
driverHandshakeComplete = new AtomicBoolean(false);
setSwitchDescription(desc);
}
@Override
public String toString() {
return "OFSwitchImplOVS13 [" + ((channel != null)
? channel.getRemoteAddress() : "?")
+ " DPID[" + ((getStringId() != null) ? getStringId() : "?") + "]]";
}
@Override
public void startDriverHandshake() {
log.debug("Starting driver handshake for sw {}", getStringId());
if (startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeAlreadyStarted();
}
startDriverHandshakeCalled = true;
factory = factory();
configureSwitch();
}
@Override
public boolean isDriverHandshakeComplete() {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
return driverHandshakeComplete.get();
}
@Override
public void processDriverHandshakeMessage(OFMessage m) {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
if (driverHandshakeComplete.get()) {
throw new SwitchDriverSubHandshakeCompleted(m);
}
switch (m.getType()) {
case BARRIER_REPLY:
if (m.getXid() == barrierXidToWaitFor) {
driverHandshakeComplete.set(true);
}
break;
case ERROR:
log.error("Switch {} Error {}", getStringId(), m);
break;
case FEATURES_REPLY:
break;
case FLOW_REMOVED:
break;
case GET_ASYNC_REPLY:
// OFAsyncGetReply asrep = (OFAsyncGetReply)m;
// decodeAsyncGetReply(asrep);
break;
case PACKET_IN:
break;
case PORT_STATUS:
break;
case QUEUE_GET_CONFIG_REPLY:
break;
case ROLE_REPLY:
break;
case STATS_REPLY:
// processStatsReply((OFStatsReply) m);
break;
default:
log.debug("Received message {} during switch-driver subhandshake "
+ "from switch {} ... Ignoring message", m, getStringId());
}
}
private void configureSwitch() {
populateTableMissEntry(0, true, false, false, 0);
sendBarrier(true);
}
private void sendBarrier(boolean finalBarrier) {
int xid = getNextTransactionId();
if (finalBarrier) {
barrierXidToWaitFor = xid;
}
OFBarrierRequest br = factory
.buildBarrierRequest()
.setXid(xid)
.build();
sendMsg(br);
}
@Override
public Boolean supportNxRole() {
return false;
}
@Override
public void write(OFMessage msg) {
channel.write(Collections.singletonList(msg));
}
@Override
public void write(List<OFMessage> msgs) {
channel.write(msgs);
}
/**
* By default if none of the booleans in the call are set, then the
* table-miss entry is added with no instructions, which means that pipeline
* execution will stop, and the action set associated with the packet will
* be executed.
*
* @param tableToAdd
* @param toControllerNow as an APPLY_ACTION instruction
* @param toControllerWrite as a WRITE_ACITION instruction
* @param toTable as a GOTO_TABLE instruction
* @param tableToSend
*/
@SuppressWarnings("unchecked")
private void populateTableMissEntry(int tableToAdd, boolean toControllerNow,
boolean toControllerWrite,
boolean toTable, int tableToSend) {
OFOxmList oxmList = OFOxmList.EMPTY;
OFMatchV3 match = factory.buildMatchV3()
.setOxmList(oxmList)
.build();
OFAction outc = factory.actions()
.buildOutput()
.setPort(OFPort.CONTROLLER)
.setMaxLen(OFPCML_NO_BUFFER)
.build();
List<OFInstruction> instructions = new ArrayList<OFInstruction>();
if (toControllerNow) {
// table-miss instruction to send to controller immediately
OFInstruction instr = factory.instructions()
.buildApplyActions()
.setActions(Collections.singletonList(outc))
.build();
instructions.add(instr);
}
if (toControllerWrite) {
// table-miss instruction to write-action to send to controller
// this will be executed whenever the action-set gets executed
OFInstruction instr = factory.instructions()
.buildWriteActions()
.setActions(Collections.singletonList(outc))
.build();
instructions.add(instr);
}
if (toTable) {
// table-miss instruction to goto-table x
OFInstruction instr = factory.instructions()
.gotoTable(TableId.of(tableToSend));
instructions.add(instr);
}
if (!toControllerNow && !toControllerWrite && !toTable) {
// table-miss has no instruction - at which point action-set will be
// executed - if there is an action to output/group in the action
// set
// the packet will be sent there, otherwise it will be dropped.
instructions = Collections.EMPTY_LIST;
}
OFMessage tableMissEntry = factory.buildFlowAdd()
.setTableId(TableId.of(tableToAdd))
.setMatch(match) // match everything
.setInstructions(instructions)
.setPriority(MIN_PRIORITY)
.setBufferId(OFBufferId.NO_BUFFER)
.setIdleTimeout(0)
.setHardTimeout(0)
.setXid(getNextTransactionId())
.build();
sendMsg(tableMissEntry);
}
}
/**
* OpenFlow base switch drivers implementations.
*/
package org.onlab.onos.of.drivers.impl;
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-of-drivers</artifactId>
<packaging>bundle</packaging>
<description>ONOS OpenFlow switch drivers &amp; factory</description>
<dependencies>
<dependency>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of-api</artifactId>
</dependency>
</dependencies>
<build>
<!--
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
</plugins>
-->
</build>
</project>
package org.onlab.onos.of.drivers.impl;
/**
* Created by tom on 9/2/14.
*/
public class DeleteMe {
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFActionType {
OUTPUT,
SET_VLAN_VID,
SET_VLAN_PCP,
STRIP_VLAN,
SET_DL_SRC,
SET_DL_DST,
SET_NW_SRC,
SET_NW_DST,
SET_NW_TOS,
SET_TP_SRC,
SET_TP_DST,
ENQUEUE,
EXPERIMENTER,
SET_NW_ECN,
COPY_TTL_OUT,
COPY_TTL_IN,
SET_MPLS_LABEL,
SET_MPLS_TC,
SET_MPLS_TTL,
DEC_MPLS_TTL,
PUSH_VLAN,
POP_VLAN,
PUSH_MPLS,
POP_MPLS,
SET_QUEUE,
GROUP,
SET_NW_TTL,
DEC_NW_TTL,
SET_FIELD,
PUSH_PBB,
POP_PBB;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFAggregateStatsReply extends OFObject, OFStatsReply {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
U64 getPacketCount();
U64 getByteCount();
long getFlowCount();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFStatsReply.Builder {
OFAggregateStatsReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
Builder setFlags(Set<OFStatsReplyFlags> flags);
U64 getPacketCount();
Builder setPacketCount(U64 packetCount);
U64 getByteCount();
Builder setByteCount(U64 byteCount);
long getFlowCount();
Builder setFlowCount(long flowCount);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFAggregateStatsRequest extends OFObject, OFStatsRequest<OFAggregateStatsReply>, OFRequest<OFAggregateStatsReply> {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
TableId getTableId();
OFPort getOutPort();
OFGroup getOutGroup() throws UnsupportedOperationException;
U64 getCookie() throws UnsupportedOperationException;
U64 getCookieMask() throws UnsupportedOperationException;
Match getMatch();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFStatsRequest.Builder<OFAggregateStatsReply> {
OFAggregateStatsRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
Builder setFlags(Set<OFStatsRequestFlags> flags);
TableId getTableId();
Builder setTableId(TableId tableId);
OFPort getOutPort();
Builder setOutPort(OFPort outPort);
OFGroup getOutGroup() throws UnsupportedOperationException;
Builder setOutGroup(OFGroup outGroup) throws UnsupportedOperationException;
U64 getCookie() throws UnsupportedOperationException;
Builder setCookie(U64 cookie) throws UnsupportedOperationException;
U64 getCookieMask() throws UnsupportedOperationException;
Builder setCookieMask(U64 cookieMask) throws UnsupportedOperationException;
Match getMatch();
Builder setMatch(Match match);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFAsyncGetReply extends OFObject, OFMessage {
OFVersion getVersion();
OFType getType();
long getXid();
long getPacketInMaskEqualMaster();
long getPacketInMaskSlave();
long getPortStatusMaskEqualMaster();
long getPortStatusMaskSlave();
long getFlowRemovedMaskEqualMaster();
long getFlowRemovedMaskSlave();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFMessage.Builder {
OFAsyncGetReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getPacketInMaskEqualMaster();
Builder setPacketInMaskEqualMaster(long packetInMaskEqualMaster);
long getPacketInMaskSlave();
Builder setPacketInMaskSlave(long packetInMaskSlave);
long getPortStatusMaskEqualMaster();
Builder setPortStatusMaskEqualMaster(long portStatusMaskEqualMaster);
long getPortStatusMaskSlave();
Builder setPortStatusMaskSlave(long portStatusMaskSlave);
long getFlowRemovedMaskEqualMaster();
Builder setFlowRemovedMaskEqualMaster(long flowRemovedMaskEqualMaster);
long getFlowRemovedMaskSlave();
Builder setFlowRemovedMaskSlave(long flowRemovedMaskSlave);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFAsyncGetRequest extends OFObject, OFMessage, OFRequest<OFAsyncGetReply> {
OFVersion getVersion();
OFType getType();
long getXid();
long getPacketInMaskEqualMaster();
long getPacketInMaskSlave();
long getPortStatusMaskEqualMaster();
long getPortStatusMaskSlave();
long getFlowRemovedMaskEqualMaster();
long getFlowRemovedMaskSlave();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFMessage.Builder {
OFAsyncGetRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getPacketInMaskEqualMaster();
Builder setPacketInMaskEqualMaster(long packetInMaskEqualMaster);
long getPacketInMaskSlave();
Builder setPacketInMaskSlave(long packetInMaskSlave);
long getPortStatusMaskEqualMaster();
Builder setPortStatusMaskEqualMaster(long portStatusMaskEqualMaster);
long getPortStatusMaskSlave();
Builder setPortStatusMaskSlave(long portStatusMaskSlave);
long getFlowRemovedMaskEqualMaster();
Builder setFlowRemovedMaskEqualMaster(long flowRemovedMaskEqualMaster);
long getFlowRemovedMaskSlave();
Builder setFlowRemovedMaskSlave(long flowRemovedMaskSlave);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFAsyncSet extends OFObject, OFMessage {
OFVersion getVersion();
OFType getType();
long getXid();
long getPacketInMaskEqualMaster();
long getPacketInMaskSlave();
long getPortStatusMaskEqualMaster();
long getPortStatusMaskSlave();
long getFlowRemovedMaskEqualMaster();
long getFlowRemovedMaskSlave();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFMessage.Builder {
OFAsyncSet build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getPacketInMaskEqualMaster();
Builder setPacketInMaskEqualMaster(long packetInMaskEqualMaster);
long getPacketInMaskSlave();
Builder setPacketInMaskSlave(long packetInMaskSlave);
long getPortStatusMaskEqualMaster();
Builder setPortStatusMaskEqualMaster(long portStatusMaskEqualMaster);
long getPortStatusMaskSlave();
Builder setPortStatusMaskSlave(long portStatusMaskSlave);
long getFlowRemovedMaskEqualMaster();
Builder setFlowRemovedMaskEqualMaster(long flowRemovedMaskEqualMaster);
long getFlowRemovedMaskSlave();
Builder setFlowRemovedMaskSlave(long flowRemovedMaskSlave);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBadActionCode {
BAD_TYPE,
BAD_LEN,
BAD_EXPERIMENTER,
BAD_EXPERIMENTER_TYPE,
BAD_OUT_PORT,
BAD_ARGUMENT,
EPERM,
TOO_MANY,
BAD_QUEUE,
BAD_OUT_GROUP,
MATCH_INCONSISTENT,
UNSUPPORTED_ORDER,
BAD_TAG,
BAD_SET_TYPE,
BAD_SET_LEN,
BAD_SET_ARGUMENT;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBadInstructionCode {
UNKNOWN_INST,
UNSUP_INST,
BAD_TABLE_ID,
UNSUP_METADATA,
UNSUP_METADATA_MASK,
UNSUP_EXP_INST,
BAD_EXPERIMENTER,
BAD_EXPERIMENTER_TYPE,
BAD_LEN,
EPERM;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBadMatchCode {
BAD_TYPE,
BAD_LEN,
BAD_TAG,
BAD_DL_ADDR_MASK,
BAD_NW_ADDR_MASK,
BAD_WILDCARDS,
BAD_FIELD,
BAD_VALUE,
BAD_MASK,
BAD_PREREQ,
DUP_FIELD,
EPERM;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBadRequestCode {
BAD_VERSION,
BAD_TYPE,
BAD_STAT,
BAD_EXPERIMENTER,
BAD_SUBTYPE,
EPERM,
BAD_LEN,
BUFFER_EMPTY,
BUFFER_UNKNOWN,
BAD_TABLE_ID,
BAD_EXPERIMENTER_TYPE,
IS_SLAVE,
BAD_PORT,
BAD_PACKET,
MULTIPART_BUFFER_OVERFLOW;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBarrierReply extends OFObject, OFMessage {
OFVersion getVersion();
OFType getType();
long getXid();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFMessage.Builder {
OFBarrierReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBarrierRequest extends OFObject, OFMessage, OFRequest<OFBarrierReply> {
OFVersion getVersion();
OFType getType();
long getXid();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFMessage.Builder {
OFBarrierRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnArpIdle extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
int getVlanVid();
IPv4Address getIpv4Addr();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnArpIdle build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
int getVlanVid();
Builder setVlanVid(int vlanVid);
IPv4Address getIpv4Addr();
Builder setIpv4Addr(IPv4Address ipv4Addr);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwClearDataReply extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
long getStatus();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwClearDataReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
long getStatus();
Builder setStatus(long status);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwClearDataRequest extends OFObject, OFBsnHeader, OFRequest<OFBsnBwClearDataReply> {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwClearDataRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwEnableGetReply extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
long getEnabled();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwEnableGetReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
long getEnabled();
Builder setEnabled(long enabled);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwEnableGetRequest extends OFObject, OFBsnHeader, OFRequest<OFBsnBwEnableGetReply> {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwEnableGetRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwEnableSetReply extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
long getEnable();
long getStatus();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwEnableSetReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
long getEnable();
Builder setEnable(long enable);
long getStatus();
Builder setStatus(long status);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnBwEnableSetRequest extends OFObject, OFBsnHeader, OFRequest<OFBsnBwEnableSetReply> {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
long getEnable();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnBwEnableSetRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
long getEnable();
Builder setEnable(long enable);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnControllerConnection extends OFObject {
OFBsnControllerConnectionState getState();
OFAuxId getAuxiliaryId();
OFControllerRole getRole();
String getUri();
OFVersion getVersion();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder {
OFBsnControllerConnection build();
OFBsnControllerConnectionState getState();
Builder setState(OFBsnControllerConnectionState state);
OFAuxId getAuxiliaryId();
Builder setAuxiliaryId(OFAuxId auxiliaryId);
OFControllerRole getRole();
Builder setRole(OFControllerRole role);
String getUri();
Builder setUri(String uri);
OFVersion getVersion();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBsnControllerConnectionState {
BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED,
BSN_CONTROLLER_CONNECTION_STATE_CONNECTED;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnControllerConnectionsReply extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
List<OFBsnControllerConnection> getConnections();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnControllerConnectionsReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
List<OFBsnControllerConnection> getConnections();
Builder setConnections(List<OFBsnControllerConnection> connections);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnControllerConnectionsRequest extends OFObject, OFBsnHeader, OFRequest<OFBsnControllerConnectionsReply> {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnControllerConnectionsRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template const.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
public enum OFBsnControllerRoleReason {
BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST,
BSN_CONTROLLER_ROLE_REASON_CONFIG,
BSN_CONTROLLER_ROLE_REASON_EXPERIMENTER;
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterDescStatsEntry extends OFObject {
U64 getCounterId();
String getName();
String getDescription();
OFVersion getVersion();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder {
OFBsnDebugCounterDescStatsEntry build();
U64 getCounterId();
Builder setCounterId(U64 counterId);
String getName();
Builder setName(String name);
String getDescription();
Builder setDescription(String description);
OFVersion getVersion();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterDescStatsReply extends OFObject, OFBsnStatsReply {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
long getExperimenter();
long getSubtype();
List<OFBsnDebugCounterDescStatsEntry> getEntries();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsReply.Builder {
OFBsnDebugCounterDescStatsReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
Builder setFlags(Set<OFStatsReplyFlags> flags);
long getExperimenter();
long getSubtype();
List<OFBsnDebugCounterDescStatsEntry> getEntries();
Builder setEntries(List<OFBsnDebugCounterDescStatsEntry> entries);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterDescStatsRequest extends OFObject, OFBsnStatsRequest<OFBsnDebugCounterDescStatsReply>, OFRequest<OFBsnDebugCounterDescStatsReply> {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
long getExperimenter();
long getSubtype();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsRequest.Builder<OFBsnDebugCounterDescStatsReply> {
OFBsnDebugCounterDescStatsRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
Builder setFlags(Set<OFStatsRequestFlags> flags);
long getExperimenter();
long getSubtype();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterStatsEntry extends OFObject {
U64 getCounterId();
U64 getValue();
OFVersion getVersion();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder {
OFBsnDebugCounterStatsEntry build();
U64 getCounterId();
Builder setCounterId(U64 counterId);
U64 getValue();
Builder setValue(U64 value);
OFVersion getVersion();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterStatsReply extends OFObject, OFBsnStatsReply {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
long getExperimenter();
long getSubtype();
List<OFBsnDebugCounterStatsEntry> getEntries();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsReply.Builder {
OFBsnDebugCounterStatsReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
Builder setFlags(Set<OFStatsReplyFlags> flags);
long getExperimenter();
long getSubtype();
List<OFBsnDebugCounterStatsEntry> getEntries();
Builder setEntries(List<OFBsnDebugCounterStatsEntry> entries);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnDebugCounterStatsRequest extends OFObject, OFBsnStatsRequest<OFBsnDebugCounterStatsReply>, OFRequest<OFBsnDebugCounterStatsReply> {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
long getExperimenter();
long getSubtype();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsRequest.Builder<OFBsnDebugCounterStatsReply> {
OFBsnDebugCounterStatsRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
Builder setFlags(Set<OFStatsRequestFlags> flags);
long getExperimenter();
long getSubtype();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnFlowChecksumBucketStatsEntry extends OFObject {
U64 getChecksum();
OFVersion getVersion();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder {
OFBsnFlowChecksumBucketStatsEntry build();
U64 getChecksum();
Builder setChecksum(U64 checksum);
OFVersion getVersion();
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnFlowChecksumBucketStatsReply extends OFObject, OFBsnStatsReply {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
long getExperimenter();
long getSubtype();
List<OFBsnFlowChecksumBucketStatsEntry> getEntries();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsReply.Builder {
OFBsnFlowChecksumBucketStatsReply build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsReplyFlags> getFlags();
Builder setFlags(Set<OFStatsReplyFlags> flags);
long getExperimenter();
long getSubtype();
List<OFBsnFlowChecksumBucketStatsEntry> getEntries();
Builder setEntries(List<OFBsnFlowChecksumBucketStatsEntry> entries);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.Set;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnFlowChecksumBucketStatsRequest extends OFObject, OFBsnStatsRequest<OFBsnFlowChecksumBucketStatsReply>, OFRequest<OFBsnFlowChecksumBucketStatsReply> {
OFVersion getVersion();
OFType getType();
long getXid();
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
long getExperimenter();
long getSubtype();
TableId getTableId();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnStatsRequest.Builder<OFBsnFlowChecksumBucketStatsReply> {
OFBsnFlowChecksumBucketStatsRequest build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFStatsType getStatsType();
Set<OFStatsRequestFlags> getFlags();
Builder setFlags(Set<OFStatsRequestFlags> flags);
long getExperimenter();
long getSubtype();
TableId getTableId();
Builder setTableId(TableId tableId);
}
}
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.jboss.netty.buffer.ChannelBuffer;
public interface OFBsnFlowIdle extends OFObject, OFBsnHeader {
OFVersion getVersion();
OFType getType();
long getXid();
long getExperimenter();
long getSubtype();
U64 getCookie();
int getPriority();
TableId getTableId();
Match getMatch();
void writeTo(ChannelBuffer channelBuffer);
Builder createBuilder();
public interface Builder extends OFBsnHeader.Builder {
OFBsnFlowIdle build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
long getExperimenter();
long getSubtype();
U64 getCookie();
Builder setCookie(U64 cookie);
int getPriority();
Builder setPriority(int priority);
TableId getTableId();
Builder setTableId(TableId tableId);
Match getMatch();
Builder setMatch(Match match);
}
}