blob: d5ccf3202fcfec19d9715cf29d0b2c217aad257d [file] [log] [blame]
Rich Laneb1f347d2013-05-16 16:39:12 -07001-- binary
201 0a # version / type
300 15 # length
412 34 56 78 # xid
5ab cd ef 01 # buffer_id
600 09 # total_len
7ff fe # in_port
801 # reason
900 # pad
1061 62 63 # data
11-- python
12ofp.message.packet_in(
13 xid=0x12345678,
14 buffer_id=0xabcdef01,
15 total_len=9,
16 in_port=ofp.OFPP_LOCAL,
17 reason=ofp.OFPR_ACTION,
18 data='abc')
Rich Laneccae0312013-07-21 23:34:13 -070019-- c
20obj = of_packet_in_new(OF_VERSION_1_0);
Rich Lane03be4f82013-12-16 17:08:26 -080021of_packet_in_buffer_id_set(obj, 0xabcdef01);
Rich Laneccae0312013-07-21 23:34:13 -070022{
23 of_octets_t data = { .bytes=3, .data=(uint8_t *)"\x61\x62\x63" };
24 of_packet_in_data_set(obj, &data);
25}
26of_packet_in_in_port_set(obj, 65534);
27of_packet_in_reason_set(obj, 1);
28of_packet_in_total_len_set(obj, 9);
29of_packet_in_xid_set(obj, 305419896);
Andreas Wundsame916d6f2013-07-30 11:33:58 -070030-- java
31builder
32 .setXid(0x12345678)
Rob Vaterlausb10ae552013-09-23 14:39:39 -070033 .setBufferId(OFBufferId.of(0xabcdef01))
Andreas Wundsame916d6f2013-07-30 11:33:58 -070034 .setTotalLen(9)
35 .setInPort(OFPort.LOCAL)
36 .setReason(OFPacketInReason.ACTION)
37 .setData(new byte[] { 0x61, 0x62, 0x63 } );