@Override public byte[] serialize() { return appKryo.serialize(nshSpi.servicePathId()); }
@Override public ObjectNode encode(NiciraSetNshSpi niciraSetNshSpi, CodecContext context) { checkNotNull(niciraSetNshSpi, "Nicira Set Nsh Spi cannot be null"); ObjectNode root = context.mapper().createObjectNode() .put(NSH_PATH_ID, niciraSetNshSpi.nshSpi().servicePathId()); return root; }
@Override public ObjectNode encode(NiciraMatchNshSpi niciraMatchNshSpi, CodecContext context) { checkNotNull(niciraMatchNshSpi, "Nicira Match Nsh Spi cannot be null"); ObjectNode root = context.mapper().createObjectNode() .put(NSH_PATH_ID, niciraMatchNshSpi.nshSpi().servicePathId()); return root; }
@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; }
return factory.actions().setField(factory.oxms().nsp(U32.of(niciraNshSpi.nshSpi().servicePathId())));