Search in sources :

Example 1 with NiciraSetNshContextHeader

use of org.onosproject.driver.extensions.NiciraSetNshContextHeader in project onos by opennetworkinglab.

the class NiciraSetNshContextHeaderCodec method decode.

@Override
public NiciraSetNshContextHeader decode(ObjectNode json, CodecContext context) {
    if (json == null || !json.isObject()) {
        return null;
    }
    // parse nsh context header
    int contextHeaderInt = nullIsIllegal(json.get(NSH_CONTEXT_HEADER), NSH_CONTEXT_HEADER + MISSING_MEMBER_MESSAGE).asInt();
    NshContextHeader contextHeader = NshContextHeader.of(contextHeaderInt);
    // parse type
    int extensionTypeInt = nullIsIllegal(json.get(TYPE), TYPE + MISSING_MEMBER_MESSAGE).asInt();
    ExtensionTreatmentType type = new ExtensionTreatmentType(extensionTypeInt);
    return new NiciraSetNshContextHeader(contextHeader, type);
}
Also used : NiciraSetNshContextHeader(org.onosproject.driver.extensions.NiciraSetNshContextHeader) NshContextHeader(org.onosproject.net.NshContextHeader) NiciraSetNshContextHeader(org.onosproject.driver.extensions.NiciraSetNshContextHeader) ExtensionTreatmentType(org.onosproject.net.flow.instructions.ExtensionTreatmentType)

Aggregations

NiciraSetNshContextHeader (org.onosproject.driver.extensions.NiciraSetNshContextHeader)1 NshContextHeader (org.onosproject.net.NshContextHeader)1 ExtensionTreatmentType (org.onosproject.net.flow.instructions.ExtensionTreatmentType)1