blob: 180a8a18d9b35ee197e7ea7132798dde5d3d269f [file] [log] [blame]
Rich Lane1ac43002013-12-03 12:56:35 -08001-- binary
204 13 # version, type
Rich Lane7b2a8b62014-01-02 14:00:49 -0800300 78 # length
Rich Lane1ac43002013-12-03 12:56:35 -0800412 34 56 78 # xid
5ff ff # stats_type
600 00 # flags
700 00 00 00 # pad
800 5c 16 c7 # experimenter
900 00 00 04 # subtype
10
11# entries[0]
Rich Lane7b2a8b62014-01-02 14:00:49 -08001200 30 # length
Rich Lane1ac43002013-12-03 12:56:35 -08001300 00 # table id
1474 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
1500 00 00 20 # buckets_size
Rich Lane7b2a8b62014-01-02 14:00:49 -08001600 00 00 40 # max_entries
1700 00 00 00 # pad
Rich Lane1ac43002013-12-03 12:56:35 -080018
19# entries[1]
Rich Lane7b2a8b62014-01-02 14:00:49 -08002000 30 # length
Rich Lane1ac43002013-12-03 12:56:35 -08002100 01 # table id
2274 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
2300 00 00 40 # buckets_size
Rich Lane7b2a8b62014-01-02 14:00:49 -08002400 00 00 80 # max_entries
2500 00 00 00 # pad
Rich Lane1ac43002013-12-03 12:56:35 -080026-- python
27ofp.message.bsn_gentable_desc_stats_reply(
28 xid=0x12345678,
29 entries=[
30 ofp.bsn_gentable_desc_stats_entry(
31 table_id=0,
32 name="table 0",
Rich Lane7b2a8b62014-01-02 14:00:49 -080033 buckets_size=32,
34 max_entries=64),
Rich Lane1ac43002013-12-03 12:56:35 -080035 ofp.bsn_gentable_desc_stats_entry(
36 table_id=1,
37 name="table 1".ljust(32, '.'),
Rich Lane7b2a8b62014-01-02 14:00:49 -080038 buckets_size=64,
39 max_entries=128),
Rich Lane1ac43002013-12-03 12:56:35 -080040 ])
41-- java
42builder.setXid(0x12345678)
43 .setEntries(
44 ImmutableList.<OFBsnGentableDescStatsEntry>of(
45 factory.buildBsnGentableDescStatsEntry()
Andreas Wundsamd4b22692014-01-14 14:17:26 -080046 .setTableId(GenTableId.of(0))
Rich Lane1ac43002013-12-03 12:56:35 -080047 .setName("table 0")
48 .setBucketsSize(32)
Rich Lane7b2a8b62014-01-02 14:00:49 -080049 .setMaxEntries(64)
Rich Lane1ac43002013-12-03 12:56:35 -080050 .build(),
51 factory.buildBsnGentableDescStatsEntry()
Andreas Wundsamd4b22692014-01-14 14:17:26 -080052 .setTableId(GenTableId.of(1))
Rich Lane1ac43002013-12-03 12:56:35 -080053 .setName("table 1.........................")
54 .setBucketsSize(64)
Rich Lane7b2a8b62014-01-02 14:00:49 -080055 .setMaxEntries(128)
Rich Lane1ac43002013-12-03 12:56:35 -080056 .build()
57 )
58 )
59-- c
60obj = of_bsn_gentable_desc_stats_reply_new(OF_VERSION_1_3);
61of_bsn_gentable_desc_stats_reply_xid_set(obj, 0x12345678);
62{
63 of_object_t *list = of_list_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3);
64 {
65 of_table_name_t name = "table 0";
66 of_object_t *entry = of_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3);
67 of_bsn_gentable_desc_stats_entry_table_id_set(entry, 0);
68 of_bsn_gentable_desc_stats_entry_name_set(entry, name);
69 of_bsn_gentable_desc_stats_entry_buckets_size_set(entry, 32);
Rich Lane7b2a8b62014-01-02 14:00:49 -080070 of_bsn_gentable_desc_stats_entry_max_entries_set(entry, 64);
Rich Lane1ac43002013-12-03 12:56:35 -080071 of_list_append(list, entry);
72 of_object_delete(entry);
73 }
74 {
75 of_table_name_t name = "table 1.........................";
76 of_object_t *entry = of_bsn_gentable_desc_stats_entry_new(OF_VERSION_1_3);
77 of_bsn_gentable_desc_stats_entry_table_id_set(entry, 1);
78 of_bsn_gentable_desc_stats_entry_name_set(entry, name);
79 of_bsn_gentable_desc_stats_entry_buckets_size_set(entry, 64);
Rich Lane7b2a8b62014-01-02 14:00:49 -080080 of_bsn_gentable_desc_stats_entry_max_entries_set(entry, 128);
Rich Lane1ac43002013-12-03 12:56:35 -080081 of_list_append(list, entry);
82 of_object_delete(entry);
83 }
84 of_bsn_gentable_desc_stats_reply_entries_set(obj, list);
85 of_object_delete(list);
86}