12 #include "openflow/openflow.h"
13 #include "croflexception.h"
15 #include "rofl/common/cctlid.h"
16 #include "rofl/common/csocket.h"
17 #include "rofl/common/crofchan.h"
18 #include "openflow/messages/cofmsg.h"
19 #include "rofl/common/openflow/cofport.h"
20 #include "rofl/common/openflow/cofports.h"
21 #include "rofl/common/openflow/coftables.h"
22 #include "rofl/common/openflow/cofasyncconfig.h"
23 #include "rofl/common/openflow/cofrole.h"
24 #include "rofl/common/openflow/cofdescstats.h"
25 #include "rofl/common/openflow/cofaggrstats.h"
26 #include "rofl/common/openflow/cofgroupfeaturesstats.h"
27 #include "rofl/common/openflow/cofpacketqueues.h"
28 #include "rofl/common/openflow/cofflowstatsarray.h"
29 #include "rofl/common/openflow/coftablestatsarray.h"
30 #include "rofl/common/openflow/cofportstatsarray.h"
31 #include "rofl/common/openflow/cofqueuestatsarray.h"
32 #include "rofl/common/openflow/cofgroupstatsarray.h"
33 #include "rofl/common/openflow/cofgroupdescstatsarray.h"
34 #include "rofl/common/openflow/cofmeterstatsarray.h"
35 #include "rofl/common/openflow/cofmeterconfigarray.h"
36 #include "rofl/common/openflow/cofmeterfeatures.h"
37 #include "rofl/common/cauxid.h"
39 #include "rofl/common/ciosrv.h"
40 #include "rofl/common/thread_helper.h"
41 #include "rofl/common/logging.h"
42 #include "rofl/common/openflow/cofmatch.h"
43 #include "rofl/common/openflow/cofhelloelemversionbitmap.h"
44 #include "rofl/common/ctransactions.h"
79 static std::set<crofctl_env*> rofctl_envs;
86 { crofctl_env::rofctl_envs.insert(
this); };
93 { crofctl_env::rofctl_envs.erase(
this); };
221 rofl::crofctl& ctl, uint32_t role, uint64_t rcvd_generation_id)
720 enum crofctl_timer_t {
721 TIMER_RUN_ENGINE = 0,
724 enum crofctl_event_t {
726 EVENT_CHAN_TERMINATED = 1,
727 EVENT_CONN_TERMINATED = 2,
728 EVENT_CONN_REFUSED = 3,
729 EVENT_CONN_FAILED = 4,
732 enum crofctl_flag_t {
733 FLAG_ENGINE_IS_RUNNING = (1 << 0),
760 bool remove_on_channel_close,
764 rofchan(this, versionbitmap),
766 remove_on_channel_close(remove_on_channel_close),
767 async_config_role_default_template(rofl::openflow13::OFP_VERSION),
768 async_config(rofl::openflow13::OFP_VERSION) {
769 rofl::logging::debug <<
"[rofl-common][crofctl] "
770 <<
"instance created, ctlid: " << ctlid.str() << std::endl;
771 init_async_config_role_default_template();
773 crofctl::rofctls[ctlid] =
this;
783 rofl::logging::debug <<
"[rofl-common][crofctl] "
784 <<
"instance destroyed, ctlid: " << ctlid.str() << std::endl;
785 crofctl::rofctls.erase(ctlid);
817 std::list<rofl::cauxid>
819 {
return rofchan.get_conn_index(); };
839 enum rofl::csocket::socket_type_t socket_type,
841 { rofchan.
add_conn(auxid, socket_type, socket_params); };
854 { rofchan.drop_conn(auxid); };
889 {
return rofchan.is_established(); };
898 {
return rofchan.get_version(); };
906 {
return rofchan.get_versionbitmap(); };
913 {
return remove_on_channel_close; };
922 {
return rofchan.get_conn(auxid).get_rofsocket().get_socket().get_raddr(); };
959 {
return async_config; };
966 {
return async_config; };
973 {
return async_config_role_default_template; };
1010 uint32_t capabilities,
1011 uint8_t of13_auxiliary_id = 0,
1012 uint32_t of10_actions_bitmap = 0,
1027 uint16_t miss_send_len);
1042 uint16_t stats_type,
1043 uint16_t stats_flags,
1044 uint8_t *body = NULL,
1045 size_t bodylen = 0);
1059 uint16_t stats_flags = 0);
1073 uint16_t stats_flags = 0);
1087 uint16_t stats_flags = 0);
1101 uint16_t stats_flags = 0);
1115 uint16_t stats_flags = 0);
1129 uint16_t stats_flags = 0);
1143 uint16_t stats_flags = 0);
1157 uint16_t stats_flags = 0);
1171 uint16_t stats_flags = 0);
1185 uint16_t stats_flags = 0);
1199 uint16_t stats_flags = 0);
1219 uint16_t stats_flags = 0);
1234 uint16_t stats_flags = 0);
1249 uint16_t stats_flags = 0);
1264 uint16_t stats_flags = 0);
1317 uint8_t* data = NULL,
1318 size_t datalen = 0);
1334 uint32_t experimenter_id,
1336 uint8_t *body = NULL,
1337 size_t bodylen = 0);
1362 uint32_t duration_sec,
1363 uint32_t duration_nsec,
1364 uint16_t idle_timeout,
1365 uint16_t hard_timeout,
1366 uint64_t packet_count,
1367 uint64_t byte_count);
1424 friend std::ostream&
1425 operator<< (std::ostream& os,
const crofctl& ctl) {
1426 os <<
indent(0) <<
"<crofctl ";
1427 os <<
"ctlid:0x" << ctl.ctlid.str() <<
" ";
1428 os <<
">" << std::endl;
1436 std::stringstream ss;
1437 ss <<
"ctlid: " <<
get_ctlid().get_ctlid_s() <<
" ";
1444 handle_conn_established(
1447 rofl::logging::info <<
"[rofl-common][crofctl] ctlid:0x" << ctlid.str()
1448 <<
" control connection established, auxid: " << auxid.str() << std::endl;
1452 rofl::logging::info <<
"[rofl-common][crofctl] ctlid:0x" << ctlid.str()
1453 <<
" OFP control channel established, " << chan.str() << std::endl;
1460 handle_conn_terminated(
1463 rofl::logging::info <<
"[rofl-common][crofctl] ctlid:0x" << ctlid.str()
1464 <<
" control connection terminated, auxid: " << auxid.str() << std::endl;
1465 rofl::RwLock rwlock(conns_terminated_rwlock, rofl::RwLock::RWLOCK_WRITE);
1466 conns_terminated.push_back(auxid);
1467 push_on_eventqueue(EVENT_CONN_TERMINATED);
1470 rofl::logging::info <<
"[rofl-common][crofctl] ctlid:0x" << ctlid.str()
1471 <<
" OFP control channel terminated, " << chan.str() << std::endl;
1472 transactions.clear();
1473 push_on_eventqueue(EVENT_CHAN_TERMINATED);
1478 handle_conn_refused(
1481 rofl::RwLock rwlock(conns_refused_rwlock, rofl::RwLock::RWLOCK_WRITE);
1482 conns_refused.push_back(auxid);
1483 push_on_eventqueue(EVENT_CONN_REFUSED);
1490 rofl::RwLock rwlock(conns_failed_rwlock, rofl::RwLock::RWLOCK_WRITE);
1491 conns_failed.push_back(auxid);
1492 push_on_eventqueue(EVENT_CONN_FAILED);
1510 {
return transactions.get_async_xid(); };
1515 uint8_t msg_type = 0,
1516 uint16_t msg_sub_type = 0)
1517 {
return transactions.add_ta(cclock(5), msg_type, msg_sub_type); };
1523 { transactions.drop_ta(xid); };
1540 bool operator() (
const crofctl* rofctl) {
1549 int opaque,
void *data = (
void*)0);
1553 if (crofctl_env::rofctl_envs.find(env) == crofctl_env::rofctl_envs.end()) {
1554 throw eRofCtlNotFound(
"rofl::crofctl::call_env() environment not found");
1560 init_async_config_role_default_template();
1567 enum crofctl_event_t event = EVENT_NONE) {
1568 if (EVENT_NONE != event) {
1569 events.push_back(event);
1571 if (not flags.test(FLAG_ENGINE_IS_RUNNING)) {
1577 work_on_eventqueue();
1580 event_chan_terminated();
1583 event_conn_established();
1586 event_conn_terminated();
1589 event_conn_refused();
1592 event_conn_failed();
1607 features_request_rcvd(
1612 get_config_request_rcvd(
1657 desc_stats_request_rcvd(
1662 table_stats_request_rcvd(
1667 port_stats_request_rcvd(
1672 flow_stats_request_rcvd(
1677 aggregate_stats_request_rcvd(
1682 queue_stats_request_rcvd(
1687 group_stats_request_rcvd(
1692 group_desc_stats_request_rcvd(
1697 group_features_stats_request_rcvd(
1702 meter_stats_request_rcvd(
1707 meter_config_stats_request_rcvd(
1712 meter_features_stats_request_rcvd(
1717 table_features_stats_request_rcvd(
1722 port_desc_stats_request_rcvd(
1727 experimenter_stats_request_rcvd(
1737 barrier_request_rcvd(
1742 queue_get_config_request_rcvd(
1747 get_async_config_request_rcvd(
1752 set_async_config_rcvd(
1758 static std::map<rofl::cctlid, rofl::crofctl*> rofctls;
1769 bool remove_on_channel_close;
1774 std::deque<enum crofctl_event_t> events;
1776 PthreadRwLock conns_terminated_rwlock;
1777 std::list<rofl::cauxid> conns_terminated;
1778 PthreadRwLock conns_refused_rwlock;
1779 std::list<rofl::cauxid> conns_refused;
1780 PthreadRwLock conns_failed_rwlock;
1781 std::list<rofl::cauxid> conns_failed;
1783 std::bitset<32> flags;
virtual void handle_meter_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_meter_stats_request &msg)
OpenFlow Meter-Stats-Request message received.
Definition: crofctl.h:420
virtual void handle_meter_config_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_meter_config_stats_request &msg)
OpenFlow Meter-Config-Stats-Request message received.
Definition: crofctl.h:434
void handle_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_stats_request &msg)
OpenFlow Stats-Request message received.
Definition: crofctl.h:280
cauxid const & get_aux_id() const
Return auxialiary_id.
Definition: crofconn.h:334
void send_meter_features_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofmeter_features &meter_features, uint16_t stats_flags=0)
Sends OpenFlow Meter-Features-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1393
const rofl::openflow::cofasync_config & get_async_config() const
Returns a const reference to the current asynchronous event configuration of this controller entity...
Definition: crofctl.h:965
virtual void handle_queue_get_config_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_queue_get_config_request &msg)
OpenFlow Queue-Get-Config-Request message received.
Definition: crofctl.h:588
virtual void handle_chan_terminated(rofl::crofctl &ctl)
Called after termination of associated OpenFlow control channel.
Definition: crofctl.h:130
virtual void handle_group_desc_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_group_desc_stats_request &msg)
OpenFlow Group-Desc-Stats-Request message received.
Definition: crofctl.h:392
Definition: cofmsg_group_mod.h:21
virtual void handle_desc_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_desc_stats_request &msg)
OpenFlow Desc-Stats-Request message received.
Definition: crofctl.h:294
Definition: cofmsg_queue_get_config.h:22
void send_packet_in_message(const rofl::cauxid &auxid, uint32_t buffer_id, uint16_t total_len, uint8_t reason, uint8_t table_id, uint64_t cookie, uint16_t in_port, const rofl::openflow::cofmatch &match, uint8_t *data, size_t datalen)
Sends OpenFlow Packet-In message to attached controller entity.
Definition: crofctl.cc:1427
Definition: cofmeterconfigarray.h:19
Environment expected by a rofl::crofctl instance.
Definition: crofctl.h:77
void send_table_features_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::coftables &tables, uint16_t stats_flags=0)
Sends OpenFlow Table-Features-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1219
Definition: cofmsg_table_mod.h:19
Definition: cofmsg_experimenter.h:19
Definition: cofmeterfeatures.h:22
virtual void handle_set_async_config(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_set_async_config &msg)
OpenFlow Set-Async-Config message received.
Definition: crofctl.h:672
virtual void handle_table_features_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_table_features_stats_request &msg)
OpenFlow Table-Features-Stats-Request message received.
Definition: crofctl.h:462
Definition: cofmsg_meter_mod.h:20
virtual void handle_port_mod(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_port_mod &msg)
OpenFlow Port-Mod message received.
Definition: crofctl.h:574
Definition: cofhelloelemversionbitmap.h:22
Definition: cofmsg_port_desc_stats.h:22
virtual void handle_get_config_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_get_config_request &msg)
OpenFlow Get-Config-Request message received.
Definition: crofctl.h:266
const rofl::openflow::cofasync_config & get_async_config_role_default_template() const
Returns a const reference to the default asynchronous event configuration for controller entities def...
Definition: crofctl.h:972
virtual void handle_meter_mod(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_meter_mod &msg)
OpenFlow Meter-Mod message received.
Definition: crofctl.h:686
rofl::openflow::cofrole & set_role()
Returns a reference to the current role object of this controller entity.
Definition: crofctl.h:938
void send_queue_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofqueuestatsarray &queuestatsarray, uint16_t stats_flags=0)
Sends OpenFlow Queue-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1083
Definition: caddress.h:30
virtual void handle_port_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_port_stats_request &msg)
OpenFlow Port-Stats-Request message received.
Definition: crofctl.h:322
virtual void handle_conn_failed(rofl::crofctl &ctl, const rofl::cauxid &auxid)
Called when an attempt to establish a control connection has been failed.
Definition: crofctl.h:185
virtual void handle_get_async_config_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_get_async_config_request &msg)
OpenFlow Get-Async-Config-Request message received.
Definition: crofctl.h:658
virtual void handle_experimenter_message(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_experimenter &msg)
OpenFlow Experimenter message received.
Definition: crofctl.h:616
Definition: cofflowstatsarray.h:19
virtual void handle_group_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_group_stats_request &msg)
OpenFlow Group-Stats-Request message received.
Definition: crofctl.h:378
Definition: cofdescstats.h:18
void send_table_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::coftablestatsarray &tablestatsarray, uint16_t stats_flags=0)
Sends OpenFlow Table-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1015
Definition: cofmsg_async_config.h:20
virtual void handle_chan_established(rofl::crofctl &ctl)
Called after establishing the associated OpenFlow control channel.
Definition: crofctl.h:114
void send_get_async_config_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofasync_config &async_config)
Sends OpenFlow Get-Async-Config-Reply message to attached controller entity.
Definition: crofctl.cc:1730
Definition: cofmsg_desc_stats.h:21
Definition: cofmsg_meter_features_stats.h:23
void send_error_message(const rofl::cauxid &auxid, uint32_t xid, uint16_t type, uint16_t code, uint8_t *data=NULL, size_t datalen=0)
Sends OpenFlow Error message to attached controller entity.
Definition: crofctl.cc:1536
rofl::openflow::cofasync_config & set_async_config()
Returns a reference to the current asynchronous event configuration of this controller entity...
Definition: crofctl.h:958
Definition: cofmsg_port_mod.h:20
Definition: cofmsg_error.h:21
virtual void handle_conn_writable(rofl::crofctl &ctl, const rofl::cauxid &auxid)
Called when a congestion situation on the control connection has been solved.
Definition: crofctl.h:207
void send_group_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofgroupstatsarray &groupstatsarray, uint16_t stats_flags=0)
Sends OpenFlow Group-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1117
Environment expected by a rofl::crofchan instance.
Definition: crofchan.h:40
virtual void handle_table_mod(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_table_mod &msg)
OpenFlow Table-Mod message received.
Definition: crofctl.h:560
virtual void handle_error_message(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_error &msg)
OpenFlow error message received.
Definition: crofctl.h:630
Definition: cofmsg_table_features_stats.h:22
Definition: cofmsg_stats.h:187
std::list< rofl::cauxid > get_conn_index() const
Returns a list of connection identifiers of all existing control connections.
Definition: crofctl.h:818
virtual ~crofctl()
crofctl destructor
Definition: crofctl.h:782
Definition: cofasyncconfig.h:24
void send_experimenter_stats_reply(const rofl::cauxid &auxid, uint32_t xid, uint32_t exp_id, uint32_t exp_type, const cmemory &body, uint16_t stats_flags=0)
Sends OpenFlow Experimenter-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1287
Definition: cofmsg_group_desc_stats.h:22
A single OpenFlow control connection.
Definition: crofconn.h:145
Definition: cofmatch.h:35
bool remove_on_channel_termination() const
Returns true, when this instance should be destroyed when its crofchan has closed.
Definition: crofctl.h:912
virtual void handle_features_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_features_request &msg)
OpenFlow Features-Request message received.
Definition: crofctl.h:252
virtual void handle_flow_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_flow_stats_request &msg)
OpenFlow Flow-Stats-Request message received.
Definition: crofctl.h:336
Definition: cofgroupfeaturesstats.h:21
Definition: cofgroupdescstatsarray.h:20
Definition: cofmsg_stats.h:19
Definition: cofmsg_barrier.h:19
Definition: cofmsg_table_stats.h:23
virtual void handle_table_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_table_stats_request &msg)
OpenFlow Table-Stats-Request message received.
Definition: crofctl.h:308
virtual void handle_role_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_role_request &msg)
OpenFlow Role-Request message received.
Definition: crofctl.h:644
virtual void handle_queue_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_queue_stats_request &msg)
OpenFlow Queue-Stats-Request message received.
Definition: crofctl.h:364
Definition: cofmsg_meter_config_stats.h:23
void send_role_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofrole &role)
Sends OpenFlow Role-Reply message to attached controller entity.
Definition: crofctl.cc:1504
void send_port_desc_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofports &ports, uint16_t stats_flags=0)
Sends OpenFlow Port-Desc-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1253
Definition: cofportstatsarray.h:19
Definition: ctransaction.h:17
bool is_slave() const
Returns true, when the control entity is in role -slave-.
Definition: crofctl.cc:125
Definition: cofmsg_config.h:19
const rofl::ctimerid & register_timer(int opaque, const rofl::ctimespec ×pec)
Installs a new timer to fire in t seconds.
Definition: ciosrv.h:698
Definition: cofgroupstatsarray.h:19
Definition: cofmsg_port_stats.h:23
static rofl::crofctl & get_ctl(const rofl::cctlid &ctlid)
Returns reference to rofl::crofctl instance identified by rofl-common's internal identifier.
Definition: crofctl.cc:17
virtual void handle_barrier_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_barrier_request &msg)
OpenFlow Barrier-Request message received.
Definition: crofctl.h:518
Definition: cofmeterstatsarray.h:19
crofctl_env()
rofl::crofctl_env constructor
Definition: crofctl.h:85
Definition: cofmsg_group_features_stats.h:20
Definition: coftablestatsarray.h:19
virtual void handle_experimenter_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_experimenter_stats_request &msg)
OpenFlow Experimenter-Stats-Request message received.
Definition: crofctl.h:490
Definition: cofmsg_packet_out.h:21
Definition: cofports.h:22
bool is_established() const
Returns true, when the control handshake (HELLO) has been completed.
Definition: crofctl.h:888
Definition: thread_helper.h:88
virtual void handle_group_features_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_group_features_stats_request &msg)
OpenFlow Group-Features-Stats-Request message received.
Definition: crofctl.h:406
void send_port_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofportstatsarray &portstatsarray, uint16_t stats_flags=0)
Sends OpenFlow Port-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1049
const rofl::openflow::cofhello_elem_versionbitmap & get_versions_available() const
Returns the defined OpenFlow version bitmap for this instance.
Definition: crofctl.h:905
Definition: cofqueuestatsarray.h:19
Definition: coftables.h:27
virtual void role_request_rcvd(rofl::crofctl &ctl, uint32_t role, uint64_t rcvd_generation_id)
called once a cofctl instance has received a role request
Definition: crofctl.h:220
Definition: cofmsg_role.h:20
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
void send_port_status_message(const rofl::cauxid &auxid, uint8_t reason, const rofl::openflow::cofport &port)
Sends OpenFlow Port-Status message to attached controller entity.
Definition: crofctl.cc:1663
Definition: cofmsg_aggr_stats.h:20
virtual void handle_port_desc_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_port_desc_stats_request &msg)
OpenFlow Port-Desc-Stats-Request message received.
Definition: crofctl.h:476
void send_meter_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofmeterstatsarray &meter_stats_array, uint16_t stats_flags=0)
Sends OpenFlow Meter-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1325
Definition: cofmsg_queue_stats.h:23
void send_queue_get_config_reply(const rofl::cauxid &auxid, uint32_t xid, uint32_t portno, const rofl::openflow::cofpacket_queues &queues)
Sends OpenFlow Queue-Get-Config-Reply message to attached controller entity.
Definition: crofctl.cc:1696
void send_experimenter_message(const rofl::cauxid &auxid, uint32_t xid, uint32_t experimenter_id, uint32_t exp_type, uint8_t *body=NULL, size_t bodylen=0)
Sends OpenFlow Experimenter message to attached controller entity.
Definition: crofctl.cc:1573
void send_group_features_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofgroup_features_stats_reply &group_features_stats, uint16_t stats_flags=0)
Sends OpenFlow Group-Features-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1185
Definition: cofmsg_flow_mod.h:20
Definition: cofmsg_flow_stats.h:29
rofl-common's internal remote controller handle.
Definition: cctlid.h:24
const rofl::cctlid & get_ctlid() const
Returns rofl-common's internal rofl::cctlid identifier for this instance.
Definition: crofctl.h:794
void send_features_reply(const rofl::cauxid &auxid, uint32_t xid, uint64_t dpid, uint32_t n_buffers, uint8_t n_tables, uint32_t capabilities, uint8_t of13_auxiliary_id=0, uint32_t of10_actions_bitmap=0, const rofl::openflow::cofports &ports=rofl::openflow::cofports())
Sends OpenFlow Features-Reply message to attached controller entity.
Definition: crofctl.cc:797
virtual ~crofctl_env()
rofl::crofctl_env destructor
Definition: crofctl.h:92
Definition: crofctl.h:1536
void send_get_config_reply(const rofl::cauxid &auxid, uint32_t xid, uint16_t flags, uint16_t miss_send_len)
Sends OpenFlow Get-Config-Reply message to attached controller entity.
Definition: crofctl.cc:841
void send_barrier_reply(const rofl::cauxid &auxid, uint32_t xid)
Sends OpenFlow Barrier-Reply message to attached controller entity.
Definition: crofctl.cc:1474
void send_aggr_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofaggr_stats_reply &aggr_stats, uint16_t stats_flags=0)
Sends OpenFlow Aggregate-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:981
void connect(const rofl::cauxid &auxid, enum rofl::csocket::socket_type_t socket_type, const rofl::cparams &socket_params)
Establishes a new control connection to a remote controller entity with the given control connection ...
Definition: crofctl.h:837
void send_flow_removed_message(const rofl::cauxid &auxid, const rofl::openflow::cofmatch &match, uint64_t cookie, uint16_t priority, uint8_t reason, uint8_t table_id, uint32_t duration_sec, uint32_t duration_nsec, uint16_t idle_timeout, uint16_t hard_timeout, uint64_t packet_count, uint64_t byte_count)
Sends OpenFlow Flow-Removed message to attached controller entity.
Definition: crofctl.cc:1612
crofctl(crofctl_env *env, const cctlid &ctlid, bool remove_on_channel_close, const rofl::openflow::cofhello_elem_versionbitmap &versionbitmap)
crofctl constructor
Definition: crofctl.h:757
Base class for IO services.
Definition: ciosrv.h:491
virtual void handle_flow_mod(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_flow_mod &msg)
OpenFlow Flow-Mod message received.
Definition: crofctl.h:532
void disconnect(const rofl::cauxid &auxid)
Terminates an existing control connection with given identifier.
Definition: crofctl.h:852
virtual void handle_conn_terminated(rofl::crofctl &ctl, const rofl::cauxid &auxid)
Called when a control connection (main or auxiliary) has been terminated by the peer entity...
Definition: crofctl.h:153
const rofl::openflow::cofrole & get_role() const
Returns a const reference to the current role object of this controller entity.
Definition: crofctl.h:945
void send_stats_reply(const rofl::cauxid &auxid, uint32_t xid, uint16_t stats_type, uint16_t stats_flags, uint8_t *body=NULL, size_t bodylen=0)
Sends OpenFlow Stats-Reply message to attached controller entity.
Definition: crofctl.cc:875
Time specification used by class rofl::ctimer object.
Definition: ctimespec.h:25
uint8_t get_version_negotiated() const
Returns the OpenFlow protocol version used for this control connection.
Definition: crofctl.h:897
Definition: ctransactions.h:27
Definition: cofmsg_group_stats.h:21
Definition: cofmsg_features.h:22
Definition: cofmsg_meter_stats.h:23
virtual void handle_conn_established(rofl::crofctl &ctl, const rofl::cauxid &auxid)
Called when a control connection (main or auxiliary) has been established.
Definition: crofctl.h:141
virtual void handle_packet_out(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_packet_out &msg)
OpenFlow Packet-Out message received.
Definition: crofctl.h:504
void send_desc_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofdesc_stats_reply &desc_stats, uint16_t stats_flags=0)
Sends OpenFlow Desc-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:912
Definition: cofaggrstats.h:251
virtual void handle_meter_features_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_meter_features_stats_request &msg)
OpenFlow Meter-Features-Stats-Request message received.
Definition: crofctl.h:448
virtual void handle_group_mod(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_group_mod &msg)
OpenFlow Group-Mod message received.
Definition: crofctl.h:546
void send_flow_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofflowstatsarray &flow_stats, uint16_t stats_flags=0)
Sends OpenFlow Flow-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:946
virtual void handle_conn_refused(rofl::crofctl &ctl, const rofl::cauxid &auxid)
Called when an attempt to establish a control connection has been refused.
Definition: crofctl.h:169
Definition: cofmsg_async_config.h:226
void add_connection(crofconn *conn)
Add an existing rofl::crofconn instance created on heap to this object.
Definition: crofctl.h:866
void send_meter_config_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofmeterconfigarray &meter_config_array, uint16_t stats_flags=0)
Sends OpenFlow Meter-Config-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1359
Definition: cofmsg_experimenter_stats.h:21
virtual void handle_aggregate_stats_request(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_aggr_stats_request &msg)
OpenFlow Aggregate-Stats-Request message received.
Definition: crofctl.h:350
rofl::caddress get_peer_addr(const rofl::cauxid &auxid) const
Returns caddress of connected remote entity for given connection identifier.
Definition: crofctl.h:921
void send_group_desc_stats_reply(const rofl::cauxid &auxid, uint32_t xid, const rofl::openflow::cofgroupdescstatsarray &groupdescs, uint16_t stats_flags=0)
Sends OpenFlow Group-Desc-Stats-Reply message to attached controller entity.
Definition: crofctl.cc:1151
An OpenFlow control channel grouping multiple control connections.
Definition: crofchan.h:154
Definition: cofmsg_config.h:332
crofconn & add_conn(const cauxid &aux_id, enum rofl::csocket::socket_type_t socket_type, cparams const &socket_params)
Add a new connection while creating a new crofconn instance and do a socket connect.
Definition: crofchan.cc:69
virtual void handle_set_config(rofl::crofctl &ctl, const rofl::cauxid &auxid, rofl::openflow::cofmsg_set_config &msg)
OpenFlow Set-Config message received.
Definition: crofctl.h:602
Definition: cofpacketqueues.h:19
Definition: ctransactions.h:35
Definition: croflexception.h:27
Class representing a remote controller entity.
Definition: crofctl.h:715