Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 1 | -- binary |
| 2 | 04 13 # version, type |
| 3 | 00 60 # length |
| 4 | 12 34 56 78 # xid |
| 5 | ff ff # stats_type |
| 6 | 00 00 # flags |
| 7 | 00 00 00 00 # pad |
| 8 | 00 5c 16 c7 # experimenter |
| 9 | 00 00 00 03 # subtype |
| 10 | |
| 11 | # entries[0] |
| 12 | 00 24 # length |
| 13 | 00 08 # key_length |
| 14 | 00 00 # key[0].type |
| 15 | 00 08 # key[0].length |
| 16 | 00 00 00 05 # key[0].value |
| 17 | 00 02 # stats[0].type |
| 18 | 00 0c # stats[0].length |
| 19 | 00 00 00 00 00 00 00 64 # stats[0].value |
| 20 | 00 03 # stats[0].type |
| 21 | 00 0c # stats[0].length |
| 22 | 00 00 00 00 00 00 00 65 # stats[0].value |
| 23 | |
| 24 | # entries[1] |
| 25 | 00 24 # length |
| 26 | 00 08 # key_length |
| 27 | 00 00 # key[0].type |
| 28 | 00 08 # key[0].length |
| 29 | 00 00 00 06 # key[0].value |
| 30 | 00 02 # stats[0].type |
| 31 | 00 0c # stats[0].length |
| 32 | 00 00 00 00 00 00 00 64 # stats[0].value |
| 33 | 00 03 # stats[0].type |
| 34 | 00 0c # stats[0].length |
| 35 | 00 00 00 00 00 00 00 65 # stats[0].value |
| 36 | -- python |
| 37 | ofp.message.bsn_gentable_entry_stats_reply( |
| 38 | xid=0x12345678, |
| 39 | entries=[ |
| 40 | ofp.bsn_gentable_entry_stats_entry( |
| 41 | key=[ |
| 42 | ofp.bsn_tlv.port(5), |
| 43 | ], |
| 44 | stats=[ |
| 45 | ofp.bsn_tlv.rx_packets(100), |
| 46 | ofp.bsn_tlv.tx_packets(101), |
| 47 | ]), |
| 48 | ofp.bsn_gentable_entry_stats_entry( |
| 49 | key=[ |
| 50 | ofp.bsn_tlv.port(6), |
| 51 | ], |
| 52 | stats=[ |
| 53 | ofp.bsn_tlv.rx_packets(100), |
| 54 | ofp.bsn_tlv.tx_packets(101), |
| 55 | ]), |
| 56 | ]) |
| 57 | -- java |
| 58 | builder.setXid(0x12345678) |
| 59 | .setEntries( |
| 60 | ImmutableList.<OFBsnGentableEntryStatsEntry>of( |
| 61 | factory.bsnGentableEntryStatsEntry( |
| 62 | ImmutableList.<OFBsnTlv>of( |
Andreas Wundsam | d4b2269 | 2014-01-14 14:17:26 -0800 | [diff] [blame] | 63 | factory.bsnTlvs().port(OFPort.of(5)) |
Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 64 | ), |
| 65 | ImmutableList.<OFBsnTlv>of( |
Andreas Wundsam | d4b2269 | 2014-01-14 14:17:26 -0800 | [diff] [blame] | 66 | factory.bsnTlvs().rxPackets(U64.of(100)), |
| 67 | factory.bsnTlvs().txPackets(U64.of(101)) |
Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 68 | ) |
| 69 | ), |
| 70 | factory.bsnGentableEntryStatsEntry( |
| 71 | ImmutableList.<OFBsnTlv>of( |
Andreas Wundsam | d4b2269 | 2014-01-14 14:17:26 -0800 | [diff] [blame] | 72 | factory.bsnTlvs().port(OFPort.of(6)) |
Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 73 | ), |
| 74 | ImmutableList.<OFBsnTlv>of( |
Andreas Wundsam | d4b2269 | 2014-01-14 14:17:26 -0800 | [diff] [blame] | 75 | factory.bsnTlvs().rxPackets(U64.of(100)), |
| 76 | factory.bsnTlvs().txPackets(U64.of(101)) |
Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 77 | ) |
| 78 | ) |
| 79 | ) |
| 80 | ) |
| 81 | -- c |
| 82 | obj = of_bsn_gentable_entry_stats_reply_new(OF_VERSION_1_3); |
| 83 | of_bsn_gentable_entry_stats_reply_xid_set(obj, 0x12345678); |
| 84 | { |
| 85 | of_object_t *list = of_list_bsn_gentable_entry_stats_entry_new(OF_VERSION_1_3); |
| 86 | { |
| 87 | of_object_t *entry = of_bsn_gentable_entry_stats_entry_new(OF_VERSION_1_3); |
| 88 | { |
| 89 | of_object_t *tlvs = of_list_bsn_tlv_new(OF_VERSION_1_3); |
| 90 | { |
| 91 | of_object_t *tlv = of_bsn_tlv_port_new(OF_VERSION_1_3); |
| 92 | of_bsn_tlv_port_value_set(tlv, 5); |
| 93 | of_list_append(tlvs, tlv); |
| 94 | of_object_delete(tlv); |
| 95 | } |
| 96 | of_bsn_gentable_entry_stats_entry_key_set(entry, tlvs); |
| 97 | of_object_delete(tlvs); |
| 98 | } |
| 99 | { |
| 100 | of_object_t *tlvs = of_list_bsn_tlv_new(OF_VERSION_1_3); |
| 101 | { |
| 102 | of_object_t *tlv = of_bsn_tlv_rx_packets_new(OF_VERSION_1_3); |
| 103 | of_bsn_tlv_rx_packets_value_set(tlv, 100); |
| 104 | of_list_append(tlvs, tlv); |
| 105 | of_object_delete(tlv); |
| 106 | } |
| 107 | { |
| 108 | of_object_t *tlv = of_bsn_tlv_tx_packets_new(OF_VERSION_1_3); |
| 109 | of_bsn_tlv_tx_packets_value_set(tlv, 101); |
| 110 | of_list_append(tlvs, tlv); |
| 111 | of_object_delete(tlv); |
| 112 | } |
| 113 | of_bsn_gentable_entry_stats_entry_stats_set(entry, tlvs); |
| 114 | of_object_delete(tlvs); |
| 115 | } |
| 116 | of_list_append(list, entry); |
| 117 | of_object_delete(entry); |
| 118 | } |
| 119 | { |
| 120 | of_object_t *entry = of_bsn_gentable_entry_stats_entry_new(OF_VERSION_1_3); |
| 121 | { |
| 122 | of_object_t *tlvs = of_list_bsn_tlv_new(OF_VERSION_1_3); |
| 123 | { |
| 124 | of_object_t *tlv = of_bsn_tlv_port_new(OF_VERSION_1_3); |
| 125 | of_bsn_tlv_port_value_set(tlv, 6); |
| 126 | of_list_append(tlvs, tlv); |
| 127 | of_object_delete(tlv); |
| 128 | } |
| 129 | of_bsn_gentable_entry_stats_entry_key_set(entry, tlvs); |
| 130 | of_object_delete(tlvs); |
| 131 | } |
| 132 | { |
| 133 | of_object_t *tlvs = of_list_bsn_tlv_new(OF_VERSION_1_3); |
| 134 | { |
| 135 | of_object_t *tlv = of_bsn_tlv_rx_packets_new(OF_VERSION_1_3); |
| 136 | of_bsn_tlv_rx_packets_value_set(tlv, 100); |
| 137 | of_list_append(tlvs, tlv); |
| 138 | of_object_delete(tlv); |
| 139 | } |
| 140 | { |
| 141 | of_object_t *tlv = of_bsn_tlv_tx_packets_new(OF_VERSION_1_3); |
| 142 | of_bsn_tlv_tx_packets_value_set(tlv, 101); |
| 143 | of_list_append(tlvs, tlv); |
| 144 | of_object_delete(tlv); |
| 145 | } |
| 146 | of_bsn_gentable_entry_stats_entry_stats_set(entry, tlvs); |
| 147 | of_object_delete(tlvs); |
| 148 | } |
| 149 | of_list_append(list, entry); |
| 150 | of_object_delete(entry); |
| 151 | } |
| 152 | of_bsn_gentable_entry_stats_reply_entries_set(obj, list); |
| 153 | of_object_delete(list); |
| 154 | } |