Rich Lane | 9a3f1fd | 2013-05-10 16:29:17 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | 00 68 # length |
| 3 | 03 # table_id |
| 4 | 00 # pad |
| 5 | 00 3f ff ff # match.wildcards |
| 6 | 00 00 00 00 # remaining match fields |
| 7 | 00 00 00 00 00 00 00 00 # ... |
| 8 | 00 00 00 00 00 00 00 00 # ... |
| 9 | 00 00 00 00 00 00 00 00 # ... |
| 10 | 00 00 00 00 00 00 00 00 # ... |
| 11 | 00 00 00 01 # duration_sec |
| 12 | 00 00 00 02 # duration_nsec |
| 13 | 00 64 # priority |
| 14 | 00 05 # idle_timeout |
| 15 | 00 0a # hard_timeout |
| 16 | 00 00 00 00 00 00 # pad |
| 17 | 01 23 45 67 89 ab cd ef # cookie |
| 18 | 00 00 00 00 00 00 00 0a # packet_count |
| 19 | 00 00 00 00 00 00 03 e8 # byte_count |
| 20 | 00 00 # actions[0].type |
| 21 | 00 08 # actions[0].len |
| 22 | 00 01 # actions[0].port |
| 23 | 00 00 # actions[0].max_len |
| 24 | 00 00 # actions[1].type |
| 25 | 00 08 # actions[1].len |
| 26 | 00 02 # actions[1].port |
| 27 | 00 00 # actions[1].max_len |
| 28 | -- python |
| 29 | ofp.flow_stats_entry( |
| 30 | table_id=3, |
| 31 | match=ofp.match(), |
| 32 | duration_sec=1, |
| 33 | duration_nsec=2, |
| 34 | priority=100, |
| 35 | idle_timeout=5, |
| 36 | hard_timeout=10, |
| 37 | cookie=0x0123456789abcdef, |
| 38 | packet_count=10, |
| 39 | byte_count=1000, |
| 40 | actions=[ |
| 41 | ofp.action.output(port=1), |
| 42 | ofp.action.output(port=2)]) |
Rich Lane | ccae031 | 2013-07-21 23:34:13 -0700 | [diff] [blame] | 43 | -- c |
| 44 | obj = of_flow_stats_entry_new(OF_VERSION_1_0); |
| 45 | { |
| 46 | of_object_t list; |
| 47 | of_flow_stats_entry_actions_bind(obj, &list); |
| 48 | { |
| 49 | of_object_t *obj = of_action_output_new(OF_VERSION_1_0); |
| 50 | of_action_output_max_len_set(obj, 0); |
| 51 | of_action_output_port_set(obj, 1); |
| 52 | of_list_append(&list, obj); |
| 53 | of_object_delete(obj); |
| 54 | } |
| 55 | { |
| 56 | of_object_t *obj = of_action_output_new(OF_VERSION_1_0); |
| 57 | of_action_output_max_len_set(obj, 0); |
| 58 | of_action_output_port_set(obj, 2); |
| 59 | of_list_append(&list, obj); |
| 60 | of_object_delete(obj); |
| 61 | } |
| 62 | } |
| 63 | of_flow_stats_entry_byte_count_set(obj, 1000); |
| 64 | of_flow_stats_entry_cookie_set(obj, 81985529216486895); |
| 65 | of_flow_stats_entry_duration_nsec_set(obj, 2); |
| 66 | of_flow_stats_entry_duration_sec_set(obj, 1); |
| 67 | of_flow_stats_entry_hard_timeout_set(obj, 10); |
| 68 | of_flow_stats_entry_idle_timeout_set(obj, 5); |
| 69 | { |
| 70 | of_match_t match = { OF_VERSION_1_0 }; |
| 71 | of_flow_stats_entry_match_set(obj, &match); |
| 72 | } |
| 73 | of_flow_stats_entry_packet_count_set(obj, 10); |
| 74 | of_flow_stats_entry_priority_set(obj, 100); |
| 75 | of_flow_stats_entry_table_id_set(obj, 3); |