use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class InPhyPortEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final long port = message.readUnsignedInt();
if (Objects.isNull(builder.getInPhyPort())) {
builder.setInPhyPort(new NodeConnectorId(OpenflowPortsUtil.getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, port)));
} else {
throwErrorOnMalformed(builder, "inPhyPort");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class InPortEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final long port = message.readUnsignedInt();
if (Objects.isNull(builder.getInPort())) {
builder.setInPort(new NodeConnectorId(OpenflowPortsUtil.getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, port)));
} else {
throwErrorOnMalformed(builder, "inPort");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class QueueDirectStatisticsServiceTest method testBuildRequestBody.
@Override
public void testBuildRequestBody() throws Exception {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
final MultipartRequestQueueStats body = (MultipartRequestQueueStats) ((MultipartRequest) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
assertEquals(nodeConnectorId, body.getNodeConnectorId());
assertEquals(QUEUE_NO, body.getQueueId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class MatchV10Convertor method convert.
@Override
public MatchV10 convert(final Match source, final VersionConvertorData data) {
MatchV10Builder matchBuilder = new MatchV10Builder();
boolean dlDst = true;
boolean dlSsc = true;
boolean dlType = true;
boolean dlVlan = true;
boolean dlVlanPcp = true;
boolean ipPort = true;
boolean nwProto = true;
boolean nwTos = true;
boolean tpDst = true;
boolean tpSrc = true;
matchBuilder.setInPort(0);
matchBuilder.setDlDst(ZERO_MAC);
matchBuilder.setDlSrc(ZERO_MAC);
matchBuilder.setDlType(0);
matchBuilder.setDlVlan(OFP_VLAN_NONE);
matchBuilder.setDlVlanPcp((short) 0);
matchBuilder.setNwDst(ZERO_IPV4);
matchBuilder.setNwDstMask((short) 0);
matchBuilder.setNwSrc(ZERO_IPV4);
matchBuilder.setNwSrcMask((short) 0);
matchBuilder.setNwProto((short) 0);
matchBuilder.setNwTos((short) 0);
matchBuilder.setTpSrc(0);
matchBuilder.setTpDst(0);
if (source != null) {
EthernetMatch ethernetMatch = source.getEthernetMatch();
if (ethernetMatch != null) {
dlDst = convertEthernetDlDst(matchBuilder, ethernetMatch);
dlSsc = convertEthernetDlSrc(matchBuilder, ethernetMatch);
dlType = convertEthernetDlType(matchBuilder, ethernetMatch);
}
VlanMatch vlanMatch = source.getVlanMatch();
if (vlanMatch != null) {
dlVlan = convertDlVlan(matchBuilder, vlanMatch);
dlVlanPcp = convertDlVlanPcp(matchBuilder, vlanMatch);
}
NodeConnectorId inPort = source.getInPort();
if (inPort != null) {
ipPort = convertInPortMatch(matchBuilder, inPort);
}
Layer3Match l3Match = source.getLayer3Match();
if (l3Match != null) {
if (l3Match instanceof Ipv4Match) {
Ipv4Match ipv4 = (Ipv4Match) l3Match;
convertL3Ipv4SrcMatch(matchBuilder, ipv4);
convertL3Ipv4DstMatch(matchBuilder, ipv4);
}
}
IpMatch ipMatch = source.getIpMatch();
if (ipMatch != null) {
nwProto = convertNwProto(matchBuilder, ipMatch);
nwTos = convertNwTos(matchBuilder, ipMatch);
}
Layer4Match layer4Match = source.getLayer4Match();
if (layer4Match != null) {
if (layer4Match instanceof TcpMatch) {
TcpMatch tcpMatch = (TcpMatch) layer4Match;
tpSrc = convertL4TpSrcMatch(matchBuilder, tcpMatch);
tpDst = convertL4TpDstMatch(matchBuilder, tcpMatch);
} else if (layer4Match instanceof UdpMatch) {
UdpMatch udpMatch = (UdpMatch) layer4Match;
tpSrc = convertL4UdpSrcMatch(matchBuilder, udpMatch);
tpDst = convertL4UdpDstMatch(matchBuilder, udpMatch);
}
} else {
Icmpv4Match icmpv4Match = source.getIcmpv4Match();
if (icmpv4Match != null) {
Short type = icmpv4Match.getIcmpv4Type();
if (type != null) {
matchBuilder.setTpSrc(type.intValue());
tpSrc = false;
}
Short code = icmpv4Match.getIcmpv4Code();
if (code != null) {
matchBuilder.setTpDst(code.intValue());
tpDst = false;
}
}
}
}
FlowWildcardsV10 wildCards = new FlowWildcardsV10(dlDst, dlSsc, dlType, dlVlan, dlVlanPcp, ipPort, nwProto, nwTos, tpDst, tpSrc);
matchBuilder.setWildcards(wildCards);
return matchBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project openflowplugin by opendaylight.
the class LearningSwitchHandlerSimpleImpl method nodeConnectorId.
private NodeConnectorId nodeConnectorId(String connectorId) {
NodeKey nodeKey = nodePath.firstKeyOf(Node.class, NodeKey.class);
StringBuilder stringId = new StringBuilder(nodeKey.getId().getValue()).append(":").append(connectorId);
return new NodeConnectorId(stringId.toString());
}
Aggregations