Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | 04 0a # version, type |
| 3 | 00 35 # length |
| 4 | 12 34 56 78 # xid |
| 5 | 00 00 00 64 # buffer_id |
| 6 | 42 68 # total_len |
| 7 | 01 # reason |
| 8 | 14 # table_id |
| 9 | fe dc ba 98 76 54 32 10 # cookie |
| 10 | 00 01 # match.type |
| 11 | 00 16 # match.length |
Yotam Harchol | 5749dc3 | 2013-08-22 15:41:30 -0700 | [diff] [blame] | 12 | 80 00 01 08 # match.oxm_list[0].type_len - Input Port |
Yotam Harchol | 7ec170e | 2013-08-22 15:20:24 -0700 | [diff] [blame] | 13 | 00 00 00 04 # match.oxm_list[0].value |
| 14 | 00 00 00 05 # match.oxm_list[0].mask |
Yotam Harchol | 5749dc3 | 2013-08-22 15:41:30 -0700 | [diff] [blame] | 15 | 80 00 2A 02 # match.oxm_list[1].type_len - ARP OpCode |
Yotam Harchol | 7ec170e | 2013-08-22 15:20:24 -0700 | [diff] [blame] | 16 | 00 01 # match.oxm_list[1].value |
Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 17 | 00 00 # match.pad |
| 18 | 00 00 # pad |
| 19 | 61 62 63 # data |
| 20 | -- python |
| 21 | ofp.message.packet_in( |
| 22 | xid=0x12345678, |
| 23 | buffer_id=100, |
| 24 | total_len=17000, |
| 25 | reason=ofp.OFPR_ACTION, |
| 26 | table_id=20, |
| 27 | cookie=0xFEDCBA9876543210, |
| 28 | match=ofp.match(oxm_list=[ |
Yotam Harchol | 5749dc3 | 2013-08-22 15:41:30 -0700 | [diff] [blame] | 29 | ofp.oxm.in_port_masked(value=4, value_mask=5), |
| 30 | ofp.oxm.arp_op(value=1) |
| 31 | ]), |
Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 32 | data="abc") |
Andreas Wundsam | 6cd99e5 | 2013-08-02 22:27:23 -0700 | [diff] [blame] | 33 | -- java |
| 34 | builder |
| 35 | .setXid(0x12345678) |
| 36 | .setBufferId(100) |
| 37 | .setTotalLen(17000) |
| 38 | .setReason(OFPacketInReason.ACTION) |
| 39 | .setTableId((byte) 20) |
| 40 | .setCookie(U64.parseHex("FEDCBA9876543210")) |
| 41 | .setMatch( |
Yotam Harchol | 5749dc3 | 2013-08-22 15:41:30 -0700 | [diff] [blame] | 42 | factory.buildMatchV3() |
| 43 | .setMasked(MatchField.IN_PORT, OFPort.of(4), OFPort.of(5)) |
| 44 | .setExact(MatchField.ARP_OP, ArpOpcode.ARP_OPCODE_REQUEST) |
| 45 | .build() |
Andreas Wundsam | 6cd99e5 | 2013-08-02 22:27:23 -0700 | [diff] [blame] | 46 | ) |
| 47 | .setData(new byte[] { 97, 98, 99 } ); |
| 48 | |