@Override public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) { ExtensionSelectorType type = extensionSelector.type(); if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type())) { NiciraMatchNshSpi niciraNshSpi = (NiciraMatchNshSpi) extensionSelector; return factory.oxms().nsp(U32.of(niciraNshSpi.nshSpi().servicePathId())); } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type())) { NiciraMatchNshSi niciraNshSi = (NiciraMatchNshSi) extensionSelector; return factory.oxms().nsi(U8.of(niciraNshSi.nshSi().serviceIndex())); } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_ENCAP_ETH_TYPE.type())) { NiciraMatchEncapEthType niciraEncapEthType = (NiciraMatchEncapEthType) extensionSelector; return factory.oxms().encapEthType(U16.of(niciraEncapEthType.encapEthType())); } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH1.type())) { // TODO } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH2.type())) { // TODO } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH3.type())) { // TODO } if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH4.type())) { // TODO } return null; }
@Override public ExtensionSelector mapOxm(OFOxm<?> oxm) { if (oxm.getMatchField() == MatchField.NSP) { OFOxmNsp oxmField = (OFOxmNsp) oxm; return new NiciraMatchNshSpi(NshServicePathId.of(oxmField.getValue().getRaw())); } if (oxm.getMatchField() == MatchField.NSI) { OFOxmNsi oxmField = (OFOxmNsi) oxm; return new NiciraMatchNshSi(NshServiceIndex.of(oxmField.getValue().getRaw())); } if (oxm.getMatchField() == MatchField.ENCAP_ETH_TYPE) { OFOxmEncapEthType oxmField = (OFOxmEncapEthType) oxm; return new NiciraMatchEncapEthType(oxmField.getValue().getRaw()); } return null; }
case IPV6_EXTHDR: builder.matchIPv6ExthdrFlags((short) match.get(MatchField.IPV6_EXTHDR) .getValue()); break; case OCH_SIGID:
(IPv6ExthdrFlagsCriterion) c; mBuilder.setExact(MatchField.IPV6_EXTHDR, U16.of(exthdrFlagsCriterion.exthdrFlags())); break; case OCH_SIGID:
case ENCAP_ETH_TYPE: OFOxmEncapEthType encapEthType = (OFOxmEncapEthType) oxm; return new NiciraEncapEthType((encapEthType.getValue().getRaw())); case TUN_GPE_NP: OFOxmTunGpeNp tunGpeNp = (OFOxmTunGpeNp) oxm;
return factory.actions().setField(factory.oxms().encapEthType(U16.of(niciraEncapEthType.encapEthType())));