Rich Lane | b1f347d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | 01 0a # version / type |
| 3 | 00 15 # length |
| 4 | 12 34 56 78 # xid |
| 5 | ab cd ef 01 # buffer_id |
| 6 | 00 09 # total_len |
| 7 | ff fe # in_port |
| 8 | 01 # reason |
| 9 | 00 # pad |
| 10 | 61 62 63 # data |
| 11 | -- python |
| 12 | ofp.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 Lane | ccae031 | 2013-07-21 23:34:13 -0700 | [diff] [blame] | 19 | -- c |
| 20 | obj = of_packet_in_new(OF_VERSION_1_0); |
Rich Lane | 03be4f8 | 2013-12-16 17:08:26 -0800 | [diff] [blame] | 21 | of_packet_in_buffer_id_set(obj, 0xabcdef01); |
Rich Lane | ccae031 | 2013-07-21 23:34:13 -0700 | [diff] [blame] | 22 | { |
| 23 | of_octets_t data = { .bytes=3, .data=(uint8_t *)"\x61\x62\x63" }; |
| 24 | of_packet_in_data_set(obj, &data); |
| 25 | } |
| 26 | of_packet_in_in_port_set(obj, 65534); |
| 27 | of_packet_in_reason_set(obj, 1); |
| 28 | of_packet_in_total_len_set(obj, 9); |
| 29 | of_packet_in_xid_set(obj, 305419896); |
Andreas Wundsam | e916d6f | 2013-07-30 11:33:58 -0700 | [diff] [blame] | 30 | -- java |
| 31 | builder |
| 32 | .setXid(0x12345678) |
Rob Vaterlaus | b10ae55 | 2013-09-23 14:39:39 -0700 | [diff] [blame] | 33 | .setBufferId(OFBufferId.of(0xabcdef01)) |
Andreas Wundsam | e916d6f | 2013-07-30 11:33:58 -0700 | [diff] [blame] | 34 | .setTotalLen(9) |
| 35 | .setInPort(OFPort.LOCAL) |
| 36 | .setReason(OFPacketInReason.ACTION) |
| 37 | .setData(new byte[] { 0x61, 0x62, 0x63 } ); |