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); |
| 21 | of_packet_in_buffer_id_set(obj, 2882400001); |
| 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) |
Andreas Wundsam | 2bf357c | 2013-08-03 22:50:40 -0700 | [diff] [blame^] | 33 | .setBufferId(0xabcdef01L) |
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 } ); |