b66ce9783100d5b6e4a2c81ccdf8055efa4dfda1
[openflowplugin.git] / openflow_netty / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / internal / OFChannelState.java
1 package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import org.openflow.protocol.OFFeaturesReply;
7 import org.openflow.protocol.OFMessage;
8 import org.openflow.protocol.statistics.OFDescriptionStatistics;
9
10 /**
11  * Wrapper class to hold state for the OpenFlow switch connection
12  * @author readams
13  */
14 class OFChannelState {
15
16     /**
17      * State for handling the switch handshake
18      */
19     protected enum HandshakeState {
20         /**
21          * Beginning state
22          */
23         START,
24
25         /**
26          * Received HELLO from switch
27          */
28         HELLO,
29
30         /**
31          * We've received the features reply
32          * Waiting for Config and Description reply
33          */
34         FEATURES_REPLY,
35
36         /**
37          * Switch is ready for processing messages
38          */
39         READY
40
41     }
42
43     protected volatile HandshakeState hsState = HandshakeState.START;
44     protected boolean hasGetConfigReply = false;
45     protected boolean hasDescription = false;
46     protected boolean switchBindingDone = false;
47
48     protected OFFeaturesReply featuresReply = null;
49     protected OFDescriptionStatistics description = null;
50     protected List<OFMessage> queuedOFMessages = new ArrayList<OFMessage>();
51 }