blob: 3e1223706e6e105a55165116bffec4304a68dad7 [file] [log] [blame]
Rich Lane46cbb632013-11-15 15:18:32 -08001-- binary
204 13 # version, type
300 3c # length
412 34 56 78 # xid
5ff ff # stats_type
600 00 # flags
700 00 00 00 # pad
800 5c 16 c7 # experimenter
900 00 00 1 # subtype
1000 00 f1 11 # entries[0].port_no
11f2 22 # entries[0].actor_sys_priority
1201 02 03 04 05 06 # entries[0].actor_sys_mac
13f3 33 # entries[0].actor_port_priority
14f4 44 # entries[0].actor_port_num
15f5 55 # entries[0].actor_port_key
1602 # entries[0].convergence_status
1700 # pad
18f6 66 # entries[0].partner_sys_priority
190a 0b 0c 0d 0e 0f # entries[0].partner_sys_mac
20f7 77 # entries[0].partner_port_priority
21f8 88 # entries[0].partner_port_num
22f9 99 # entries[0].partner_port_key
2300 00 # pad
24-- python
25ofp.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
43obj = of_bsn_lacp_stats_reply_new(OF_VERSION_1_3);
44of_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}