import java.util.List;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
+import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
private static final short PROTO_UDP = 17;
@Override
- public List<MatchEntries> convert(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match match) {
+ public List<MatchEntries> convert(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match match,BigInteger datapathid) {
List<MatchEntries> matchEntriesList = new ArrayList<>();
if (match.getInPort() != null) {
- matchEntriesList.add(toOfPort(InPort.class, match.getInPort()));
+ matchEntriesList.add(toOfPort(InPort.class, InventoryDataServiceUtil.portNumberfromNodeConnectorId(match.getInPort())));
}
if (match.getInPhyPort() != null) {
- matchEntriesList.add(toOfPort(InPhyPort.class, match.getInPhyPort()));
+ matchEntriesList.add(toOfPort(InPhyPort.class, InventoryDataServiceUtil.portNumberfromNodeConnectorId(match.getInPhyPort())));
}
org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Metadata metadata = match
* @return
* @author avishnoi@in.ibm.com
*/
- public static Match fromOFMatchV10ToSALMatch(MatchV10 swMatch){
+ public static Match fromOFMatchV10ToSALMatch(MatchV10 swMatch,BigInteger datapathid){
MatchBuilder matchBuilder = new MatchBuilder();
EthernetMatchBuilder ethMatchBuilder = new EthernetMatchBuilder();
VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
IpMatchBuilder ipMatchBuilder = new IpMatchBuilder();
if(swMatch.getInPort() != null){
- matchBuilder.setInPort((long)swMatch.getInPort());
+ matchBuilder.setInPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathid,(long)swMatch.getInPort()));
}
if(swMatch.getDlSrc()!= null){
* @author avishnoi@in.ibm.com
*/
public static Match fromOFMatchToSALMatch(
- org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match swMatch) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match swMatch,BigInteger datapathid) {
MatchBuilder matchBuilder = new MatchBuilder();
EthernetMatchBuilder ethMatchBuilder = new EthernetMatchBuilder();
if(ofMatch.getOxmMatchField().equals(InPort.class)){
PortNumberMatchEntry portNumber = ofMatch.getAugmentation(PortNumberMatchEntry.class);
- matchBuilder.setInPort(portNumber.getPortNumber().getValue());
+ matchBuilder.setInPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathid, portNumber.getPortNumber().getValue()));
}else if (ofMatch.getOxmMatchField().equals(InPhyPort.class)){
PortNumberMatchEntry portNumber = ofMatch.getAugmentation(PortNumberMatchEntry.class);
- matchBuilder.setInPhyPort(portNumber.getPortNumber().getValue());
+ matchBuilder.setInPhyPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathid,portNumber.getPortNumber().getValue()));
}else if(ofMatch.getOxmMatchField().equals(Metadata.class)){
MetadataBuilder metadataBuilder = new MetadataBuilder();
MetadataMatchEntry metadataMatchEntry = ofMatch.getAugmentation(MetadataMatchEntry.class);
if(metadataMatchEntry != null){
- metadataBuilder.setMetadata(new BigInteger(metadataMatchEntry.getMetadata()));
+ metadataBuilder.setMetadata(new BigInteger(1, metadataMatchEntry.getMetadata()));
MaskMatchEntry maskMatchEntry = ofMatch.getAugmentation(MaskMatchEntry.class);
if(maskMatchEntry != null){
metadataBuilder.setMetadataMask(maskMatchEntry.getMask());
TunnelBuilder tunnelBuilder = new TunnelBuilder();
MetadataMatchEntry metadataMatchEntry = ofMatch.getAugmentation(MetadataMatchEntry.class);
if(metadataMatchEntry != null){
- tunnelBuilder.setTunnelId(new BigInteger(metadataMatchEntry.getMetadata()));
+ tunnelBuilder.setTunnelId(new BigInteger(1, metadataMatchEntry.getMetadata()));
MaskMatchEntry maskMatchEntry = ofMatch.getAugmentation(MaskMatchEntry.class);
if(maskMatchEntry != null){
tunnelBuilder.setTunnelMask(maskMatchEntry.getMask());
matchEntriesBuilder.setOxmClass(OpenflowBasicClass.class);
matchEntriesBuilder.setOxmMatchField(VlanVid.class);
VlanVidMatchEntryBuilder vlanVidBuilder = new VlanVidMatchEntryBuilder();
- if (vlanId.isVlanIdPresent() == true) {
+ if (vlanId.isVlanIdPresent() == Boolean.TRUE) {
setCfiBit = true;
if (vlanId.getVlanId() != null) {
vidEntryValue = vlanId.getVlanId().getValue();