Rich Lane | 1ac4300 | 2013-12-03 12:56:35 -0800 | [diff] [blame] | 1 | -- binary |
| 2 | 04 13 # version, type |
| 3 | 00 68 # 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 04 # subtype |
| 10 | |
| 11 | # entries[0] |
| 12 | 00 28 # length |
| 13 | 00 00 # table id |
| 14 | 74 61 62 6c 65 20 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # name |
| 15 | 00 00 00 20 # buckets_size |
| 16 | |
| 17 | # entries[1] |
| 18 | 00 28 # length |
| 19 | 00 01 # table id |
| 20 | 74 61 62 6c 65 20 31 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e # name |
| 21 | 00 00 00 40 # buckets_size |
| 22 | -- python |
| 23 | ofp.message.bsn_gentable_desc_stats_reply( |
| 24 | xid=0x12345678, |
| 25 | entries=[ |
| 26 | ofp.bsn_gentable_desc_stats_entry( |
| 27 | table_id=0, |
| 28 | name="table 0", |
| 29 | buckets_size=32), |
| 30 | ofp.bsn_gentable_desc_stats_entry( |
| 31 | table_id=1, |
| 32 | name="table 1".ljust(32, '.'), |
| 33 | buckets_size=64), |
| 34 | ]) |
| 35 | -- java |
| 36 | builder.setXid(0x12345678) |
| 37 | .setEntries( |
| 38 | ImmutableList.<OFBsnGentableDescStatsEntry>of( |
| 39 | factory.buildBsnGentableDescStatsEntry() |
| 40 | .setTableId(0) |
| 41 | .setName("table 0") |
| 42 | .setBucketsSize(32) |
| 43 | .build(), |
| 44 | factory.buildBsnGentableDescStatsEntry() |
| 45 | .setTableId(1) |
| 46 | .setName("table 1.........................") |
| 47 | .setBucketsSize(64) |
| 48 | .build() |
| 49 | ) |
| 50 | ) |
| 51 | -- c |
| 52 | obj = of_bsn_gentable_desc_stats_reply_new(OF_VERSION_1_3); |
| 53 | of_bsn_gentable_desc_stats_reply_xid_set(obj, 0x12345678); |
| 54 | { |
| 55 | of_object_t *list = of_list_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3); |
| 56 | { |
| 57 | of_table_name_t name = "table 0"; |
| 58 | of_object_t *entry = of_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3); |
| 59 | of_bsn_gentable_desc_stats_entry_table_id_set(entry, 0); |
| 60 | of_bsn_gentable_desc_stats_entry_name_set(entry, name); |
| 61 | of_bsn_gentable_desc_stats_entry_buckets_size_set(entry, 32); |
| 62 | of_list_append(list, entry); |
| 63 | of_object_delete(entry); |
| 64 | } |
| 65 | { |
| 66 | of_table_name_t name = "table 1........................."; |
| 67 | of_object_t *entry = of_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3); |
| 68 | of_bsn_gentable_desc_stats_entry_table_id_set(entry, 1); |
| 69 | of_bsn_gentable_desc_stats_entry_name_set(entry, name); |
| 70 | of_bsn_gentable_desc_stats_entry_buckets_size_set(entry, 64); |
| 71 | of_list_append(list, entry); |
| 72 | of_object_delete(entry); |
| 73 | } |
| 74 | of_bsn_gentable_desc_stats_reply_entries_set(obj, list); |
| 75 | of_object_delete(list); |
| 76 | } |