Skip to content

Commit

Permalink
Merge pull request #98 from DFritzsche/use_queue_type_enum
Browse files Browse the repository at this point in the history
Use queue type enum
  • Loading branch information
toanju committed Aug 14, 2017
2 parents 68d0594 + cd06889 commit 959709f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/rofl/common/crofconn.h
Expand Up @@ -118,14 +118,6 @@ class crofconn_env {
* @brief A single OpenFlow control connection
*/
class crofconn : public cthread_env, public crofsock_env {
enum outqueue_type_t {
QUEUE_OAM = 0, // Echo.request/Echo.reply
QUEUE_MGMT = 1, // all remaining packets, except ...
QUEUE_FLOW = 2, // Flow-Mod/Flow-Removed
QUEUE_PKT = 3, // Packet-In/Packet-Out
QUEUE_MAX, // do not use
};

enum msg_type_t {
OFPT_HELLO = 0,
OFPT_ERROR = 1,
Expand Down Expand Up @@ -159,6 +151,14 @@ class crofconn : public cthread_env, public crofsock_env {
};

public:
enum outqueue_type_t {
QUEUE_OAM, // Echo.request/Echo.reply
QUEUE_MGMT, // all remaining packets, except ...
QUEUE_FLOW, // Flow-Mod/Flow-Removed
QUEUE_PKT, // Packet-In/Packet-Out
QUEUE_MAX, // do not use
};

enum crofconn_mode_t {
MODE_UNKNOWN = 0,
MODE_CONTROLLER = 1,
Expand Down Expand Up @@ -312,7 +312,7 @@ class crofconn : public cthread_env, public crofsock_env {
/**
* @brief Returns capacity of reception queues in messages
*/
size_t get_rxqueue_max_size(unsigned int queue_id) const {
size_t get_rxqueue_max_size(outqueue_type_t queue_id) const {
if (rxqueues.size() <= queue_id) {
throw eRofConnInvalid("crofconn::get_rxqueue_max_size() invalid queue_id")
.set_func(__FUNCTION__)
Expand All @@ -325,7 +325,7 @@ class crofconn : public cthread_env, public crofsock_env {
/**
* @brief Sets capacity of reception queues in messages
*/
crofconn &set_rxqueue_max_size(unsigned int queue_id,
crofconn &set_rxqueue_max_size(outqueue_type_t queue_id,
size_t rxqueue_max_size) {
if (rxqueues.size() <= queue_id) {
throw eRofConnInvalid("crofconn::set_rxqueue_max_size() invalid queue_id")
Expand Down
2 changes: 1 addition & 1 deletion src/rofl/common/ctimespec.cpp
Expand Up @@ -44,7 +44,7 @@ ctimespec ctimespec::operator-(const ctimespec &t) const {
} else if (tspec.tv_sec == t.tspec.tv_sec) {
if (tspec.tv_nsec > t.tspec.tv_nsec) {
timer.tspec.tv_nsec = tspec.tv_nsec - t.tspec.tv_nsec;
//timer.tspec.tv_sec = tspec.tv_sec - t.tspec.tv_sec = 0
// timer.tspec.tv_sec = tspec.tv_sec - t.tspec.tv_sec = 0
}
}

Expand Down

0 comments on commit 959709f

Please sign in to comment.