Rich Lane | 46cbb63 | 2013-11-15 15:18:32 -0800 | [diff] [blame^] | 1 | -- binary |
| 2 | 04 13 # version, type |
| 3 | 00 3c # 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 1 # subtype |
| 10 | 00 00 f1 11 # entries[0].port_no |
| 11 | f2 22 # entries[0].actor_sys_priority |
| 12 | 01 02 03 04 05 06 # entries[0].actor_sys_mac |
| 13 | f3 33 # entries[0].actor_port_priority |
| 14 | f4 44 # entries[0].actor_port_num |
| 15 | f5 55 # entries[0].actor_port_key |
| 16 | 02 # entries[0].convergence_status |
| 17 | 00 # pad |
| 18 | f6 66 # entries[0].partner_sys_priority |
| 19 | 0a 0b 0c 0d 0e 0f # entries[0].partner_sys_mac |
| 20 | f7 77 # entries[0].partner_port_priority |
| 21 | f8 88 # entries[0].partner_port_num |
| 22 | f9 99 # entries[0].partner_port_key |
| 23 | 00 00 # pad |
| 24 | -- python |
| 25 | ofp.message.bsn_lacp_stats_reply( |
| 26 | xid=0x12345678, |
| 27 | flags=0, |
| 28 | entries=[ |
| 29 | ofp.bsn_lacp_stats_entry( |
| 30 | port_no=0xf111, |
| 31 | actor_sys_priority=0xf222, |
| 32 | actor_sys_mac=[1, 2, 3, 4, 5, 6], |
| 33 | actor_port_priority=0xf333, |
| 34 | actor_port_num=0xf444, |
| 35 | actor_key=0xf555, |
| 36 | convergence_status=ofp.LACP_OUT_OF_SYNC, |
| 37 | partner_sys_priority=0xf666, |
| 38 | partner_sys_mac=[0xa, 0xb, 0xc, 0xd, 0xe, 0xf], |
| 39 | partner_port_priority=0xf777, |
| 40 | partner_port_num=0xf888, |
| 41 | partner_key=0xf999)]) |
| 42 | -- c |
| 43 | obj = of_bsn_lacp_stats_reply_new(OF_VERSION_1_3); |
| 44 | of_bsn_lacp_stats_reply_xid_set(obj, 0x12345678); |
| 45 | { |
| 46 | of_object_t *entries = of_list_bsn_lacp_stats_entry_new(OF_VERSION_1_3); |
| 47 | { |
| 48 | of_object_t *elem = of_bsn_lacp_stats_entry_new(OF_VERSION_1_3); |
| 49 | of_bsn_lacp_stats_entry_port_no_set(elem, 0xf111); |
| 50 | of_bsn_lacp_stats_entry_actor_sys_priority_set(elem, 0xf222); |
| 51 | { |
| 52 | of_mac_addr_t mac = { { 1, 2, 3, 4, 5, 6 } }; |
| 53 | of_bsn_lacp_stats_entry_actor_sys_mac_set(elem, mac); |
| 54 | } |
| 55 | of_bsn_lacp_stats_entry_actor_port_priority_set(elem, 0xf333); |
| 56 | of_bsn_lacp_stats_entry_actor_port_num_set(elem, 0xf444); |
| 57 | of_bsn_lacp_stats_entry_actor_key_set(elem, 0xf555); |
| 58 | of_bsn_lacp_stats_entry_partner_sys_priority_set(elem, 0xf666); |
| 59 | of_bsn_lacp_stats_entry_convergence_status_set(elem, LACP_OUT_OF_SYNC); |
| 60 | { |
| 61 | of_mac_addr_t mac = { { 0xa, 0xb, 0xc, 0xd, 0xe, 0xf } }; |
| 62 | of_bsn_lacp_stats_entry_partner_sys_mac_set(elem, mac); |
| 63 | } |
| 64 | of_bsn_lacp_stats_entry_partner_port_priority_set(elem, 0xf777); |
| 65 | of_bsn_lacp_stats_entry_partner_port_num_set(elem, 0xf888); |
| 66 | of_bsn_lacp_stats_entry_partner_key_set(elem, 0xf999); |
| 67 | of_list_append(entries, elem); |
| 68 | of_object_delete(elem); |
| 69 | } |
| 70 | of_bsn_lacp_stats_reply_entries_set(obj, entries); |
| 71 | of_object_delete(entries); |
| 72 | } |