Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix occurred functions #94

Merged
merged 5 commits into from Jul 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/controller/controller.cpp
Expand Up @@ -237,8 +237,8 @@ void controller::handle_conn_terminated(rofl::crofdpt &dpt,
}

void controller::handle_conn_congestion_occurred(rofl::crofdpt &dpt,
const rofl::cauxid &auxid) {
std::cerr << "EVENT: congestion occured, auxid:" << (int)auxid.get_id()
const rofl::cauxid &auxid) {
std::cerr << "EVENT: congestion occurred, auxid:" << (int)auxid.get_id()
<< std::endl;

/* An OpenFlow control connection may suffer from insufficient
Expand All @@ -250,7 +250,7 @@ void controller::handle_conn_congestion_occurred(rofl::crofdpt &dpt,
* Each connection's transmission buffer size adapts automatically to
* the bandwidth offered by the underlying TCP connection. If the
* TCP socket indicates a blocking condition, rofl-common will call
* method rofl::crofbase::handle_conn_congestion_occured(). The
* method rofl::crofbase::handle_conn_congestion_occurred(). The
* application should stop sending further control messages via this
* connection until a congestion resolution indication is received
* from the library (see below). If an application persists on sending
Expand Down Expand Up @@ -479,7 +479,7 @@ void controller::handle_port_desc_stats_reply(

void controller::handle_port_desc_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Port-Desc-Stats timeout occured, xid: " << (unsigned int)xid
std::cerr << "Port-Desc-Stats timeout occurred, xid: " << (unsigned int)xid
<< std::endl;
}

Expand All @@ -492,7 +492,7 @@ void controller::handle_table_features_stats_reply(

void controller::handle_table_features_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Table-Features-Stats timeout occured, xid: "
std::cerr << "Table-Features-Stats timeout occurred, xid: "
<< (unsigned int)xid << std::endl;
}

Expand All @@ -504,6 +504,6 @@ void controller::handle_table_stats_reply(

void controller::handle_table_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Table-Stats timeout occured, xid: " << (unsigned int)xid
std::cerr << "Table-Stats timeout occurred, xid: " << (unsigned int)xid
<< std::endl;
}
2 changes: 1 addition & 1 deletion examples/controller/controller.hpp
Expand Up @@ -215,7 +215,7 @@ class controller : public rofl::crofbase {
* @param auxid control connection identifier (main: 0)
*/
virtual void handle_conn_congestion_occurred(rofl::crofdpt &dpt,
const rofl::cauxid &auxid);
const rofl::cauxid &auxid);

/**
* @brief Called when a congestion situation on the control connection has
Expand Down
4 changes: 2 additions & 2 deletions examples/datapath/datapath.cpp
Expand Up @@ -93,8 +93,8 @@ void datapath::handle_conn_negotiation_failed(rofl::crofctl &ctl,
}

void datapath::handle_conn_congestion_occurred(rofl::crofctl &ctl,
const rofl::cauxid &auxid) {
std::cerr << "channel congestion occured, ctlid=" << ctlid << std::endl;
const rofl::cauxid &auxid) {
std::cerr << "channel congestion occurred, ctlid=" << ctlid << std::endl;
}

void datapath::handle_conn_congestion_solved(rofl::crofctl &ctl,
Expand Down
2 changes: 1 addition & 1 deletion examples/datapath/datapath.hpp
Expand Up @@ -133,7 +133,7 @@ class datapath : public rofl::crofbase {
* @param auxid control connection identifier (main: 0)
*/
virtual void handle_conn_congestion_occurred(rofl::crofctl &ctl,
const rofl::cauxid &auxid);
const rofl::cauxid &auxid);

