Rich Lane | b1f347d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | 01 11 # version/type |
| 3 | 00 dc # length |
| 4 | 00 00 00 05 # xid |
| 5 | 00 04 # stats_type |
| 6 | 00 00 # flags |
| 7 | 00 01 # entries[0].port_no |
| 8 | 00 00 00 00 00 00 # entries[0].pad |
| 9 | 00 00 00 00 00 00 00 38 # entries[0].rx_packets |
| 10 | 00 00 00 00 00 00 00 00 # entries[0].tx_packets |
| 11 | 00 00 00 00 00 00 00 00 # entries[0].rx_bytes |
| 12 | 00 00 00 00 00 00 00 00 # entries[0].tx_bytes |
| 13 | 00 00 00 00 00 00 00 00 # entries[0].rx_dropped |
| 14 | 00 00 00 00 00 00 00 00 # entries[0].tx_dropped |
| 15 | 00 00 00 00 00 00 00 00 # entries[0].rx_errors |
| 16 | 00 00 00 00 00 00 00 00 # entries[0].tx_errors |
| 17 | 00 00 00 00 00 00 00 00 # entries[0].rx_frame_err |
| 18 | 00 00 00 00 00 00 00 00 # entries[0].rx_over_err |
| 19 | 00 00 00 00 00 00 00 00 # entries[0].rx_crc_err |
| 20 | 00 00 00 00 00 00 00 05 # entries[0].collisions |
| 21 | ff fe # entries[1].port_no |
| 22 | 00 00 00 00 00 00 # entries[1].pad |
| 23 | 00 00 00 00 00 00 00 01 # entries[1].rx_packets |
| 24 | 00 00 00 00 00 00 00 00 # entries[1].tx_packets |
| 25 | 00 00 00 00 00 00 00 00 # entries[1].rx_bytes |
| 26 | 00 00 00 00 00 00 00 00 # entries[1].tx_bytes |
| 27 | 00 00 00 00 00 00 00 00 # entries[1].rx_dropped |
| 28 | 00 00 00 00 00 00 00 00 # entries[1].tx_dropped |
| 29 | 00 00 00 00 00 00 00 00 # entries[1].rx_errors |
| 30 | 00 00 00 00 00 00 00 00 # entries[1].tx_errors |
| 31 | 00 00 00 00 00 00 00 00 # entries[1].rx_frame_err |
| 32 | 00 00 00 00 00 00 00 00 # entries[1].rx_over_err |
| 33 | 00 00 00 00 00 00 00 00 # entries[1].rx_crc_err |
| 34 | 00 00 00 00 00 00 00 01 # entries[1].collisions |
| 35 | -- python |
| 36 | ofp.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 Lane | ccae031 | 2013-07-21 23:34:13 -0700 | [diff] [blame] | 40 | -- c |
| 41 | obj = 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 | } |
| 82 | of_port_stats_reply_flags_set(obj, 0); |
| 83 | of_port_stats_reply_xid_set(obj, 5); |