blob: 2f9df6458df8174c78155e88d6be3d178ec1fdf4 [file] [log] [blame]
Rich Lane9a3f1fd2013-05-10 16:29:17 -07001-- binary
200 68 # length
303 # table_id
400 # pad
500 3f ff ff # match.wildcards
600 00 00 00 # remaining match fields
700 00 00 00 00 00 00 00 # ...
800 00 00 00 00 00 00 00 # ...
900 00 00 00 00 00 00 00 # ...
1000 00 00 00 00 00 00 00 # ...
1100 00 00 01 # duration_sec
1200 00 00 02 # duration_nsec
1300 64 # priority
1400 05 # idle_timeout
1500 0a # hard_timeout
1600 00 00 00 00 00 # pad
1701 23 45 67 89 ab cd ef # cookie
1800 00 00 00 00 00 00 0a # packet_count
1900 00 00 00 00 00 03 e8 # byte_count
2000 00 # actions[0].type
2100 08 # actions[0].len
2200 01 # actions[0].port
2300 00 # actions[0].max_len
2400 00 # actions[1].type
2500 08 # actions[1].len
2600 02 # actions[1].port
2700 00 # actions[1].max_len
28-- python
29ofp.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 Laneccae0312013-07-21 23:34:13 -070043-- c
44obj = 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}
63of_flow_stats_entry_byte_count_set(obj, 1000);
64of_flow_stats_entry_cookie_set(obj, 81985529216486895);
65of_flow_stats_entry_duration_nsec_set(obj, 2);
66of_flow_stats_entry_duration_sec_set(obj, 1);
67of_flow_stats_entry_hard_timeout_set(obj, 10);
68of_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}
73of_flow_stats_entry_packet_count_set(obj, 10);
74of_flow_stats_entry_priority_set(obj, 100);
75of_flow_stats_entry_table_id_set(obj, 3);