/**
* @brief Called when a congestion situation on the control connection has
Expand Down
2 changes: 1 addition & 1 deletion examples/ethswctld/cfibentry.h
Expand Up @@ -150,7 +150,7 @@ class cfibentry : public rofl::cthread_env {
* @brief Handle timeout events generated by class rofl::ciosrv.
*
* This method is overwritten from class rofl::ciosrv and is
* called whenever a previously registered timer event has occured.
* called whenever a previously registered timer event has occurred.
* The 'opaque' and 'data' values are the ones used when calling method
* rofl::ciosrv::register_timer().
*
Expand Down
4 changes: 2 additions & 2 deletions examples/tcpclient/tcpclient.h
Expand Up @@ -199,8 +199,8 @@ class tcpclient : public rofl::crofbase {
* @param auxid control connection identifier (main: 0)
*/
virtual void handle_conn_congestion_occurred(rofl::crofctl &ctl,
const rofl::cauxid &auxid) {
std::cerr << "channel congestion occured, ctlid=" << ctlid << std::endl;
const rofl::cauxid &auxid) {
std::cerr << "channel congestion occurred, ctlid=" << ctlid << std::endl;
};

/**
Expand Down
6 changes: 3 additions & 3 deletions examples/tcpserver/tcpserver.h
Expand Up @@ -146,7 +146,7 @@ class tcpserver : public rofl::crofbase {
*/
virtual void handle_port_desc_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Port-Desc-Stats timeout occured, xid: " << (unsigned int)xid
std::cerr << "Port-Desc-Stats timeout occurred, xid: " << (unsigned int)xid
<< std::endl;
};

Expand Down Expand Up @@ -177,7 +177,7 @@ class tcpserver : public rofl::crofbase {
*/
virtual void handle_table_features_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Table-Features-Stats timeout occured, xid: "
std::cerr << "Table-Features-Stats timeout occurred, xid: "
<< (unsigned int)xid << std::endl;
};

