Fixed discard-changes for mdsal netconf, mapping code cleanup.
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / main / java / org / opendaylight / controller / sal / compatibility / MDFlowMapping.java
index 9b5d0e887541da50e9a802811b84e046f3573b7d..d3b96d010d471ec543b4f4c326f0ff3c9a098ebf 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -272,10 +272,7 @@ public final class MDFlowMapping {
         return new PushVlanActionCaseBuilder()
         .setPushVlanAction(
                 new PushVlanActionBuilder()
-                .setCfi(new VlanCfi(sourceAction.getCfi()))
-                .setPcp(sourceAction.getPcp())
-                .setTag(sourceAction.getTag())
-                .setVlanId(new VlanId(sourceAction.getVlanId()))
+                .setEthernetType(Integer.valueOf(sourceAction.getTag()))
                 .build()
                 ).build();
     }
@@ -318,7 +315,7 @@ public final class MDFlowMapping {
 
     private static SetNwTosActionCase _toAction(final SetNwTos sourceAction) {
         return new SetNwTosActionCaseBuilder()
-        .setSetNwTosAction(new SetNwTosActionBuilder().setTos(sourceAction.getNwTos()).build())
+        .setSetNwTosAction(new SetNwTosActionBuilder().setTos(FromSalConversionsUtils.dscpToTos(sourceAction.getNwTos())).build())
         .build();
     }
 
@@ -432,12 +429,12 @@ public final class MDFlowMapping {
     public static Address toInetAddress(final InetAddress address) {
         if (address instanceof Inet4Address) {
             return new Ipv4Builder()
-            .setIpv4Address(new Ipv4Prefix(InetAddresses.toAddrString(address)))
+            .setIpv4Address(new Ipv4Prefix(InetAddresses.toAddrString(address) + "/32"))
             .build();
         }
         if (address instanceof Inet6Address) {
             return new Ipv6Builder()
-            .setIpv6Address(new Ipv6Prefix(InetAddresses.toAddrString(address)))
+            .setIpv6Address(new Ipv6Prefix(InetAddresses.toAddrString(address) + "/128"))
             .build();
         }