blob: 4378387766fa86cb5c78d1d71562fd168d8ffc5a [file] [log] [blame]
-- binary
01 11 # version/type
00 dc # length
00 00 00 05 # xid
00 04 # stats_type
00 00 # flags
00 01 # entries[0].port_no
00 00 00 00 00 00 # entries[0].pad
00 00 00 00 00 00 00 38 # entries[0].rx_packets
00 00 00 00 00 00 00 00 # entries[0].tx_packets
00 00 00 00 00 00 00 00 # entries[0].rx_bytes
00 00 00 00 00 00 00 00 # entries[0].tx_bytes
00 00 00 00 00 00 00 00 # entries[0].rx_dropped
00 00 00 00 00 00 00 00 # entries[0].tx_dropped
00 00 00 00 00 00 00 00 # entries[0].rx_errors
00 00 00 00 00 00 00 00 # entries[0].tx_errors
00 00 00 00 00 00 00 00 # entries[0].rx_frame_err
00 00 00 00 00 00 00 00 # entries[0].rx_over_err
00 00 00 00 00 00 00 00 # entries[0].rx_crc_err
00 00 00 00 00 00 00 05 # entries[0].collisions
ff fe # entries[1].port_no
00 00 00 00 00 00 # entries[1].pad
00 00 00 00 00 00 00 01 # entries[1].rx_packets
00 00 00 00 00 00 00 00 # entries[1].tx_packets
00 00 00 00 00 00 00 00 # entries[1].rx_bytes
00 00 00 00 00 00 00 00 # entries[1].tx_bytes
00 00 00 00 00 00 00 00 # entries[1].rx_dropped
00 00 00 00 00 00 00 00 # entries[1].tx_dropped
00 00 00 00 00 00 00 00 # entries[1].rx_errors
00 00 00 00 00 00 00 00 # entries[1].tx_errors
00 00 00 00 00 00 00 00 # entries[1].rx_frame_err
00 00 00 00 00 00 00 00 # entries[1].rx_over_err
00 00 00 00 00 00 00 00 # entries[1].rx_crc_err
00 00 00 00 00 00 00 01 # entries[1].collisions
-- python
ofp.message.port_stats_reply(
xid=5, flags=0, entries=[
ofp.port_stats_entry(port_no=1, rx_packets=56, collisions=5),
ofp.port_stats_entry(port_no=ofp.OFPP_LOCAL, rx_packets=1, collisions=1)])
-- c
obj = of_port_stats_reply_new(OF_VERSION_1_0);
{
of_object_t list;
of_port_stats_reply_entries_bind(obj, &list);
{
of_object_t *obj = of_port_stats_entry_new(OF_VERSION_1_0);
of_port_stats_entry_collisions_set(obj, 5);
of_port_stats_entry_port_no_set(obj, 1);
of_port_stats_entry_rx_bytes_set(obj, 0);
of_port_stats_entry_rx_crc_err_set(obj, 0);
of_port_stats_entry_rx_dropped_set(obj, 0);
of_port_stats_entry_rx_errors_set(obj, 0);
of_port_stats_entry_rx_frame_err_set(obj, 0);
of_port_stats_entry_rx_over_err_set(obj, 0);
of_port_stats_entry_rx_packets_set(obj, 56);
of_port_stats_entry_tx_bytes_set(obj, 0);
of_port_stats_entry_tx_dropped_set(obj, 0);
of_port_stats_entry_tx_errors_set(obj, 0);
of_port_stats_entry_tx_packets_set(obj, 0);
of_list_append(&list, obj);
of_object_delete(obj);
}
{
of_object_t *obj = of_port_stats_entry_new(OF_VERSION_1_0);
of_port_stats_entry_collisions_set(obj, 1);
of_port_stats_entry_port_no_set(obj, 65534);
of_port_stats_entry_rx_bytes_set(obj, 0);
of_port_stats_entry_rx_crc_err_set(obj, 0);
of_port_stats_entry_rx_dropped_set(obj, 0);
of_port_stats_entry_rx_errors_set(obj, 0);
of_port_stats_entry_rx_frame_err_set(obj, 0);
of_port_stats_entry_rx_over_err_set(obj, 0);
of_port_stats_entry_rx_packets_set(obj, 1);
of_port_stats_entry_tx_bytes_set(obj, 0);
of_port_stats_entry_tx_dropped_set(obj, 0);
of_port_stats_entry_tx_errors_set(obj, 0);
of_port_stats_entry_tx_packets_set(obj, 0);
of_list_append(&list, obj);
of_object_delete(obj);
}
}
of_port_stats_reply_flags_set(obj, 0);
of_port_stats_reply_xid_set(obj, 5);