use of org.onosproject.segmentrouting.pwaas.L2Mode in project trellis-control by opennetworkinglab.
the class PseudowireCodec method decode.
@Override
public DefaultL2TunnelDescription decode(ObjectNode json, CodecContext context) {
Integer id = parsePwId(json.path(PW_ID).asText());
ConnectPoint cP1, cP2;
cP1 = ConnectPoint.deviceConnectPoint(json.path(CP1).asText());
cP2 = ConnectPoint.deviceConnectPoint(json.path(CP2).asText());
VlanId cP1InnerVlan, cP1OuterVlan, cP2InnerVlan, cP2OuterVlan, sdTag;
cP1InnerVlan = parseVlan(json.path(CP1_INNER_TAG).asText());
cP1OuterVlan = parseVlan(json.path(CP1_OUTER_TAG).asText());
cP2InnerVlan = parseVlan(json.path(CP2_INNER_TAG).asText());
cP2OuterVlan = parseVlan(json.path(CP2_OUTER_TAG).asText());
sdTag = parseVlan(json.path(SERVICE_DELIM_TAG).asText());
L2Mode mode = parseMode(json.path(MODE).asText());
MplsLabel pwLabel = parsePWLabel(json.path(PW_LABEL).asText());
DefaultL2Tunnel l2Tunnel = new DefaultL2Tunnel(mode, sdTag, id, pwLabel);
DefaultL2TunnelPolicy l2Policy = new DefaultL2TunnelPolicy(id, cP1, cP1InnerVlan, cP1OuterVlan, cP2, cP2InnerVlan, cP2OuterVlan);
return new DefaultL2TunnelDescription(l2Tunnel, l2Policy);
}
Aggregations