blob: 4378387766fa86cb5c78d1d71562fd168d8ffc5a [file] [log] [blame]
Rich Laneb1f347d2013-05-16 16:39:12 -07001-- binary
201 11 # version/type
300 dc # length
400 00 00 05 # xid
500 04 # stats_type
600 00 # flags
700 01 # entries[0].port_no
800 00 00 00 00 00 # entries[0].pad
900 00 00 00 00 00 00 38 # entries[0].rx_packets
1000 00 00 00 00 00 00 00 # entries[0].tx_packets
1100 00 00 00 00 00 00 00 # entries[0].rx_bytes
1200 00 00 00 00 00 00 00 # entries[0].tx_bytes
1300 00 00 00 00 00 00 00 # entries[0].rx_dropped
1400 00 00 00 00 00 00 00 # entries[0].tx_dropped
1500 00 00 00 00 00 00 00 # entries[0].rx_errors
1600 00 00 00 00 00 00 00 # entries[0].tx_errors
1700 00 00 00 00 00 00 00 # entries[0].rx_frame_err
1800 00 00 00 00 00 00 00 # entries[0].rx_over_err
1900 00 00 00 00 00 00 00 # entries[0].rx_crc_err
2000 00 00 00 00 00 00 05 # entries[0].collisions
21ff fe # entries[1].port_no
2200 00 00 00 00 00 # entries[1].pad
2300 00 00 00 00 00 00 01 # entries[1].rx_packets
2400 00 00 00 00 00 00 00 # entries[1].tx_packets
2500 00 00 00 00 00 00 00 # entries[1].rx_bytes
2600 00 00 00 00 00 00 00 # entries[1].tx_bytes
2700 00 00 00 00 00 00 00 # entries[1].rx_dropped
2800 00 00 00 00 00 00 00 # entries[1].tx_dropped
2900 00 00 00 00 00 00 00 # entries[1].rx_errors
3000 00 00 00 00 00 00 00 # entries[1].tx_errors
3100 00 00 00 00 00 00 00 # entries[1].rx_frame_err
3200 00 00 00 00 00 00 00 # entries[1].rx_over_err
3300 00 00 00 00 00 00 00 # entries[1].rx_crc_err
3400 00 00 00 00 00 00 01 # entries[1].collisions
35-- python
36ofp.message.port_stats_reply(
37 xid=5, flags=0, entries=[
38 ofp.port_stats_entry(port_no=1, rx_packets=56, collisions=5),
39 ofp.port_stats_entry(port_no=ofp.OFPP_LOCAL, rx_packets=1, collisions=1)])
Rich Laneccae0312013-07-21 23:34:13 -070040-- c
41obj = of_port_stats_reply_new(OF_VERSION_1_0);
42{
43 of_object_t list;
44 of_port_stats_reply_entries_bind(obj, &list);
45 {
46 of_object_t *obj = of_port_stats_entry_new(OF_VERSION_1_0);
47 of_port_stats_entry_collisions_set(obj, 5);
48 of_port_stats_entry_port_no_set(obj, 1);
49 of_port_stats_entry_rx_bytes_set(obj, 0);
50 of_port_stats_entry_rx_crc_err_set(obj, 0);
51 of_port_stats_entry_rx_dropped_set(obj, 0);
52 of_port_stats_entry_rx_errors_set(obj, 0);
53 of_port_stats_entry_rx_frame_err_set(obj, 0);
54 of_port_stats_entry_rx_over_err_set(obj, 0);
55 of_port_stats_entry_rx_packets_set(obj, 56);
56 of_port_stats_entry_tx_bytes_set(obj, 0);
57 of_port_stats_entry_tx_dropped_set(obj, 0);
58 of_port_stats_entry_tx_errors_set(obj, 0);
59 of_port_stats_entry_tx_packets_set(obj, 0);
60 of_list_append(&list, obj);
61 of_object_delete(obj);
62 }
63 {
64 of_object_t *obj = of_port_stats_entry_new(OF_VERSION_1_0);
65 of_port_stats_entry_collisions_set(obj, 1);
66 of_port_stats_entry_port_no_set(obj, 65534);
67 of_port_stats_entry_rx_bytes_set(obj, 0);
68 of_port_stats_entry_rx_crc_err_set(obj, 0);
69 of_port_stats_entry_rx_dropped_set(obj, 0);
70 of_port_stats_entry_rx_errors_set(obj, 0);
71 of_port_stats_entry_rx_frame_err_set(obj, 0);
72 of_port_stats_entry_rx_over_err_set(obj, 0);
73 of_port_stats_entry_rx_packets_set(obj, 1);
74 of_port_stats_entry_tx_bytes_set(obj, 0);
75 of_port_stats_entry_tx_dropped_set(obj, 0);
76 of_port_stats_entry_tx_errors_set(obj, 0);
77 of_port_stats_entry_tx_packets_set(obj, 0);
78 of_list_append(&list, obj);
79 of_object_delete(obj);
80 }
81}
82of_port_stats_reply_flags_set(obj, 0);
83of_port_stats_reply_xid_set(obj, 5);