blob: 185235b2a6a01ea9a2262def34639370a99fc4ac [file] [log] [blame]
Rich Laneb1f347d2013-05-16 16:39:12 -07001-- binary
201 11 # version/type
300 e4 # length
400 00 00 06 # xid
500 01 # stats_type
600 00 # flags
700 68 # entries[0].length
803 # entries[0].table_id
900 # entries[0].pad
1000 3f ff ff # entries[0].match.wildcards
1100 00 00 00 # remaining match fields
1200 00 00 00 00 00 00 00 # ...
1300 00 00 00 00 00 00 00 # ...
1400 00 00 00 00 00 00 00 # ...
1500 00 00 00 00 00 00 00 # ...
1600 00 00 01 # entries[0].duration_sec
1700 00 00 02 # entries[0].duration_nsec
1800 64 # entries[0].priority
1900 05 # entries[0].idle_timeout
2000 0a # entries[0].hard_timeout
2100 00 00 00 00 00 # pad
2201 23 45 67 89 ab cd ef # entries[0].cookie
2300 00 00 00 00 00 00 0a # entries[0].packet_count
2400 00 00 00 00 00 03 e8 # entries[0].byte_count
2500 00 # entries[0].actions[0].type
2600 08 # entries[0].actions[0].len
2700 01 # entries[0].actions[0].port
2800 00 # entries[0].actions[0].max_len
2900 00 # entries[0].actions[1].type
3000 08 # entries[0].actions[1].len
3100 02 # entries[0].actions[1].port
3200 00 # entries[0].actions[1].max_len
3300 70 # entries[1].length
3404 # entries[1].table_id
3500 # entries[1].pad
3600 3f ff ff # entries[1].match.wildcards
3700 00 00 00 # remaining match fields
3800 00 00 00 00 00 00 00 # ...
3900 00 00 00 00 00 00 00 # ...
4000 00 00 00 00 00 00 00 # ...
4100 00 00 00 00 00 00 00 # ...
4200 00 00 01 # entries[1].duration_sec
4300 00 00 02 # entries[1].duration_nsec
4400 64 # entries[1].priority
4500 05 # entries[1].idle_timeout
4600 0a # entries[1].hard_timeout
4700 00 00 00 00 00 # pad
4801 23 45 67 89 ab cd ef # entries[1].cookie
4900 00 00 00 00 00 00 0a # entries[1].packet_count
5000 00 00 00 00 00 03 e8 # entries[1].byte_count
5100 00 # entries[1].actions[0].type
5200 08 # entries[1].actions[0].len
5300 01 # entries[1].actions[0].port
5400 00 # entries[1].actions[0].max_len
5500 00 # entries[1].actions[1].type
5600 08 # entries[1].actions[1].len
5700 02 # entries[1].actions[1].port
5800 00 # entries[1].actions[1].max_len
5900 00 # entries[1].actions[2].type
6000 08 # entries[1].actions[2].len
6100 03 # entries[1].actions[2].port
6200 00 # entries[1].actions[2].max_len
63-- python
64ofp.message.flow_stats_reply(
65 xid=6,
66 flags=0,
67 entries=[
68 ofp.flow_stats_entry(table_id=3,
69 match=ofp.match(),
70 duration_sec=1,
71 duration_nsec=2,
72 priority=100,
73 idle_timeout=5,
74 hard_timeout=10,
75 cookie=0x0123456789abcdef,
76 packet_count=10,
77 byte_count=1000,
78 actions=[ofp.action.output(port=1),
79 ofp.action.output(port=2)]),
80 ofp.flow_stats_entry(table_id=4,
81 match=ofp.match(),
82 duration_sec=1,
83 duration_nsec=2,
84 priority=100,
85 idle_timeout=5,
86 hard_timeout=10,
87 cookie=0x0123456789abcdef,
88 packet_count=10,
89 byte_count=1000,
90 actions=[ofp.action.output(port=1),
91 ofp.action.output(port=2),
92 ofp.action.output(port=3)])])
Rich Laneccae0312013-07-21 23:34:13 -070093-- c
94obj = of_flow_stats_reply_new(OF_VERSION_1_0);
95of_flow_stats_reply_flags_set(obj, 0);
96of_flow_stats_reply_xid_set(obj, 6);
97{
98 of_object_t *entries = of_list_flow_stats_entry_new(OF_VERSION_1_0);
99 {
100 of_object_t *elem = of_flow_stats_entry_new(OF_VERSION_1_0);
101 of_flow_stats_entry_byte_count_set(elem, 1000);
102 of_flow_stats_entry_cookie_set(elem, 81985529216486895);
103 of_flow_stats_entry_duration_nsec_set(elem, 2);
104 of_flow_stats_entry_duration_sec_set(elem, 1);
105 of_flow_stats_entry_hard_timeout_set(elem, 10);
106 of_flow_stats_entry_idle_timeout_set(elem, 5);
107 of_flow_stats_entry_packet_count_set(elem, 10);
108 of_flow_stats_entry_priority_set(elem, 100);
109 of_flow_stats_entry_table_id_set(elem, 3);
110 {
111 of_match_t match = { OF_VERSION_1_0 };
112 of_flow_stats_entry_match_set(elem, &match);
113 }
114 {
115 of_object_t *actions = of_list_action_new(OF_VERSION_1_0);
116 {
117 of_object_t *elem = of_action_output_new(OF_VERSION_1_0);
118 of_action_output_max_len_set(elem, 0);
119 of_action_output_port_set(elem, 1);
120 of_list_append(actions, elem);
121 of_object_delete(elem);
122 }
123 {
124 of_object_t *elem = of_action_output_new(OF_VERSION_1_0);
125 of_action_output_max_len_set(elem, 0);
126 of_action_output_port_set(elem, 2);
127 of_list_append(actions, elem);
128 of_object_delete(elem);
129 }
130 of_flow_stats_entry_actions_set(elem, actions);
131 of_object_delete(actions);
132 }
133 of_list_append(entries, elem);
134 of_object_delete(elem);
135 }
136 {
137 of_object_t *elem = of_flow_stats_entry_new(OF_VERSION_1_0);
138 of_flow_stats_entry_byte_count_set(elem, 1000);
139 of_flow_stats_entry_cookie_set(elem, 81985529216486895);
140 of_flow_stats_entry_duration_nsec_set(elem, 2);
141 of_flow_stats_entry_duration_sec_set(elem, 1);
142 of_flow_stats_entry_hard_timeout_set(elem, 10);
143 of_flow_stats_entry_idle_timeout_set(elem, 5);
144 of_flow_stats_entry_packet_count_set(elem, 10);
145 of_flow_stats_entry_priority_set(elem, 100);
146 of_flow_stats_entry_table_id_set(elem, 4);
147 {
148 of_match_t match = { OF_VERSION_1_0 };
149 of_flow_stats_entry_match_set(elem, &match);
150 }
151 {
152 of_object_t *actions = of_list_action_new(OF_VERSION_1_0);
153 {
154 of_object_t *elem = of_action_output_new(OF_VERSION_1_0);
155 of_action_output_max_len_set(elem, 0);
156 of_action_output_port_set(elem, 1);
157 of_list_append(actions, elem);
158 of_object_delete(elem);
159 }
160 {
161 of_object_t *elem = of_action_output_new(OF_VERSION_1_0);
162 of_action_output_max_len_set(elem, 0);
163 of_action_output_port_set(elem, 2);
164 of_list_append(actions, elem);
165 of_object_delete(elem);
166 }
167 {
168 of_object_t *elem = of_action_output_new(OF_VERSION_1_0);
169 of_action_output_max_len_set(elem, 0);
170 of_action_output_port_set(elem, 3);
171 of_list_append(actions, elem);
172 of_object_delete(elem);
173 }
174 of_flow_stats_entry_actions_set(elem, actions);
175 of_object_delete(actions);
176 }
177 of_list_append(entries, elem);
178 of_object_delete(elem);
179 }
180 of_flow_stats_reply_entries_set(obj, entries);
181 of_object_delete(entries);
182}