| 13 | | * making !FlowMods. If not building a match object from a !PacketIn, make sure to not forget to invert the wildcard bit for the field you are setting. The default match is wildcarded to all. |
| | 13 | * making !FlowMods. If not building a match object from a !PacketIn, make sure to not forget to invert the wildcard bit for the field you are setting. The default match is wildcarded to all. For example, to make a match object that only inspects source MAC address of an Ethernet header: |
| | 14 | {{{ |
| | 15 | (1) OFMatch m1 = new OFMatch(); |
| | 16 | (2) m1.setDataLayerSource(hwaddr); |
| | 17 | m1.setWildcards(OFMatch.OFPFW_ALL & ~OFMatch.OFPFW_DL_SRC); |
| | 18 | |
| | 19 | (3) flowmod.setmatch(m1); //and other params as necessary |
| | 20 | }}} |
| | 21 | |
| | 22 | |