Expand Down Expand Up @@ -206,7 +206,7 @@ class tcpserver : public rofl::crofbase {
*/
virtual void handle_table_stats_reply_timeout(rofl::crofdpt &dpt,
uint32_t xid) {
std::cerr << "Table-Stats timeout occured, xid: " << (unsigned int)xid
std::cerr << "Table-Stats timeout occurred, xid: " << (unsigned int)xid
<< std::endl;
};

Expand Down
6 changes: 3 additions & 3 deletions src/rofl/common/crofbase.cc
Expand Up @@ -518,7 +518,7 @@ void crofbase::handle_negotiation_failed(crofctl &ctl, crofconn &conn) {
handle_conn_negotiation_failed(ctl, conn.get_auxid());
}

void crofbase::congestion_occured_indication(crofctl &ctl, crofconn &conn) {
void crofbase::congestion_occurred_indication(crofctl &ctl, crofconn &conn) {
VLOG(2) << __FUNCTION__ << " connection negotiation failed: ctlid="
<< ctl.get_ctlid().str().c_str()
<< ", auxid=" << conn.get_auxid().str().c_str()
Expand Down Expand Up @@ -594,9 +594,9 @@ void crofbase::handle_negotiation_failed(crofdpt &dpt, crofconn &conn) {
handle_conn_negotiation_failed(dpt, conn.get_auxid());
}

void crofbase::congestion_occured_indication(crofdpt &dpt, crofconn &conn) {
void crofbase::congestion_occurred_indication(crofdpt &dpt, crofconn &conn) {
VLOG(2) << __FUNCTION__
<< " connection congestion occured: dptid=" << dpt.get_dptid()
<< " connection congestion occurred: dptid=" << dpt.get_dptid()
<< ", auxid=" << conn.get_auxid().str().c_str()
<< ", raddr=" << conn.get_raddr().str().c_str();
handle_conn_congestion_occurred(dpt, conn.get_auxid());
Expand Down
10 changes: 5 additions & 5 deletions src/rofl/common/crofbase.h
Expand Up @@ -988,7 +988,7 @@ class crofbase : public virtual rofl::cthread_env,
* @param auxid control connection identifier (main: 0)
*/
virtual void handle_conn_congestion_occurred(rofl::crofdpt &dpt,
const rofl::cauxid &auxid){};
const rofl::cauxid &auxid){};

/**
* @brief Called when a congestion situation on the control connection has
Expand Down Expand Up @@ -1107,7 +1107,7 @@ class crofbase : public virtual rofl::cthread_env,
* @param auxid control connection identifier (main: 0)
*/
virtual void handle_conn_congestion_occurred(rofl::crofctl &ctl,
const rofl::cauxid &auxid){};
const rofl::cauxid &auxid){};

/**
* @brief Called when a congestion situation on the control connection has
Expand Down Expand Up @@ -2180,7 +2180,7 @@ class crofbase : public virtual rofl::cthread_env,

virtual void handle_negotiation_failed(crofdpt &dpt, crofconn &conn);

virtual void congestion_occured_indication(crofdpt &dpt, crofconn &conn);
virtual void congestion_occurred_indication(crofdpt &dpt, crofconn &conn);

virtual void congestion_solved_indication(crofdpt &dpt, crofconn &conn);

Expand All @@ -2202,7 +2202,7 @@ class crofbase : public virtual rofl::cthread_env,

virtual void handle_negotiation_failed(crofctl &ctl, crofconn &conn);

virtual void congestion_occured_indication(crofctl &ctl, crofconn &conn);
virtual void congestion_occurred_indication(crofctl &ctl, crofconn &conn);

virtual void congestion_solved_indication(crofctl &ctl, crofconn &conn);

Expand All @@ -2223,7 +2223,7 @@ class crofbase : public virtual rofl::cthread_env,
delete msg;
};

virtual void congestion_occured_indication(crofconn &conn){};
virtual void congestion_occurred_indication(crofconn &conn){};

virtual void congestion_solved_indication(crofconn &conn){};

Expand Down
8 changes: 4 additions & 4 deletions src/rofl/common/crofchan.h
Expand Up @@ -109,8 +109,8 @@ class crofchan_env {
virtual void handle_recv(crofchan &chan, crofconn &conn,
rofl::openflow::cofmsg *msg) = 0;

virtual void congestion_occured_indication(crofchan &chan,
crofconn &conn) = 0;
virtual void congestion_occurred_indication(crofchan &chan,
crofconn &conn) = 0;

virtual void congestion_solved_indication(crofchan &chan, crofconn &conn) = 0;

Expand Down Expand Up @@ -527,8 +527,8 @@ class crofchan : public cthread_env, public rofl::crofconn_env {
crofchan_env::call_env(env).handle_recv(*this, conn, msg);
};

virtual void congestion_occured_indication(crofconn &conn) {
crofchan_env::call_env(env).congestion_occured_indication(*this, conn);
virtual void congestion_occurred_indication(crofconn &conn) {
crofchan_env::call_env(env).congestion_occurred_indication(*this, conn);
};

virtual void congestion_solved_indication(crofconn &conn) {
Expand Down
9 changes: 4 additions & 5 deletions src/rofl/common/crofconn.cc
Expand Up @@ -829,11 +829,10 @@ void crofconn::congestion_solved_indication(crofsock &rofsock) {
crofconn_env::call_env(env).congestion_solved_indication(*this);
};

void crofconn::congestion_occured_indication(crofsock &rofsock) {
VLOG(2)
<< __FUNCTION__
<< " congestion occured indication; action: message transmission blocked";
crofconn_env::call_env(env).congestion_occured_indication(*this);
void crofconn::congestion_occurred_indication(crofsock &rofsock) {
VLOG(2) << __FUNCTION__ << " congestion occurred indication; action: message "
"transmission blocked";
crofconn_env::call_env(env).congestion_occurred_indication(*this);
};

void crofconn::handle_recv(crofsock &socket, rofl::openflow::cofmsg *msg) {
Expand Down
4 changes: 2 additions & 2 deletions src/rofl/common/crofconn.h
Expand Up @@ -100,7 +100,7 @@ class crofconn_env {

virtual void handle_recv(crofconn &conn, rofl::openflow::cofmsg *msg) = 0;

virtual void congestion_occured_indication(crofconn &conn) = 0;
virtual void congestion_occurred_indication(crofconn &conn) = 0;

virtual void congestion_solved_indication(crofconn &conn) = 0;

Expand Down Expand Up @@ -694,7 +694,7 @@ class crofconn : public cthread_env, public crofsock_env {

virtual void handle_recv(crofsock &socket, rofl::openflow::cofmsg *msg);

virtual void congestion_occured_indication(crofsock &socket);
virtual void congestion_occurred_indication(crofsock &socket);

virtual void congestion_solved_indication(crofsock &rofsock);

Expand Down
6 changes: 3 additions & 3 deletions src/rofl/common/crofctl.h
Expand Up @@ -216,7 +216,7 @@ class crofctl_env {
* @param ctl controller instance
* @param conn control connection instance
*/
virtual void congestion_occured_indication(crofctl &ctl, crofconn &conn){};
virtual void congestion_occurred_indication(crofctl &ctl, crofconn &conn){};

/**
* @brief Called when a congestion situation on the control connection has
Expand Down Expand Up @@ -1283,8 +1283,8 @@ class crofctl : public rofl::crofchan_env {
crofctl_env::call_env(env).handle_negotiation_failed(*this, conn);
};

virtual void congestion_occured_indication(crofchan &chan, crofconn &conn) {
crofctl_env::call_env(env).congestion_occured_indication(*this, conn);
virtual void congestion_occurred_indication(crofchan &chan, crofconn &conn) {
crofctl_env::call_env(env).congestion_occurred_indication(*this, conn);
};

virtual void congestion_solved_indication(crofchan &chan, crofconn &conn) {
Expand Down
6 changes: 3 additions & 3 deletions src/rofl/common/crofdpt.h
Expand Up @@ -217,7 +217,7 @@ class crofdpt_env {
* @param dpt datapath instance
* @param conn control connection instance
*/
virtual void congestion_occured_indication(crofdpt &dpt, crofconn &conn){};
virtual void congestion_occurred_indication(crofdpt &dpt, crofconn &conn){};

/**
* @brief Called when a congestion situation on the control connection has
Expand Down Expand Up @@ -1704,8 +1704,8 @@ class crofdpt : public rofl::crofchan_env {
crofdpt_env::call_env(env).handle_negotiation_failed(*this, conn);
};

virtual void congestion_occured_indication(crofchan &chan, crofconn &conn) {
crofdpt_env::call_env(env).congestion_occured_indication(*this, conn);
virtual void congestion_occurred_indication(crofchan &chan, crofconn &conn) {
crofdpt_env::call_env(env).congestion_occurred_indication(*this, conn);
};

virtual void congestion_solved_indication(crofchan &chan, crofconn &conn) {
Expand Down
24 changes: 12 additions & 12 deletions src/rofl/common/crofsock.cc
Expand Up @@ -41,7 +41,7 @@ crofsock::crofsock(crofsock_env *env)
"!EXP !PSK !SRP !DSS"),
rx_fragment_pending(false), rxbuffer((size_t)65536), msg_bytes_read(0),
max_pkts_rcvd_per_round(0), rx_disabled(false), tx_disabled(false),
txqueue_pending_pkts(0), txqueue_size_congestion_occured(0),
txqueue_pending_pkts(0), txqueue_size_congestion_occurred(0),
txqueue_size_tx_threshold(0), txqueues(QUEUE_MAX), txweights(QUEUE_MAX),
tx_is_running(false), tx_fragment_pending(false), txbuffer((size_t)65536),
msg_bytes_sent(0), txlen(0) {
Expand Down Expand Up @@ -1492,7 +1492,7 @@ void crofsock::send_from_queue() {
::send(sd, txbuffer.somem() + msg_bytes_sent,
txlen - msg_bytes_sent, MSG_DONTWAIT | MSG_NOSIGNAL);

/* error occured */
/* error occurred */
if (nbytes < 0) {
switch (errno) {
case EAGAIN: /* socket would block */ {
Expand All @@ -1504,20 +1504,20 @@ void crofsock::send_from_queue() {
if (not flag_test(FLAG_TX_BLOCK_QUEUEING)) {
/* block transmission of further packets */
flag_set(FLAG_TX_BLOCK_QUEUEING, true);
/* remember queue size, when congestion occured */
txqueue_size_congestion_occured = txqueue_pending_pkts;
/* remember queue size, when congestion occurred */
txqueue_size_congestion_occurred = txqueue_pending_pkts;
/* threshold for re-enabling acceptance of packets */
txqueue_size_tx_threshold = txqueue_pending_pkts / 2;

VLOG(3) << __FUNCTION__ << " congestion occured"
<< " txqueue_pending_pkts" << txqueue_pending_pkts
<< " txqueue_size_congestion_occured"
<< txqueue_size_congestion_occured
<< " txqueue_size_tx_threshold"
VLOG(3) << __FUNCTION__ << " congestion occurred"
<< " txqueue_pending_pkts: " << txqueue_pending_pkts
<< " txqueue_size_congestion_occurred: "
<< txqueue_size_congestion_occurred
<< " txqueue_size_tx_threshold: "
<< txqueue_size_tx_threshold << " laddr=" << laddr.str()
<< " raddr=" << raddr.str();

crofsock_env::call_env(env).congestion_occured_indication(*this);
crofsock_env::call_env(env).congestion_occurred_indication(*this);
}
}
return;
Expand Down Expand Up @@ -1563,8 +1563,8 @@ void crofsock::send_from_queue() {
flag_set(FLAG_TX_BLOCK_QUEUEING, false);
VLOG(3) << __FUNCTION__ << " congestion solved"
<< " txqueue_pending_pkts" << txqueue_pending_pkts
<< " txqueue_size_congestion_occured"
<< txqueue_size_congestion_occured
<< " txqueue_size_congestion_occurred"
<< txqueue_size_congestion_occurred
<< " txqueue_size_tx_threshold" << txqueue_size_tx_threshold
<< " laddr=" << laddr.str() << " raddr=" << raddr.str();

Expand Down
10 changes: 5 additions & 5 deletions src/rofl/common/crofsock.h
Expand Up @@ -205,7 +205,7 @@ class crofsock_env {

virtual void handle_recv(crofsock &socket, rofl::openflow::cofmsg *msg) = 0;

virtual void congestion_occured_indication(crofsock &socket) = 0;
virtual void congestion_occurred_indication(crofsock &socket) = 0;

virtual void congestion_solved_indication(crofsock &socket) = 0;

Expand Down Expand Up @@ -383,14 +383,14 @@ class crofsock : public cthread_env {
* @brief Returns capacity of transmission queues in messages
*/
size_t get_txqueue_max_size() const {
return txqueue_size_congestion_occured;
return txqueue_size_congestion_occurred;
};

/**
* @brief Sets capacity of transmission queues in messages
*/
crofsock &set_txqueue_max_size(size_t txqueue_max_size) {
this->txqueue_size_congestion_occured = txqueue_max_size;
this->txqueue_size_congestion_occurred = txqueue_max_size;
for (unsigned int queue_id = 0; queue_id < QUEUE_MAX; queue_id++) {
txqueues[queue_id].set_queue_max_size(txqueue_max_size);
}
Expand Down Expand Up @@ -772,8 +772,8 @@ class crofsock : public cthread_env {
// number of packets waiting for transmission
std::atomic_uint txqueue_pending_pkts;

// size of tx queue when congestion occured
unsigned int txqueue_size_congestion_occured;
// size of tx queue when congestion occurred
unsigned int txqueue_size_congestion_occurred;

// size of tx queue for reallowing transmissions
unsigned int txqueue_size_tx_threshold;
Expand Down
4 changes: 2 additions & 2 deletions src/rofl/common/openflow/cofportstats.h
Expand Up @@ -470,8 +470,8 @@ class cofport_stats_reply {
<< std::endl;
os << "<tx-errors: " << (unsigned long long)r.get_tx_errors() << " >"
<< std::endl;
os << "<rx-frame-err: " << (unsigned long long)r.get_rx_frame_err()
<< " >" << std::endl;
os << "<rx-frame-err: " << (unsigned long long)r.get_rx_frame_err() << " >"
<< std::endl;
os << "<rx-over-err: " << (unsigned long long)r.get_rx_over_err() << " >"
<< std::endl;
os << "<rx-crc-err: " << (unsigned long long)r.get_rx_crc_err() << " >"
Expand Down