コード例 #1
0
void
crofconntest::handle_listen(
		rofl::crofsock& socket)
{


	for (auto sd : socket.accept()) {

		std::cerr << "crofconntest::handle_listen() sd=" << sd << std::endl;

		switch (test_mode) {
		case TEST_MODE_TCP: {
			versionbitmap_ctl.add_ofp_version(rofl::openflow10::OFP_VERSION);
			versionbitmap_ctl.add_ofp_version(rofl::openflow12::OFP_VERSION);
			versionbitmap_ctl.add_ofp_version(rofl::openflow13::OFP_VERSION);

			(sserver = new rofl::crofconn(this))->set_trace(trace);
			sserver->set_journal().log_on_stderr(trace);
			sserver->set_tcp_journal().log_on_stderr(trace);
			sserver->set_trace(trace).
					tcp_accept(sd, versionbitmap_ctl, rofl::crofconn::MODE_CONTROLLER);

		} break;
		default: {

		};
		}
	}
}
コード例 #2
0
ファイル: crofchantest.cpp プロジェクト: akoepsel/rofl-common
void crofchantest::handle_listen(rofl::crofsock &socket) {
  rofl::AcquireReadWriteLock lock(tlock);
  for (auto sd : socket.accept()) {
    num_of_accepts++;
    LOG(INFO) << "num_of_accepts = " << num_of_accepts << std::endl;

    rofl::crofconn *conn = new rofl::crofconn(this);
    {
      rofl::AcquireReadWriteLock lock(plock);
      pending_conns.insert(conn);
      LOG(INFO) << "crofchantest::handle_listen() pending_conns: "
                << pending_conns.size() << std::endl;
    }
    conn->tcp_accept(sd, versionbitmap, rofl::crofconn::MODE_CONTROLLER);
  }
}
コード例 #3
0
ファイル: crofconntest.cpp プロジェクト: akoepsel/rofl-common
void crofconntest::handle_listen(rofl::crofsock &socket) {

  for (auto sd : socket.accept()) {

    LOG(INFO) << "crofconntest::handle_listen() sd=" << sd << std::endl;

    switch (test_mode) {
    case TEST_MODE_TCP: {
      versionbitmap_ctl.add_ofp_version(rofl::openflow10::OFP_VERSION);
      versionbitmap_ctl.add_ofp_version(rofl::openflow12::OFP_VERSION);
      versionbitmap_ctl.add_ofp_version(rofl::openflow13::OFP_VERSION);

      sserver = new rofl::crofconn(this);
      sserver->tcp_accept(sd, versionbitmap_ctl,
                          rofl::crofconn::MODE_CONTROLLER);

    } break;
    default: {};
    }
  }
}