blob: a3c642b04df231860f1ec174079b807101652bc4 [file] [log] [blame]
Rich Laneb1f347d2013-05-16 16:39:12 -07001-- binary
201 0d # version/type
300 23 # length
412 34 56 78 # xid
5ab cd ef 01 # buffer_id
6ff fe # in_port
700 10 # actions_len
800 00 # actions[0].type
900 08 # actions[0].len
1000 01 # actions[0].port
1100 00 # actions[0].max_len
1200 00 # actions[1].type
1300 08 # actions[1].len
1400 02 # actions[1].port
1500 00 # actions[1].max_len
1661 62 63 # data
17-- python
18ofp.message.packet_out(
19 xid=0x12345678,
20 buffer_id=0xabcdef01,
21 in_port=ofp.OFPP_LOCAL,
22 actions=[
23 ofp.action.output(port=1),
24 ofp.action.output(port=2)],
25 data='abc')
Rich Laneccae0312013-07-21 23:34:13 -070026-- c
27obj = of_packet_out_new(OF_VERSION_1_0);
Rich Lane03be4f82013-12-16 17:08:26 -080028of_packet_out_buffer_id_set(obj, 0xabcdef01);
Rich Laneccae0312013-07-21 23:34:13 -070029of_packet_out_in_port_set(obj, 65534);
30of_packet_out_xid_set(obj, 305419896);
31{
32 of_object_t *list = of_list_action_new(OF_VERSION_1_0);
33 {
34 of_object_t *obj = of_action_output_new(OF_VERSION_1_0);
35 of_action_output_max_len_set(obj, 0);
36 of_action_output_port_set(obj, 1);
37 of_list_append(list, obj);
38 of_object_delete(obj);
39 }
40 {
41 of_object_t *obj = of_action_output_new(OF_VERSION_1_0);
42 of_action_output_max_len_set(obj, 0);
43 of_action_output_port_set(obj, 2);
44 of_list_append(list, obj);
45 of_object_delete(obj);
46 }
47 of_packet_out_actions_set(obj, list);
48 of_object_delete(list);
49}
50{
51 of_octets_t data = { .bytes=3, .data=(uint8_t *)"\x61\x62\x63" };
52 of_packet_out_data_set(obj, &data);
53}