OpenFlow statistics. More...
#include "openflow-interface.h"
Classes | |
struct | FlowStatsState |
State of the FlowStats request/reply. More... | |
struct | PortStatsState |
State of the PortStats request/reply. More... | |
Public Member Functions | |
Stats (ofp_stats_types _type, size_t body_len) | |
Constructor. More... | |
void | DoCleanup (void *state) |
Cleans any state created by the init or dump functions. More... | |
int | DoDump (Ptr< OpenFlowSwitchNetDevice > swtch, void *state, ofpbuf *buffer) |
Appends statistics for OpenFlowSwitchNetDevice to 'buffer'. More... | |
int | DoInit (const void *body, int body_len, void **state) |
Prepares to dump some kind of statistics on the connected OpenFlowSwitchNetDevice. More... | |
Public Attributes | |
ofp_stats_types | type |
Status type. More... | |
Private Member Functions | |
int | DescStatsDump (void *state, ofpbuf *buffer) |
Dumps the stats description. More... | |
int | FlowStatsInit (const void *body, int body_len, void **state) |
Initialize the stats. More... | |
int | AggregateStatsInit (const void *body, int body_len, void **state) |
Initialize the stats. More... | |
int | PortStatsInit (const void *body, int body_len, void **state) |
Initialize the stats. More... | |
int | FlowStatsDump (Ptr< OpenFlowSwitchNetDevice > dp, FlowStatsState *state, ofpbuf *buffer) |
Dump the stats. More... | |
int | AggregateStatsDump (Ptr< OpenFlowSwitchNetDevice > dp, ofp_aggregate_stats_request *state, ofpbuf *buffer) |
Dump the stats. More... | |
int | TableStatsDump (Ptr< OpenFlowSwitchNetDevice > dp, void *state, ofpbuf *buffer) |
Dump the stats. More... | |
int | PortStatsDump (Ptr< OpenFlowSwitchNetDevice > dp, PortStatsState *state, ofpbuf *buffer) |
Dump the stats. More... | |
int | PortTableStatsDump (Ptr< OpenFlowSwitchNetDevice > dp, void *state, ofpbuf *buffer) |
Dump the stats. More... | |
Private Attributes | |
int(* | AggregateDumpCallback )(sw_flow *flow, void *state) |
Aggregate dump callback functor. More... | |
int(* | FlowDumpCallback )(sw_flow *flow, void *state) |
Flow dump callback functor. More... | |
OpenFlow statistics.
Definition at line 147 of file openflow-interface.h.
ns3::ofi::Stats::Stats | ( | ofp_stats_types | _type, |
size_t | body_len | ||
) |
Constructor.
_type | OpenFlow stats type. |
body_len | Stat body length. |
Definition at line 30 of file openflow-interface.cc.
References max, NS_LOG_ERROR, and type.
|
private |
Dump the stats.
dp | OpenFlow NetDevice. | |
state | State. | |
[out] | buffer | output buffer. |
Definition at line 252 of file openflow-interface.cc.
References AggregateDumpCallback, and openflow-switch::swtch.
Referenced by DoDump().
|
private |
Initialize the stats.
body | Body member of the struct ofp_stats_request. |
body_len | Length of the body member. |
state | State information. |
Definition at line 234 of file openflow-interface.cc.
Referenced by DoInit().
|
private |
Dumps the stats description.
[in] | state | The state. |
[out] | buffer | Output buffer. |
Definition at line 143 of file openflow-interface.cc.
References ns3::OpenFlowSwitchNetDevice::GetHardwareDescription(), ns3::OpenFlowSwitchNetDevice::GetManufacturerDescription(), ns3::OpenFlowSwitchNetDevice::GetSerialNumber(), and ns3::OpenFlowSwitchNetDevice::GetSoftwareDescription().
Referenced by DoDump().
void ns3::ofi::Stats::DoCleanup | ( | void * | state | ) |
Cleans any state created by the init or dump functions.
May not be implemented if no cleanup is required.
state | State information to clear. |
Definition at line 117 of file openflow-interface.cc.
References type.
Referenced by ns3::OpenFlowSwitchNetDevice::StatsDone().
int ns3::ofi::Stats::DoDump | ( | Ptr< OpenFlowSwitchNetDevice > | swtch, |
void * | state, | ||
ofpbuf * | buffer | ||
) |
Appends statistics for OpenFlowSwitchNetDevice to 'buffer'.
swtch | The OpenFlowSwitchNetDevice this callback is associated with. |
state | State information. |
buffer | Buffer to append stats reply to. |
Definition at line 93 of file openflow-interface.cc.
References AggregateStatsDump(), DescStatsDump(), FlowStatsDump(), PortStatsDump(), PortTableStatsDump(), openflow-switch::swtch, TableStatsDump(), and type.
Referenced by ns3::OpenFlowSwitchNetDevice::StatsDump().
int ns3::ofi::Stats::DoInit | ( | const void * | body, |
int | body_len, | ||
void ** | state | ||
) |
Prepares to dump some kind of statistics on the connected OpenFlowSwitchNetDevice.
body | Body member of the struct ofp_stats_request. |
body_len | Length of the body member. |
state | State information. |
Definition at line 69 of file openflow-interface.cc.
References AggregateStatsInit(), FlowStatsInit(), PortStatsInit(), and type.
Referenced by ns3::OpenFlowSwitchNetDevice::ReceiveStatsRequest().
|
private |
Dump the stats.
dp | OpenFlow NetDevice. | |
state | State. | |
[out] | buffer | output buffer. |
Definition at line 204 of file openflow-interface.cc.
References ns3::ofi::Stats::FlowStatsState::buffer, FlowDumpCallback, MAX_FLOW_STATS_BYTES, ns3::ofi::Stats::FlowStatsState::now, ns3::ofi::Stats::FlowStatsState::position, ns3::ofi::Stats::FlowStatsState::rq, openflow-switch::swtch, and ns3::ofi::Stats::FlowStatsState::table_idx.
Referenced by DoDump().
|
private |
Initialize the stats.
body | Body member of the struct ofp_stats_request. |
body_len | Length of the body member. |
state | State information. |
Definition at line 158 of file openflow-interface.cc.
Referenced by DoInit().
|
private |
Dump the stats.
dp | OpenFlow NetDevice. | |
state | State. | |
[out] | buffer | output buffer. |
Definition at line 340 of file openflow-interface.cc.
References ns3::ofi::Port::mpls_ttl0_dropped, ns3::ofi::Port::netdev, NS_LOG_ERROR, ns3::ofi::Stats::PortStatsState::num_ports, port, ns3::ofi::Stats::PortStatsState::ports, ns3::ofi::Port::rx_bytes, ns3::ofi::Port::rx_packets, openflow-switch::swtch, ns3::ofi::Port::tx_bytes, ns3::ofi::Port::tx_dropped, and ns3::ofi::Port::tx_packets.
Referenced by DoDump().
|
private |
Initialize the stats.
body | Body member of the struct ofp_stats_request. |
body_len | Length of the body member. |
state | State information. |
Definition at line 326 of file openflow-interface.cc.
Referenced by DoInit().
|
private |
Dump the stats.
dp | OpenFlow NetDevice. | |
state | State. | |
[out] | buffer | output buffer. |
Definition at line 313 of file openflow-interface.cc.
References openflow-switch::swtch.
Referenced by DoDump().
|
private |
Dump the stats.
dp | OpenFlow NetDevice. | |
state | State. | |
[out] | buffer | output buffer. |
Definition at line 292 of file openflow-interface.cc.
References openflow-switch::swtch.
Referenced by DoDump().
|
private |
Aggregate dump callback functor.
Definition at line 236 of file openflow-interface.h.
Referenced by AggregateStatsDump().
|
private |
Flow dump callback functor.
Definition at line 234 of file openflow-interface.h.
Referenced by FlowStatsDump().
ofp_stats_types ns3::ofi::Stats::type |
Status type.
Definition at line 210 of file openflow-interface.h.
Referenced by Stats(), DoCleanup(), DoDump(), DoInit(), and ns3::OpenFlowSwitchNetDevice::StatsDump().